diff --git a/hc2mqtt.py b/hc2mqtt.py index dbee2de..6b68d48 100755 --- a/hc2mqtt.py +++ b/hc2mqtt.py @@ -179,7 +179,7 @@ def client_connect(client, device, mqtt_topic): while True: msg = dev[device["name"]].recv() - client.publish(F"{mqtt_topic}/LWT", "online") + client.publish(f"{mqtt_topic}/LWT", "online") if msg is None: break if len(msg) > 0: @@ -211,7 +211,7 @@ def client_connect(client, device, mqtt_topic): except Exception as e: print(now(), device["name"], "ERROR", e, file=sys.stderr) - client.publish(F"{mqtt_topic}/LWT", "offline", retain=True) + client.publish(f"{mqtt_topic}/LWT", "offline", retain=True) time.sleep(40)