From e11994bde122b8fb1ee144ffad3a7a37fa6031c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Thu, 14 Jul 2022 01:35:39 +0200 Subject: [PATCH] temp test with relay nativ in if MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index c2f40ae..20426fa 100644 --- a/main.py +++ b/main.py @@ -91,9 +91,13 @@ def mqtt_on_message(client, userdata, msg): if topic == "strawberry-pi-greenhouse/relay/channel/1": if payload == "on": - relay_controller(channel_1, "True") + # relay_controller(channel_1, "True") + relay = gpiozero.OutputDevice(4, active_high=True, initial_value=False) + relay.on() elif payload == "off": - relay_controller(channel_1, "False") + # relay_controller(channel_1, "False") + relay = gpiozero.OutputDevice(4, active_high=True, initial_value=False) + relay.on() elif topic == "strawberry-pi-greenhouse/relay/channel/2": if payload == "on": relay_controller(channel_2, "True")