From 8d086cac6bbd629e5f03dafdfb7b0934f7a5bdf9 Mon Sep 17 00:00:00 2001 From: Niklas Logren Date: Mon, 4 Dec 2023 13:42:58 +0100 Subject: [PATCH] feat(device): add RDM001 (Philips) ZHA support --- apps/controllerx/cx_devices/philips.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/apps/controllerx/cx_devices/philips.py b/apps/controllerx/cx_devices/philips.py index b7bb3e86..9cac9575 100644 --- a/apps/controllerx/cx_devices/philips.py +++ b/apps/controllerx/cx_devices/philips.py @@ -247,6 +247,22 @@ def get_deconz_actions_mapping(self) -> DefaultActionsMapping: 2003: Light.RELEASE, } + def get_zha_actions_mapping(self) -> DefaultActionsMapping: + return { + # "left_press": Light.TOGGLE, + "left_press_release": Light.TOGGLE, + "left_hold": Light.HOLD_BRIGHTNESS_TOGGLE, + "left_hold_release": Light.RELEASE, + # "right_press": Light.TOGGLE, + "right_press_release": Light.TOGGLE, + "right_hold": Light.HOLD_BRIGHTNESS_TOGGLE, + "right_hold_release": Light.RELEASE, + } + + def get_zha_action(self, data: EventData) -> str: + command: str = data["command"] + return command + class Philips929003017102Z2MLightController(Z2MLightController): def get_z2m_actions_mapping(self) -> DefaultActionsMapping: