Discovery problems

This commit is contained in:
2026-04-13 01:37:40 +02:00
parent 80bacb4b39
commit 8f6f57a079

View File

@@ -779,12 +779,15 @@ def publish_discovery(client):
def publish_state(client):
states = {}
for i, g in enumerate(gauge_objects):
gt = gauge_topics[i]
val = g.get()
states[str(i)] = round(val, 1)
client.publish(gt["state"], str(round(val, 1)), retain=True)
client.publish(gt["status"], "online", retain=True)
info(f"Gauge {i} state: {val:.1f} step={g._current_step}")
client.publish(T_STATE, ujson.dumps(states), retain=True)
# ---------------------------------------------------------------------------