-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(device): add MLI-404002 device with Z2M and ZHA support
related to #247
- Loading branch information
Showing
6 changed files
with
130 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: MLI-404002 (Müller Licht) | ||
device_support: | ||
- type: Light | ||
domain: light | ||
controller: MLI404002LightController | ||
delay: 500 | ||
mapping: | ||
- "Toggle button → Toggle" | ||
- "Click 🔆 → Brighten up (1 step)" | ||
- "Click 🔅 → Dim down (1 step)" | ||
- "Click cold → Color temp down / Left color wheel (1 step) (not for z2m)" | ||
- "Click warm → Color temp up / Right color wheel (1 step) (not for z2m)" | ||
- "Hold 🔆 → Brighten up" | ||
- "Hold 🔅→ Dim down" | ||
integrations: | ||
- name: Zigbee2MQTT | ||
codename: z2m | ||
actions: | ||
- '"on" → Toggle button' | ||
- '"off" → Toggle button' | ||
- brightness_step_down → Click 🔅 | ||
- brightness_move_down → Hold 🔅 | ||
- brightness_stop → Release 🔅/🔆 | ||
- brightness_step_up → Click 🔆 | ||
- brightness_move_up → Hold 🔆 | ||
- recall_1 → Click arrow back | ||
- name: ZHA | ||
codename: zha | ||
actions: | ||
- '"on" → Toggle button' | ||
- '"off" → Toggle button' | ||
- move_up → Hold 🔆 | ||
- move_down → Hold 🔅 | ||
- stop → Release 🔅/🔆 | ||
- step_up → Click 🔆 | ||
- step_down → Click 🔅 | ||
- recall → Click arrow back |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: controller | ||
title: MLI-404002 (Müller Licht) | ||
device: MLI-404002 | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import pytest | ||
from cx_core.integration import EventData | ||
from cx_devices.muller_licht import MLI404002LightController | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"data, expected_action", | ||
[ | ||
( | ||
{"command": "on", "args": []}, | ||
"on", | ||
), | ||
( | ||
{"command": "off", "args": []}, | ||
"off", | ||
), | ||
( | ||
{"command": "step", "args": [0, 43, 3]}, | ||
"step_up", | ||
), | ||
( | ||
{"command": "move", "args": [0, 100]}, | ||
"move_up", | ||
), | ||
( | ||
{"command": "step", "args": [1, 43, 3]}, | ||
"step_down", | ||
), | ||
( | ||
{"command": "move", "args": [1, 100]}, | ||
"move_down", | ||
), | ||
( | ||
{"command": "stop", "args": []}, | ||
"stop", | ||
), | ||
( | ||
{"command": "recall", "args": [16387, 1]}, | ||
"recall", | ||
), | ||
], | ||
) | ||
def test_zha_action_MLI404002(data: EventData, expected_action: str): | ||
sut = MLI404002LightController() # type: ignore | ||
action = sut.get_zha_action(data) | ||
assert action == expected_action |