Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(device): add ADEOHRC99CZC045 device with Z2M support #658

Merged
merged 1 commit into from
Dec 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
1 change: 1 addition & 0 deletions apps/controllerx/controllerx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down
46 changes: 46 additions & 0 deletions apps/controllerx/cx_devices/adeo.py
Original file line number Diff line number Diff line change
@@ -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": "",
}
Binary file added docs/docs/assets/controllers/ADEOHRC99CZC045.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.