Skip to content

v0.2.4

Choose a tag to compare

@ronluna ronluna released this 16 May 22:26
· 9 commits to master since this release

Fix: Button/keypad events silently stop working after connect

Root cause

Two bugs combined to kill all LIP message processing shortly after startup:

  1. _update_callback in the event entity used a bare dict lookup (action_number_to_event[value]), which raised KeyError for any action number not in the map (3/4/5/6/32). Lutron sends action 1 (ENABLE) for every device component immediately after monitoring is enabled on connect — this is what triggered the crash.

  2. _process_message in the protocol layer only caught ValueError, so the KeyError propagated all the way up through _async_run_once into the async_run loop, terminating the task entirely. After that, no LIP messages were processed at all — button presses, LED state updates, occupancy, nothing.

Fix

  • Use .get() instead of [] in _update_callback so unknown action numbers are silently ignored rather than raising.
  • Broaden the exception catch in _process_message from ValueError to Exception so a misbehaving callback can never kill the read loop.