From 4ef914fa1980e52fd1cb1d7a6fdf307dfa408b35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Wed, 13 Jul 2022 09:53:27 +0200 Subject: [PATCH] added relay switch in mqtt_on_message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- main.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index ccce1b7..518aeb9 100644 --- a/main.py +++ b/main.py @@ -101,24 +101,24 @@ def mqtt_on_message(client, userdata, msg): if topic == "strawberry-pi-greenhouse/relay/channel/1": if payload == "on": - pass + relay_ch_1.on() elif payload == "off": - pass + relay_ch_1.off() elif topic == "strawberry-pi-greenhouse/relay/channel/2": if payload == "on": - pass + relay_ch_2.on() elif payload == "off": - pass + relay_ch_2.off() elif topic == "strawberry-pi-greenhouse/relay/channel/3": if payload == "on": - pass + relay_ch_3.on() elif payload == "off": - pass + relay_ch_3.off() elif topic == "strawberry-pi-greenhouse/relay/channel/4": if payload == "on": - pass + relay_ch_4.on() elif payload == "off": - pass + relay_ch_4.off() if __name__ == "__main__":