From ae6a5c2a01d83071a09976a07341262c13efed84 Mon Sep 17 00:00:00 2001 From: Glenn Waters Date: Wed, 2 Oct 2024 12:56:00 -0400 Subject: [PATCH] Ignore NO_KEY in keypad change messages. (#83) --- elkm1_lib/keypads.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/elkm1_lib/keypads.py b/elkm1_lib/keypads.py index f2e179b..449706f 100644 --- a/elkm1_lib/keypads.py +++ b/elkm1_lib/keypads.py @@ -62,6 +62,14 @@ def _ka_handler(self, keypad_areas: list[int]) -> None: keypad.setattr("area", keypad_areas[keypad.index], True) def _kc_handler(self, keypad: int, key: int) -> None: + """ + Handle a keypad change message. At present this function is only handling + keypresses and does not process function key light changes and beep changes. + """ + # Ignore NO_KEY as it is not a key press + if key == KeypadKeys.NO_KEY.value: + return + # Force a change notification self.elements[keypad].last_keypress = None try: