Discovery problems
This commit is contained in:
@@ -786,7 +786,7 @@ def publish_state(client):
|
|||||||
states[str(i)] = round(val, 1)
|
states[str(i)] = round(val, 1)
|
||||||
client.publish(gt["state"], str(round(val, 1)), retain=True)
|
client.publish(gt["state"], str(round(val, 1)), retain=True)
|
||||||
client.publish(gt["status"], "online", retain=True)
|
client.publish(gt["status"], "online", retain=True)
|
||||||
info(f"Gauge {i} state: {val:.1f} step={g._current_step}")
|
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)
|
client.publish(T_STATE, ujson.dumps(states), retain=True)
|
||||||
|
|
||||||
|
|
||||||
@@ -893,6 +893,7 @@ def main():
|
|||||||
moved_any = True
|
moved_any = True
|
||||||
|
|
||||||
if moved_any:
|
if moved_any:
|
||||||
|
publish_state(client_ref)
|
||||||
delay_us = 1_000_000 // MICROSTEPS_PER_SECOND
|
delay_us = 1_000_000 // MICROSTEPS_PER_SECOND
|
||||||
utime.sleep_us(delay_us)
|
utime.sleep_us(delay_us)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user