Skip to content

Commit

Permalink
Add zha integration for ikea E1766 remote
Browse files Browse the repository at this point in the history
  • Loading branch information
choif authored and Duncan Jowsey committed Oct 14, 2020
1 parent 6015398 commit aa0e646
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions apps/controllerx/cx_devices/ikea.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,29 @@ 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:
return {
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,
}
6 changes: 6 additions & 0 deletions docs/_data/controllers/E1766.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit aa0e646

Please sign in to comment.