Skip to content

Commit

Permalink
feat(devices): support for Niko 91004 for deconz
Browse files Browse the repository at this point in the history
related to #89
  • Loading branch information
xaviml committed Jun 13, 2020
1 parent ade1bd5 commit 96ea71f
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
30 changes: 30 additions & 0 deletions apps/controllerx/devices/philips.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,33 @@ def get_deconz_actions_mapping(self) -> TypeActionsMapping:
4001: Light.HOLD_COLOR_DOWN,
4003: Light.RELEASE,
}


class Niko91004LightController(LightController):
def get_deconz_actions_mapping(self) -> TypeActionsMapping:
return {
1000: Light.ON, # button_1_press
1001: Light.SYNC, # button_1_hold
# 1002: "", # button_1_release
# 1003: "", # button_1_release_after_hold
2000: Light.OFF, # button_2_press
2001: Light.SYNC, # button_2_hold
# 2002: "", # button_2_release
# 2003: "", # button_2_release_after_hold
3000: Light.ON_FULL_BRIGHTNESS, # button_3_press
3001: Light.HOLD_BRIGHTNESS_UP, # button_3_hold
# 3002: "", # button_3_release
3003: Light.RELEASE, # button_3_release_after_hold
4000: Light.ON_MIN_BRIGHTNESS, # button_4_press
4001: Light.HOLD_BRIGHTNESS_DOWN, # button_4_hold
# 4002: "", # button_4_release
4003: Light.RELEASE, # button_4_release_after_hold
5000: Light.ON_FULL_COLOR_TEMP, # button_1_3_press
5001: Light.HOLD_COLOR_UP, # button_1_3_hold
# 5002: "", # button_1_3_release
5003: Light.RELEASE, # button_1_3_release_after_hold
6000: Light.ON_MIN_COLOR_TEMP, # button_2_4_press
6001: Light.HOLD_COLOR_DOWN, # button_2_4_hold
# 6002: "", # button_2_4_release
6003: Light.RELEASE, # button_2_4_release_after_hold
}
49 changes: 49 additions & 0 deletions docs/_data/controllers/Niko91004.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Niko dimmer switch for Hue system (Niko)
device_support:
- type: Light
domain: light
controller: Niko91004LightController
delay: 350
mapping:
- "Click button 1 🠖 Turn on"
- "Hold button 1 🠖 Sync"
- "Click button 2 🠖 Turn off"
- "Hold button 2 🠖 Sync"
- "Click button 3 🠖 Full brightness"
- "Hold button 3 🠖 Brighten up"
- "Click button 4 🠖 Minimum brightness"
- "Hold button 4 🠖 Dim down"
- "Click button 1_3 🠖 Full color temp (if supported)"
- "Hold button 1_3 🠖 Color temp up / Right color wheel"
- "Click button 2_4 🠖 Minimum color temp (if supported)"
- "Hold button 2_4 🠖 Color temp down / Left color wheel"
integrations:
- name: deCONZ
codename: deconz
actions:
- "1000 🠖 button_1_press"
- "1001 🠖 button_1_hold"
- "1002 🠖 button_1_release"
- "1003 🠖 button_1_release_after_hold"
- "2000 🠖 button_2_press"
- "2001 🠖 button_2_hold"
- "2002 🠖 button_2_release"
- "2003 🠖 button_2_release_after_hold"
- "3000 🠖 button_3_press"
- "3001 🠖 button_3_hold"
- "3002 🠖 button_3_release"
- "3003 🠖 button_3_release_after_hold"
- "4000 🠖 button_4_press"
- "4001 🠖 button_4_hold"
- "4002 🠖 button_4_release"
- "4003 🠖 button_4_release_after_hold"
- "5000 🠖 button_1_3_press"
- "5001 🠖 button_1_3_hold"
- "5002 🠖 button_1_3_release"
- "5003 🠖 button_1_3_release_after_hold"
- "6000 🠖 button_2_4_press"
- "6001 🠖 button_2_4_hold"
- "6002 🠖 button_2_4_release"
- "6003 🠖 button_2_4_release_after_hold"
note: >-
Check the button mapping in <a href="https://phoscon.de/en/support#pairing-friends-of-hue-switch">here</a>.
Binary file added docs/assets/img/Niko91004.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/controllers/Niko91004.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: controller
title: Niko dimmer switch for Hue system (Niko)
device: Niko91004
---

0 comments on commit 96ea71f

Please sign in to comment.