From 0e388e3c41e08e1a54bb37db62231db22fa74934 Mon Sep 17 00:00:00 2001 From: Xavier Moreno Date: Sat, 31 Dec 2022 12:57:03 +0100 Subject: [PATCH] feat(device): add ADEOHRC99CZC045 device with Z2M support related to #648 --- RELEASE_NOTES.md | 1 + apps/controllerx/controllerx.py | 1 + apps/controllerx/cx_devices/adeo.py | 46 ++++++++++++++++++ .../assets/controllers/ADEOHRC99CZC045.jpeg | Bin 0 -> 8723 bytes 4 files changed, 48 insertions(+) create mode 100644 apps/controllerx/cx_devices/adeo.py create mode 100644 docs/docs/assets/controllers/ADEOHRC99CZC045.jpeg diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index ea141c4c..74b43d1d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -29,3 +29,4 @@ _This minor change does not contain any breaking changes._ ## :video_game: New devices - [Philips929002398602](https://BASE_URL/controllerx/controllers/Philips929002398602) - add ZHA support. [ #580 ] @cznewt @ScratMan +- [ADEOHRC99CZC045](https://BASE_URL/controllerx/controllers/ADEOHRC99CZC045) - add device with Z2M support. [ #648 ] diff --git a/apps/controllerx/controllerx.py b/apps/controllerx/controllerx.py index 4ef9c127..2f0a7c3b 100644 --- a/apps/controllerx/controllerx.py +++ b/apps/controllerx/controllerx.py @@ -11,6 +11,7 @@ SwitchController, Z2MLightController, ) +from cx_devices.adeo import * from cx_devices.aqara import * from cx_devices.aurora import * from cx_devices.homematic import * diff --git a/apps/controllerx/cx_devices/adeo.py b/apps/controllerx/cx_devices/adeo.py new file mode 100644 index 00000000..318d1007 --- /dev/null +++ b/apps/controllerx/cx_devices/adeo.py @@ -0,0 +1,46 @@ +from cx_const import DefaultActionsMapping, Light, Z2MLight +from cx_core import LightController, Z2MLightController + + +class ADEOHRC99CZC045LightController(LightController): + def get_z2m_actions_mapping(self) -> DefaultActionsMapping: + return { + "on": Light.ON, + "off": Light.OFF, + "brightness_step_up": Light.HOLD_BRIGHTNESS_UP, + "brightness_step_down": Light.HOLD_BRIGHTNESS_DOWN, + "brightness_stop": Light.RELEASE, + "color_hue_step_up": Light.HOLD_COLOR_UP, + "color_hue_step_down": Light.HOLD_COLOR_DOWN, + "color_saturation_step_up": Light.HOLD_COLOR_UP, + "color_saturation_step_down": Light.HOLD_COLOR_DOWN, + "color_temperature_step_up": Light.HOLD_COLOR_TEMP_UP, + "color_temperature_step_down": Light.HOLD_COLOR_TEMP_DOWN, + "color_stop": Light.RELEASE, + # "scene_1": "", + # "scene_2": "", + # "scene_3": "", + # "scene_4": "", + } + + +class ADEOHRC99CZC045Z2MLightController(Z2MLightController): + def get_z2m_actions_mapping(self) -> DefaultActionsMapping: + return { + "on": Z2MLight.ON, + "off": Z2MLight.OFF, + "brightness_step_up": Z2MLight.HOLD_BRIGHTNESS_UP, + "brightness_step_down": Z2MLight.HOLD_BRIGHTNESS_DOWN, + "brightness_stop": Z2MLight.RELEASE, + "color_hue_step_up": Z2MLight.HOLD_COLOR_TEMP_UP, + "color_hue_step_down": Z2MLight.HOLD_COLOR_TEMP_DOWN, + "color_saturation_step_up": Z2MLight.HOLD_COLOR_TEMP_UP, + "color_saturation_step_down": Z2MLight.HOLD_COLOR_TEMP_DOWN, + "color_temperature_step_up": Z2MLight.HOLD_COLOR_TEMP_UP, + "color_temperature_step_down": Z2MLight.HOLD_COLOR_TEMP_DOWN, + "color_stop": Z2MLight.RELEASE, + # "scene_1": "", + # "scene_2": "", + # "scene_3": "", + # "scene_4": "", + } diff --git a/docs/docs/assets/controllers/ADEOHRC99CZC045.jpeg b/docs/docs/assets/controllers/ADEOHRC99CZC045.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..17cb1eb1fcc57fea7cb52d8a94c84e0e31fc199a GIT binary patch literal 8723 zcmbVw2|SeD+y9w;3}YQ+DPzkJvW$J1LH1;fr7S(!4I)cYN(P~{SSpp2$-efaB2-Tb zknHDPdohguJ) zYC)I)wG5~pfvPGrm^=Pot+lNKji{xrsiCf^1yO5gX&7p18EWVfHOYor+J@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