added relay switch in mqtt_on_message
Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>master
parent
ee1a5ac09d
commit
4ef914fa19
16
main.py
16
main.py
|
@ -101,24 +101,24 @@ def mqtt_on_message(client, userdata, msg):
|
||||||
|
|
||||||
if topic == "strawberry-pi-greenhouse/relay/channel/1":
|
if topic == "strawberry-pi-greenhouse/relay/channel/1":
|
||||||
if payload == "on":
|
if payload == "on":
|
||||||
pass
|
relay_ch_1.on()
|
||||||
elif payload == "off":
|
elif payload == "off":
|
||||||
pass
|
relay_ch_1.off()
|
||||||
elif topic == "strawberry-pi-greenhouse/relay/channel/2":
|
elif topic == "strawberry-pi-greenhouse/relay/channel/2":
|
||||||
if payload == "on":
|
if payload == "on":
|
||||||
pass
|
relay_ch_2.on()
|
||||||
elif payload == "off":
|
elif payload == "off":
|
||||||
pass
|
relay_ch_2.off()
|
||||||
elif topic == "strawberry-pi-greenhouse/relay/channel/3":
|
elif topic == "strawberry-pi-greenhouse/relay/channel/3":
|
||||||
if payload == "on":
|
if payload == "on":
|
||||||
pass
|
relay_ch_3.on()
|
||||||
elif payload == "off":
|
elif payload == "off":
|
||||||
pass
|
relay_ch_3.off()
|
||||||
elif topic == "strawberry-pi-greenhouse/relay/channel/4":
|
elif topic == "strawberry-pi-greenhouse/relay/channel/4":
|
||||||
if payload == "on":
|
if payload == "on":
|
||||||
pass
|
relay_ch_4.on()
|
||||||
elif payload == "off":
|
elif payload == "off":
|
||||||
pass
|
relay_ch_4.off()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue