Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:xaviml/controllerx into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviml committed Jan 23, 2021
2 parents 94359d7 + baf28ad commit b67c4dc
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ verify_ssl = true
black = "==20.8b1"
pytest = "==6.2.1"
pytest-asyncio = "==0.14.0"
pytest-cov = "==2.10.1"
pytest-cov = "==2.11.1"
pytest-mock = "==3.5.1"
pytest-timeout = "==1.4.2"
mock = "==4.0.3"
pre-commit = "==2.9.3"
commitizen = "==2.13.0"
commitizen = "==2.14.0"
mypy = "==0.790"
flake8 = "==3.8.4"
isort = "==5.7.0"
Expand Down
23 changes: 23 additions & 0 deletions apps/controllerx/cx_devices/legrand.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
24 changes: 16 additions & 8 deletions docs/_data/controllers/LEGRAND-600083.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
45 changes: 29 additions & 16 deletions docs/_data/controllers/LEGRAND-600088.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b67c4dc

Please sign in to comment.