From d6e26d0bfbe8a1dccf97cfb6adfdb117de7bb5d5 Mon Sep 17 00:00:00 2001 From: Meatballs1 Date: Wed, 20 Mar 2024 13:53:35 +0000 Subject: [PATCH] Fix linting --- hc2mqtt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hc2mqtt b/hc2mqtt index a487b75..fbc9cf2 100755 --- a/hc2mqtt +++ b/hc2mqtt @@ -48,13 +48,14 @@ def hc2mqtt( elif rc == 0: print(now(), f"MQTT connection established: {rc}") client.publish(f"{mqtt_prefix}LWT", payload="Online", qos=0, retain=True) + # Re-subscribe to all device topics on reconnection for device in devices: mqtt_set_topic = f"{mqtt_prefix}{device['name']}/set" print(now(), device["name"], f"set topic: {mqtt_set_topic}") client.subscribe(mqtt_set_topic) for value in device["features"]: - # If the device has the ActiveProgram feature it allows programs to be started and - # scheduled via /ro/activeProgram + # If the device has the ActiveProgram feature it allows programs to be started + # andi scheduled via /ro/activeProgram if "BSH.Common.Root.ActiveProgram" == device["features"][value]["name"]: mqtt_active_program_topic = f"{mqtt_prefix}{device['name']}/activeProgram" print(now(), device["name"], f"program topic: {mqtt_active_program_topic}") @@ -146,7 +147,6 @@ dev = {} def client_connect(client, device, mqtt_topic): host = device["host"] device_topics = topics - active_program = False for value in device["features"]: if (