-
-
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 ZB-5121 controller
related to #227
- Loading branch information
Showing
6 changed files
with
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from cx_const import DefaultActionsMapping, Light | ||
from cx_core import LightController | ||
|
||
|
||
class ZB5121LightController(LightController): | ||
def get_zha_actions_mapping(self) -> DefaultActionsMapping: | ||
return { | ||
"on": Light.ON, | ||
"off": Light.OFF, | ||
"step_with_on_off_0_32_0": Light.CLICK_BRIGHTNESS_UP, # Click brightness up | ||
"move_with_on_off_0_50": Light.HOLD_BRIGHTNESS_UP, # Hold brightness up | ||
"step_with_on_off_1_32_0": Light.CLICK_BRIGHTNESS_DOWN, # Click brightness down | ||
"move_with_on_off_1_50": Light.HOLD_BRIGHTNESS_DOWN, # Hold brightness down | ||
# "recall_0_1": "", # Click clapperboard | ||
"stop": Light.RELEASE, # long release | ||
} |
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,26 @@ | ||
name: ZB-5121 (RGB Genie) | ||
device_support: | ||
- type: Light | ||
domain: light | ||
controller: ZB5121LightController | ||
delay: 350 | ||
mapping: | ||
- "Click light on → Turn on" | ||
- "Click light off → Turn off" | ||
- "Click 🔆 → Brighten up (1 step)" | ||
- "Hold 🔆 → Brighten up" | ||
- "Click 🔅 → Dim down (1 step)" | ||
- "Hold 🔅 → Dim down" | ||
integrations: | ||
- name: ZHA | ||
codename: zha | ||
actions: | ||
- '"on" → Click light on' | ||
- '"off" → Click light off' | ||
- "step_with_on_off_0_32_0 → Click 🔆" | ||
- "move_with_on_off_0_50 → Hold 🔆" | ||
- "step_with_on_off_1_32_0 → Click 🔅" | ||
- "move_with_on_off_1_50 → Hold 🔅" | ||
- "recall_0_1 → Click clapperboard" | ||
- "stop → Release 🔆 or 🔅" | ||
|
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: ZB-5121 (RGB Genie) | ||
device: ZB-5121 | ||
--- |