Summary
After an unexpected MQTT hangup (AWS_ERROR_MQTT_UNEXPECTED_HANGUP), the library does not automatically reconnect. The CONNECTION_INTERRUPTED event is fired, but CONNECTION_RESUMED never fires. The connection remains dead until the application is manually restarted.
Steps to Reproduce
- Run ha_nwp500 integration for several days
- Wait for an unexpected connection hangup to occur (appears to happen daily around 3:43 AM)
- Observe logs showing CONNECTION_INTERRUPTED event
- No CONNECTION_RESUMED event is emitted
- Device sensors become unavailable
Expected Behavior
- After CONNECTION_INTERRUPTED event, automatic reconnection should attempt to restore the connection
- CONNECTION_RESUMED event should fire when reconnection succeeds
- If automatic reconnection fails, it should retry with exponential backoff
Environment
- nwp500-python: (eval branch)
- AWS IoT Core MQTT endpoint: a1t30mldyslmuq-ats.iot.us-east-1.amazonaws.com
Error Pattern
Connection interrupted (no reconnection follows):
2026-05-12 03:43:21.926 WARNING [nwp500.mqtt.reconnection] Connection interrupted: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
The connection remains down until manual restart.
Summary
After an unexpected MQTT hangup (AWS_ERROR_MQTT_UNEXPECTED_HANGUP), the library does not automatically reconnect. The CONNECTION_INTERRUPTED event is fired, but CONNECTION_RESUMED never fires. The connection remains dead until the application is manually restarted.
Steps to Reproduce
Expected Behavior
Environment
Error Pattern
Connection interrupted (no reconnection follows):
The connection remains down until manual restart.