Skip to content

Commit

Permalink
fix(device): fix z2m mapping of W2049LightController
Browse files Browse the repository at this point in the history
related to #292
  • Loading branch information
xaviml committed Apr 28, 2021
1 parent 65f449d commit 209bc95
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
11 changes: 5 additions & 6 deletions apps/controllerx/cx_devices/ikea.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,13 @@ def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
class W2049LightController(LightController):
def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
return {
"brightness_up_click": Light.TOGGLE,
"brightness_down_click": Light.CLICK_BRIGHTNESS_DOWN,
"on": Light.ON,
"off": Light.OFF,
"arrow_left_click": Light.CLICK_COLOR_DOWN,
"arrow_right_click": Light.CLICK_COLOR_UP,
"brightness_up_hold": Light.HOLD_BRIGHTNESS_UP,
"brightness_up_release": Light.RELEASE,
"brightness_down_hold": Light.HOLD_BRIGHTNESS_DOWN,
"brightness_down_release": Light.RELEASE,
"brightness_move_up": Light.HOLD_BRIGHTNESS_UP,
"brightness_stop": Light.RELEASE,
"brightness_move_down": Light.HOLD_BRIGHTNESS_DOWN,
"arrow_left_hold": Light.HOLD_COLOR_DOWN,
"arrow_left_release": Light.RELEASE,
"arrow_right_hold": Light.HOLD_COLOR_UP,
Expand Down
20 changes: 11 additions & 9 deletions docs/_data/controllers/W2049.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: W2049 (IKEA)
device_support:
device_support:
- type: Light
domain: light
controller: W2049LightController
delay: 350
mapping:
- "Click 🔆 → Toggle"
- "Click 🔅 → Dim down (1 step)"
- "Click 🔆 → Turn on"
- "Click 🔅 → Turn off"
- "Click < → Color temp down / Left color wheel (1 step)"
- "Click > → Color temp up / Right color wheel (1 step)"
- "Hold 🔆 → Brighten up"
Expand All @@ -17,15 +17,17 @@ integrations:
- name: Zigbee2MQTT
codename: z2m
actions:
- "brightness_up_click → Click 🔆"
- "brightness_down_click → Click 🔅"
- '"on" → Click 🔆'
- '"off" → Click 🔅'
- "arrow_left_click → Click <"
- "arrow_right_click → Click >"
- "brightness_up_hold → Hold 🔆"
- "brightness_up_release → Release 🔆"
- "brightness_down_hold → Hold 🔅"
- "brightness_down_release → Release 🔅"
- "brightness_move_up → Hold 🔆"
- "brightness_move_down → Hold 🔅"
- "brightness_stop → Release 🔆/🔅"
- "arrow_left_hold → Hold <"
- "arrow_left_release → Release <"
- "arrow_right_hold → Hold >"
- "arrow_right_release → Release >"
note: >-
This controller fires "on" action when arrows are held as well as the hold arrow action.
So this means that when long pressing the arrows, the light(s) will turn on before changing the color.

0 comments on commit 209bc95

Please sign in to comment.