-
-
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 Z2M support for ZS230002 (Linkind)
- Loading branch information
Showing
11 changed files
with
91 additions
and
2 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
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,20 @@ | ||
from cx_const import DefaultActionsMapping, Light | ||
from cx_core import LightController | ||
|
||
|
||
class ZS23000278LightController(LightController): | ||
def get_z2m_actions_mapping(self) -> DefaultActionsMapping: | ||
return { | ||
"on": Light.ON, | ||
"off": Light.OFF, | ||
"brightness_step_up": Light.CLICK_BRIGHTNESS_UP, | ||
"brightness_step_down": Light.CLICK_BRIGHTNESS_DOWN, | ||
"brightness_move_to_level": Light.BRIGHTNESS_FROM_CONTROLLER, | ||
"brightness_move_up": Light.HOLD_BRIGHTNESS_UP, | ||
"brightness_move_down": Light.HOLD_BRIGHTNESS_DOWN, | ||
"brightness_stop": Light.RELEASE, | ||
"color_temperature_move": Light.COLORTEMP_FROM_CONTROLLER, | ||
"color_temperature_move_up": Light.CLICK_COLOR_TEMP_UP, | ||
"color_temperature_move_down": Light.CLICK_COLOR_TEMP_DOWN, | ||
"color_move": Light.XYCOLOR_FROM_CONTROLLER, | ||
} |
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,31 @@ | ||
name: ZS230002 (Linkind) | ||
device_support: | ||
- type: Light | ||
domain: light | ||
controller: ZS23000278LightController | ||
delay: 350 | ||
mapping: | ||
- "Click on/off → Toggle" | ||
- "Click arrow up in dim mode → Brighten up (1 step)" | ||
- "Click arrow down in dim mode → Dim down (1 step)" | ||
- "Hold arrow up in dim mode → Brighten up" | ||
- "Hold arrow down in dim mode → Dim down" | ||
- "Click arrow up in color temp mode → Color temp up (1 step)" | ||
- "Click arrow down in color temp mode → Color temp down (1 step)" | ||
|
||
integrations: | ||
- name: Zigbee2MQTT | ||
codename: z2m | ||
actions: | ||
- '"on" → Click on/off' | ||
- '"off" → Click on/off' | ||
- "brightness_step_up → Click arrow up in dim mode" | ||
- "brightness_step_down → Click arrow down in dim mode" | ||
- "brightness_move_to_level → " | ||
- "brightness_move_up → Hold arrow up in dim mode" | ||
- "brightness_move_down → Hold arrow down in dim mode" | ||
- "brightness_stop → Release arrow up/down" | ||
- "color_temperature_move → " | ||
- "color_temperature_move_up → Click arrow up in color temp mode" | ||
- "color_temperature_move_down → Click arrow down in color temp mode" | ||
- "color_move → " |
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: ZS230002 (Linkind) | ||
device: ZS230002 | ||
--- |
9 changes: 9 additions & 0 deletions
9
tests/integ_tests/linkind_ZS23000278_z2m/brightness_from_controller_test.yaml
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,9 @@ | ||
entity_state: "on" | ||
fired_actions: ["brightness_move_to_level"] | ||
extra: | ||
action_level: 42 | ||
expected_calls: | ||
- service: light/turn_on | ||
data: | ||
entity_id: light.my_light | ||
brightness: 42 |
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,9 @@ | ||
example_app: | ||
module: controllerx | ||
class: ZS23000278LightController | ||
integration: | ||
name: z2m | ||
listen_to: mqtt | ||
controller: my_controller | ||
light: light.my_light | ||
|
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 |
---|---|---|
|
@@ -7,4 +7,3 @@ expected_calls: | |
data: | ||
entity_id: light.my_light | ||
xy_color: !!python/tuple [0.12, 0.08] | ||
expected_calls_count: 1 |
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 |
---|---|---|
|
@@ -8,4 +8,3 @@ expected_calls: | |
data: | ||
entity_id: light.my_light | ||
xy_color: !!python/tuple [0.12, 0.08] | ||
expected_calls_count: 1 |