Skip to content

Commit

Permalink
feat(device): add E2213 device with Z2M support
Browse files Browse the repository at this point in the history
related to #885
  • Loading branch information
xaviml committed Mar 30, 2024
1 parent 8f36c91 commit dbb0c95
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ _This minor change does not contain any breaking changes._

- [E1EG7F](https://BASE_URL/controllerx/controllers/E1EG7F) - add ZHA support. [ #879 ] @sreknob
- [Philips929003017102](https://BASE_URL/controllerx/controllers/Philips929003017102) - add ZHA support. [ #877 ] @aommm
- [E2213](https://BASE_URL/controllerx/controllers/E2213) - add device with Z2M support. [ #885 ]

<!--
## :hammer: Fixes
Expand Down
32 changes: 32 additions & 0 deletions apps/controllerx/cx_devices/ikea.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,3 +734,35 @@ async def initialize(self) -> None:
level="WARNING",
ascii_encode=False,
)


class E2213LightController(LightController):
def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
return {
"1_initial_press": Light.ON,
"2_initial_press": Light.OFF,
"1_long_press": Light.HOLD_BRIGHTNESS_UP,
"2_long_press": Light.HOLD_BRIGHTNESS_DOWN,
"1_short_release": Light.RELEASE,
"2_short_release": Light.RELEASE,
"1_long_release": Light.RELEASE,
"2_long_release": Light.RELEASE,
"1_double_press": Light.HOLD_COLOR_UP,
"2_double_press": Light.HOLD_COLOR_DOWN,
}


class E2213Z2MLightController(Z2MLightController):
def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
return {
"1_initial_press": Z2MLight.ON,
"2_initial_press": Z2MLight.OFF,
"1_long_press": Z2MLight.HOLD_BRIGHTNESS_UP,
"2_long_press": Z2MLight.HOLD_BRIGHTNESS_DOWN,
"1_short_release": Z2MLight.RELEASE,
"2_short_release": Z2MLight.RELEASE,
"1_long_release": Z2MLight.RELEASE,
"2_long_release": Z2MLight.RELEASE,
"1_double_press": Z2MLight.HOLD_COLOR_TEMP_UP,
"2_double_press": Z2MLight.HOLD_COLOR_TEMP_DOWN,
}
Binary file added docs/docs/assets/controllers/E2213.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dbb0c95

Please sign in to comment.