Fix linting
This commit is contained in:
6
hc2mqtt
6
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 (
|
||||
|
||||
Reference in New Issue
Block a user