From ca107554d00202cc9af48c99035e1c9fbec0cb84 Mon Sep 17 00:00:00 2001 From: Duncan Jowsey Date: Wed, 14 Oct 2020 22:21:19 +0100 Subject: [PATCH] feat(device): add Ikea E1766 zha integration --- apps/controllerx/cx_devices/ikea.py | 16 ++++++++++++++++ docs/_data/controllers/E1766.yml | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/apps/controllerx/cx_devices/ikea.py b/apps/controllerx/cx_devices/ikea.py index c3cd81ca..6c747247 100644 --- a/apps/controllerx/cx_devices/ikea.py +++ b/apps/controllerx/cx_devices/ikea.py @@ -433,11 +433,20 @@ def get_deconz_actions_mapping(self) -> TypeActionsMapping: 2003: Light.ON_MIN_BRIGHTNESS, } + def get_zha_actions_mapping(self) -> TypeActionsMapping: + return { + "up_open": Light.ON, + "down_close": Light.OFF, + } + class E1766SwitchController(SwitchController): def get_deconz_actions_mapping(self) -> TypeActionsMapping: return {1002: Switch.ON, 2002: Switch.OFF} + def get_zha_actions_mapping(self) -> TypeActionsMapping: + return {"up_open": Switch.ON, "down_close": Switch.OFF} + class E1766CoverController(CoverController): def get_deconz_actions_mapping(self) -> TypeActionsMapping: @@ -445,3 +454,10 @@ def get_deconz_actions_mapping(self) -> TypeActionsMapping: 1002: Cover.TOGGLE_OPEN, 2002: Cover.TOGGLE_CLOSE, } + + def get_zha_actions_mapping(self) -> TypeActionsMapping: + return { + "up_open": Cover.TOGGLE_OPEN, + "down_close": Cover.TOGGLE_CLOSE, + "stop": Cover.STOP, + } diff --git a/docs/_data/controllers/E1766.yml b/docs/_data/controllers/E1766.yml index a4d6a628..f85e3045 100644 --- a/docs/_data/controllers/E1766.yml +++ b/docs/_data/controllers/E1766.yml @@ -31,3 +31,9 @@ integrations: - "2002 → Click down" - "1003 → Hold up" - "2003 → Hold down" + - name: ZHA + codename: zha + actions: + - "up_open → Click up" + - "down_close → Click down" + - "stop → Release up or down"