Skip to content

Commit

Permalink
feat(device): add Legrand devices mapping and doc
Browse files Browse the repository at this point in the history
related to #99 and #98
  • Loading branch information
xaviml committed Jul 17, 2020
1 parent 9cac06b commit 164f8c1
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 7 deletions.
13 changes: 6 additions & 7 deletions apps/controllerx/cx_devices/legrand.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_zha_action_LegrandWallController(data: dict) -> Optional[str]:
return action


class LegrandSimpleWallLightController(LightController):
class Legrand600083LightController(LightController):
def get_zha_actions_mapping(self) -> TypeActionsMapping:
return {
"1_on": Light.ON,
Expand All @@ -29,17 +29,16 @@ def get_zha_action(self, data: dict) -> Optional[str]:
return get_zha_action_LegrandWallController(data)


class LegrandDoubleWallLightController(LightController):
# TODO: define the mapping for this controller
class Legrand600088LightController(LightController):
def get_zha_actions_mapping(self) -> TypeActionsMapping:
return {
"1_on": Light.ON,
"1_off": Light.OFF,
"1_move_up": Light.HOLD_BRIGHTNESS_UP,
"1_move_down": Light.HOLD_BRIGHTNESS_DOWN,
"1_move_up": Light.HOLD_COLOR_UP,
"1_move_down": Light.HOLD_COLOR_DOWN,
"1_stop": Light.RELEASE,
"2_on": Light.ON,
"2_off": Light.OFF,
"2_on": Light.ON_FULL_BRIGHTNESS,
"2_off": Light.ON_MIN_BRIGHTNESS,
"2_move_up": Light.HOLD_BRIGHTNESS_UP,
"2_move_down": Light.HOLD_BRIGHTNESS_DOWN,
"2_stop": Light.RELEASE,
Expand Down
20 changes: 20 additions & 0 deletions docs/_data/controllers/LEGRAND-600083.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 600083 (LEGRAND)
device_support:
- type: Light
domain: light
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
integrations:
- 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_stop 🠖 release any button
29 changes: 29 additions & 0 deletions docs/_data/controllers/LEGRAND-600088.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 600088 (LEGRAND)
device_support:
- type: Light
domain: light
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
integrations:
- 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_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_stop 🠖 release any right button
5 changes: 5 additions & 0 deletions docs/controllers/LEGRAND-600083.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: controller
title: 600083 (LEGRAND)
device: LEGRAND-600083
---
5 changes: 5 additions & 0 deletions docs/controllers/LEGRAND-600088.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: controller
title: 600088 (LEGRAND)
device: LEGRAND-600088
---

0 comments on commit 164f8c1

Please sign in to comment.