diff --git a/apps/controllerx/cx_devices/legrand.py b/apps/controllerx/cx_devices/legrand.py index 3e7f2e8c..f4fc66a5 100644 --- a/apps/controllerx/cx_devices/legrand.py +++ b/apps/controllerx/cx_devices/legrand.py @@ -15,6 +15,15 @@ def get_zha_action_LegrandWallController(data: dict) -> str: class Legrand600083LightController(LightController): + def get_z2m_actions_mapping(self) -> DefaultActionsMapping: + return { + "on": Light.ON, + "off": Light.OFF, + "brightness_move_up": Light.HOLD_BRIGHTNESS_UP, + "brightness_move_down": Light.HOLD_BRIGHTNESS_DOWN, + "brightness_stop": Light.RELEASE, + } + def get_zha_actions_mapping(self) -> DefaultActionsMapping: return { "1_on": Light.ON, @@ -29,6 +38,20 @@ def get_zha_action(self, data: EventData) -> str: class Legrand600088LightController(LightController): + def get_z2m_actions_mapping(self) -> DefaultActionsMapping: + return { + "on_left": Light.ON, + "off_left": Light.OFF, + "brightness_move_up_left": Light.HOLD_COLOR_UP, + "brightness_move_down_left": Light.HOLD_COLOR_DOWN, + "brightness_stop_left": Light.RELEASE, + "on_right": Light.ON_FULL_BRIGHTNESS, + "off_right": Light.ON_MIN_BRIGHTNESS, + "brightness_move_up_right": Light.HOLD_BRIGHTNESS_UP, + "brightness_move_down_right": Light.HOLD_BRIGHTNESS_DOWN, + "brightness_stop_right": Light.RELEASE, + } + def get_zha_actions_mapping(self) -> DefaultActionsMapping: return { "1_on": Light.ON, diff --git a/docs/_data/controllers/LEGRAND-600083.yml b/docs/_data/controllers/LEGRAND-600083.yml index 5ccce7af..190ab0ff 100644 --- a/docs/_data/controllers/LEGRAND-600083.yml +++ b/docs/_data/controllers/LEGRAND-600083.yml @@ -5,16 +5,24 @@ device_support: controller: Legrand600083LightController delay: 350 mapping: - - press top button → Turn on - - press bottom button → Turn off - - hold top button → Brighten up - - hold bottom button → Dim down + - press bottom button → Turn on + - press top button → Turn off + - hold bottom button → Brighten up + - hold top button → Dim down integrations: + - name: Zigbee2MQTT + codename: z2m + actions: + - "on" → press bottom button + - "off" → press top button + - brightness_move_up → hold bottom button + - brightness_move_down → hold top button + - brightness_stop → release any button - name: ZHA codename: zha actions: - - 1_on → press top button - - 1_off → press bottom button - - 1_move_up → hold top button - - 1_move_down → hold bottom button + - 1_on → press bottom button + - 1_off → press top button + - 1_move_up → hold bottom button + - 1_move_down → hold top button - 1_stop → release any button \ No newline at end of file diff --git a/docs/_data/controllers/LEGRAND-600088.yml b/docs/_data/controllers/LEGRAND-600088.yml index 869ea0e6..16a41eb9 100644 --- a/docs/_data/controllers/LEGRAND-600088.yml +++ b/docs/_data/controllers/LEGRAND-600088.yml @@ -5,25 +5,38 @@ device_support: controller: Legrand600088LightController delay: 350 mapping: - - press left top button → Turn on - - press left bottom button → Turn off - - hold left top button → Change color or color temperature up - - hold left bottom button → Change color or color temperature down - - press right top button → Full brightness - - press right bottom button → Minimum brightness - - hold right top button → Brighten up - - hold right bottom button → Dim down + - press bottom left button → Turn on + - press top left button → Turn off + - hold bottom left button → Change color or color temperature up + - hold top left button → Change color or color temperature down + - press bottom right button → Full brightness + - press top right button → Minimum brightness + - hold bottom right button → Brighten up + - hold top right button → Dim down integrations: + - name: Zigbee2MQTT + codename: z2m + actions: + - on_left → press bottom left button + - off_left → press top left button + - brightness_move_up_left → hold bottom left button + - brightness_move_down_left → hold top left button + - brightness_stop_left → release any left button + - on_right → press bottom right button + - off_right → press top right button + - brightness_move_up_right → hold bottom right button + - brightness_move_down_right → hold top right button + - brightness_stop_right → release any right button - name: ZHA codename: zha actions: - - 1_on → press left top button - - 1_off → press left bottom button - - 1_move_up → hold left top button - - 1_move_down → hold left bottom button + - 1_on → press bottom left button + - 1_off → press top left button + - 1_move_up → hold bottom left button + - 1_move_down → hold top left button - 1_stop → release any left button - - 2_on → press right top button - - 2_off → press right bottom button - - 2_move_up → hold right top button - - 2_move_down → hold right bottom button + - 2_on → press bottom right button + - 2_off → press top right button + - 2_move_up → hold bottom right button + - 2_move_down → hold top right button - 2_stop → release any right button \ No newline at end of file