Discovery problems

This commit is contained in:
2026-04-13 01:56:30 +02:00
parent 3ec4c841bb
commit a4fc63530b

View File

@@ -794,10 +794,10 @@ def publish_state(client):
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)
val_rounded = int(val * 10) / 10
states[str(i)] = val_rounded
client.publish(gt["state"], f"{val_rounded:.1f}", retain=True)
client.publish(gt["status"], "online", retain=True)
info(f"G{i} v={val:.1f} tgt={gauge_targets[i]:.1f} step={g._current_step}")
client.publish(T_STATE, ujson.dumps(states), retain=True)