From bcc96044e1ec128e556a9fc9219bc5b8a0ffdcec Mon Sep 17 00:00:00 2001 From: Xavier Moreno Date: Sun, 5 Jun 2022 21:29:51 +0200 Subject: [PATCH] feat(device): add Z2M support to HueSmartButton controller related to #498 --- RELEASE_NOTES.md | 4 +--- apps/controllerx/cx_devices/philips.py | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index af04b3f7..65079483 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -26,8 +26,6 @@ PRERELEASE_NOTE ## :wrench: Refactor --> - +- [XYZ](https://BASE_URL/controllerx/controllers/HueSmartButton) - add Z2M support. [ #498 ] diff --git a/apps/controllerx/cx_devices/philips.py b/apps/controllerx/cx_devices/philips.py index 7b8c1097..e0a299d6 100644 --- a/apps/controllerx/cx_devices/philips.py +++ b/apps/controllerx/cx_devices/philips.py @@ -123,6 +123,14 @@ def get_deconz_actions_mapping(self) -> DefaultActionsMapping: class HueSmartButtonLightController(LightController): + def get_z2m_actions_mapping(self) -> DefaultActionsMapping: + return { + "on": Light.TOGGLE, + "off": Light.TOGGLE, + "hold": Light.HOLD_BRIGHTNESS_TOGGLE, + "release": Light.RELEASE, + } + def get_deconz_actions_mapping(self) -> DefaultActionsMapping: return { # 1000: "", # Initial press