Skip to content

Commit

Permalink
Merge pull request #152 from choif/dev
Browse files Browse the repository at this point in the history
Add ZHA support for Ikea E1766 remote
  • Loading branch information
xaviml committed Oct 15, 2020
2 parents 6015398 + ca10755 commit f1fcf72
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions apps/controllerx/cx_devices/ikea.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,31 @@ 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 f1fcf72

Please sign in to comment.