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

Support ZHA for Sengled E1EG7FLightController #879

Merged
merged 3 commits into from
Mar 30, 2024
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
4 changes: 1 addition & 3 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ _This minor change does not contain any breaking changes._
## :pencil2: Features
-->

<!--
## :video_game: New devices

- [XYZ](https://BASE_URL/controllerx/controllers/XYZ) - add device with Z2M support. [ #123 ]
-->
- [E1EG7F](https://BASE_URL/controllerx/controllers/E1EG7F) - add ZHA support. [ #879 ] @sreknob

<!--
## :hammer: Fixes
Expand Down
14 changes: 14 additions & 0 deletions apps/controllerx/cx_devices/sengled.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
"off_double": Light.ON_MIN_COLOR_TEMP,
}

def get_zha_actions_mapping(self) -> DefaultActionsMapping:
return {
"on": Light.ON,
"on_long": Light.CLICK_COLOR_UP,
"on_double": Light.ON_FULL_COLOR_TEMP,
"step_0_1_0": Light.CLICK_BRIGHTNESS_UP,
"step_0_2_0": Light.ON_FULL_BRIGHTNESS,
"step_1_1_0": Light.CLICK_BRIGHTNESS_DOWN,
"step_1_2_0": Light.ON_MIN_BRIGHTNESS,
"off": Light.OFF,
"off_long": Light.CLICK_COLOR_DOWN,
"off_double": Light.ON_MIN_COLOR_TEMP,
}


class E1EG7FZ2MLightController(Z2MLightController):
def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
Expand Down