Skip to content

Commit

Permalink
Merge pull request #92 from kroimon/patch-1
Browse files Browse the repository at this point in the history
Add ZHA support for HueDimmerController
  • Loading branch information
xaviml authored Jun 23, 2020
2 parents 3b64779 + 0c692a4 commit 34899ed
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps/controllerx/devices/philips.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ def get_deconz_actions_mapping(self) -> TypeActionsMapping:
4003: Light.RELEASE,
}

def get_zha_actions_mapping(self) -> TypeActionsMapping:
return {
"on": Light.ON,
"step_0_30_9": Light.CLICK_BRIGHTNESS_UP,
"step_0_56_9": Light.HOLD_BRIGHTNESS_UP,
"step_1_30_9": Light.CLICK_BRIGHTNESS_DOWN,
"step_1_56_9": Light.HOLD_BRIGHTNESS_DOWN,
"off_with_effect_0_0": Light.OFF,
"stop": Light.RELEASE,
}


class Niko91004LightController(LightController):
def get_deconz_actions_mapping(self) -> TypeActionsMapping:
Expand Down
13 changes: 13 additions & 0 deletions docs/_data/controllers/hue-dimmer-switch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,16 @@ integrations:
- "4001 🠖 Hold \"O\""
- "4002 🠖 Click release \"O\""
- "4003 🠖 Hold release \"O\""
- name: ZHA
codename: zha
actions:
- "on 🠖 Click \"I\""
- "step_0_30_9 🠖 Click 🔆"
- "step_0_56_9 🠖 Hold 🔆"
- "step_1_30_9 🠖 Click 🔅"
- "step_1_56_9 🠖 Hold 🔅"
- "off_with_effect_0_0 🠖 Click \"O\""
- "stop 🠖 Release brightness buttons"
note: >-
For ZHA integration, the hold events just work for the brightness buttons,
and they are fired right after the click events.

0 comments on commit 34899ed

Please sign in to comment.