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 00000000..17cb1eb1 Binary files /dev/null and b/docs/docs/assets/controllers/ADEOHRC99CZC045.jpeg differ