Repository navigation
v0.2.4
Fix: Button/keypad events silently stop working after connect
Root cause
Two bugs combined to kill all LIP message processing shortly after startup:
-
_update_callbackin the event entity used a bare dict lookup (action_number_to_event[value]), which raisedKeyErrorfor any action number not in the map (3/4/5/6/32). Lutron sends action1(ENABLE) for every device component immediately after monitoring is enabled on connect — this is what triggered the crash. -
_process_messagein the protocol layer only caughtValueError, so theKeyErrorpropagated all the way up through_async_run_onceinto theasync_runloop, 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_callbackso unknown action numbers are silently ignored rather than raising. - Broaden the exception catch in
_process_messagefromValueErrortoExceptionso a misbehaving callback can never kill the read loop.