Skip to content

Commit

Permalink
feat(device): add ZB-5121 controller
Browse files Browse the repository at this point in the history
related to #227
  • Loading branch information
xaviml committed Jan 23, 2021
1 parent e81208a commit 937a2cd
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/controllerx/controllerx.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from cx_devices.muller_licht import *
from cx_devices.osram import *
from cx_devices.phillips import *
from cx_devices.rgb_genie import *
from cx_devices.smartthings import *
from cx_devices.sonoff import *
from cx_devices.terncy import *
Expand Down
16 changes: 16 additions & 0 deletions apps/controllerx/cx_devices/rgb_genie.py
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
}
4 changes: 2 additions & 2 deletions docs/_data/controllers/E1524_E1810.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ device_support:
controller: E1810Controller
delay: 350
mapping:
- "Click → Toggle"
- "Hold → Sync"
- "Click middle → Toggle"
- "Hold middle → Sync"
- "Click 🔆 → Brighten up (1 step)"
- "Click 🔅 → Dim down (1 step)"
- "Click < → Color temp down / Left color wheel (1 step)"
Expand Down
26 changes: 26 additions & 0 deletions docs/_data/controllers/ZB-5121.yml
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 🔅"

Binary file added docs/assets/img/ZB-5121.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/controllers/ZB-5121.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: controller
title: ZB-5121 (RGB Genie)
device: ZB-5121
---

0 comments on commit 937a2cd

Please sign in to comment.