mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-05 05:31:31 +02:00
Two issues prevented recovery from stale printer MQTT connections:
1. The spurious-disconnect filter (30s window) could suppress real
keepalive-timeout disconnects (which fire at ~22.5s with keepalive=15s).
Now checks rc.is_failure so error disconnects are never suppressed,
and tightens the window from 30s to 10s.
2. Stale detection (60s no messages) set state.connected=False but left
the TCP socket open, so paho kept publishing into the void. Now
force-closes the socket so paho's loop thread detects the break and
auto-reconnects.