Skip to content

Commit

Permalink
fix(device): fix mapping for WXKG07LM controllers
Browse files Browse the repository at this point in the history
related to #584
  • Loading branch information
xaviml committed Oct 3, 2022
1 parent c4fb8a0 commit 5557c74
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ _Note: Remember to restart the AppDaemon addon/server after updating to a new ve
## :hammer: Fixes

- :warning: Fixes mapping for `ICTCG1Controller` and `ICTCG1MediaPlayerController` for Zigbee2MQTT integration. It now defaults to the mapping exposed from the device when it is in `legacy: false` mode. [ #577 ]
- :warning: Fixes mapping for `WXKG07LM` controllers for Zigbee2MQTT integration. It now defaults to the mapping specified in [Zigbee2MQTT documentation](https://www.zigbee2mqtt.io/devices/WXKG07LM.html#action-enum). [ #584 ]

<!--
## :clock2: Performance
Expand Down
42 changes: 21 additions & 21 deletions apps/controllerx/cx_devices/aqara.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,15 +599,15 @@ def get_deconz_actions_mapping(self) -> DefaultActionsMapping:
class WXKG07LMLightController(LightController):
def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
return {
"both": Light.TOGGLE,
"both_double": Light.CLICK_BRIGHTNESS_UP,
"both_long": Light.CLICK_BRIGHTNESS_DOWN,
"left": Light.TOGGLE,
"left_double": Light.CLICK_BRIGHTNESS_UP,
"left_long": Light.CLICK_BRIGHTNESS_DOWN,
"right": Light.TOGGLE,
"right_double": Light.CLICK_BRIGHTNESS_UP,
"right_long": Light.CLICK_BRIGHTNESS_DOWN,
"single_both": Light.TOGGLE,
"double_both": Light.CLICK_BRIGHTNESS_UP,
"hold_both": Light.CLICK_BRIGHTNESS_DOWN,
"single_left": Light.TOGGLE,
"double_left": Light.CLICK_BRIGHTNESS_UP,
"hold_left": Light.CLICK_BRIGHTNESS_DOWN,
"single_right": Light.TOGGLE,
"double_right": Light.CLICK_BRIGHTNESS_UP,
"hold_right": Light.CLICK_BRIGHTNESS_DOWN,
}

def get_deconz_actions_mapping(self) -> DefaultActionsMapping:
Expand Down Expand Up @@ -644,24 +644,24 @@ def get_zha_action(self, data: EventData) -> str:
class WXKG07LMZ2MLightController(Z2MLightController):
def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
return {
"both": Z2MLight.TOGGLE,
"both_double": Z2MLight.CLICK_BRIGHTNESS_UP,
"both_long": Z2MLight.CLICK_BRIGHTNESS_DOWN,
"left": Z2MLight.TOGGLE,
"left_double": Z2MLight.CLICK_BRIGHTNESS_UP,
"left_long": Z2MLight.CLICK_BRIGHTNESS_DOWN,
"right": Z2MLight.TOGGLE,
"right_double": Z2MLight.CLICK_BRIGHTNESS_UP,
"right_long": Z2MLight.CLICK_BRIGHTNESS_DOWN,
"single_both": Z2MLight.TOGGLE,
"double_both": Z2MLight.CLICK_BRIGHTNESS_UP,
"hold_both": Z2MLight.CLICK_BRIGHTNESS_DOWN,
"single_left": Z2MLight.TOGGLE,
"double_left": Z2MLight.CLICK_BRIGHTNESS_UP,
"hold_left": Z2MLight.CLICK_BRIGHTNESS_DOWN,
"single_right": Z2MLight.TOGGLE,
"double_right": Z2MLight.CLICK_BRIGHTNESS_UP,
"hold_right": Z2MLight.CLICK_BRIGHTNESS_DOWN,
}


class WXKG07LMSwitchController(SwitchController):
def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
return {
"both": Switch.TOGGLE,
"left": Switch.TOGGLE,
"right": Switch.TOGGLE,
"single_both": Switch.TOGGLE,
"single_left": Switch.TOGGLE,
"single_right": Switch.TOGGLE,
}

def get_deconz_actions_mapping(self) -> DefaultActionsMapping:
Expand Down

0 comments on commit 5557c74

Please sign in to comment.