Repository navigation
v0.5.1: Fix CM160 Historical Sync Bug
π§ Bug Fixes
Critical Fix: Resolved CM160 device getting stuck in historical sync mode after Home Assistant reboot.
Issues Resolved
- Device would continuously send handshake messages without transitioning to real-time mode
- Only 1 historical record was processed before getting stuck in handshake loop
- Infinite 5-second handshake pattern (
a949445457414954504352) preventing normal operation
Technical Improvements
- Implemented timeout-based historical data completion detection (5-second timeout)
- Enhanced protocol state machine with proper transitions
- Added timeout monitoring following reference implementation pattern
- Improved reliability of historical-to-realtime mode transition
π New Features
Device State Monitoring API
get_device_state(): Returns current communication stateget_device_state_info(): Detailed state information with historical count, connection status- Enhanced debugging and monitoring capabilities for Home Assistant integration
State Machine States
Unknown: Initial state, device not yet identifiedIdentifierReceived: Device found and identifiedTransmittingHistory: Historical data transmission in progressTransmittingRealtime: Real-time data transmission active
π Documentation
- Updated README with new API documentation
- Added device state monitoring examples
- Enhanced integration guidelines for Home Assistant developers
This release ensures reliable operation after Home Assistant reboots and provides better visibility into the device communication process.