parent
5ba4ca8d8e
commit
bb2146c322
8
main.py
8
main.py
|
@ -169,13 +169,13 @@ if __name__ == '__main__':
|
||||||
power = payload
|
power = payload
|
||||||
|
|
||||||
elif topic == "server-rack-led/rgb":
|
elif topic == "server-rack-led/rgb":
|
||||||
json_payload = json.loads(dict(payload))
|
splitted_payload = payload.split(",")
|
||||||
global r
|
global r
|
||||||
r = str(json_payload["r"])
|
r = str(splitted_payload[0])
|
||||||
global g
|
global g
|
||||||
g = str(json_payload["g"])
|
g = str(splitted_payload[1])
|
||||||
global b
|
global b
|
||||||
b = str(json_payload["b"])
|
b = str(splitted_payload[2])
|
||||||
|
|
||||||
elif topic == "server-rack-led/mode":
|
elif topic == "server-rack-led/mode":
|
||||||
if payload == "0":
|
if payload == "0":
|
||||||
|
|
Loading…
Reference in New Issue