Skip to content

v0.5.1: Fix CM160 Historical Sync Bug

Choose a tag to compare

@PBrunot PBrunot released this 21 Sep 08:12
· 16 commits to master since this release

πŸ”§ 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 state
  • get_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 identified
  • IdentifierReceived: Device found and identified
  • TransmittingHistory: Historical data transmission in progress
  • TransmittingRealtime: 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.