-
-
Notifications
You must be signed in to change notification settings - Fork 67
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 new OSRAM device integration for ZHA
related to #153
- Loading branch information
Showing
6 changed files
with
74 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,35 @@ | ||
from typing import Optional | ||
from cx_const import Light, TypeActionsMapping | ||
from cx_core import LightController | ||
|
||
|
||
class OsramAC025XX00NJLightController(LightController): | ||
# This mapping works for: AC0251100NJ / AC0251400NJ / AC0251600NJ / AC0251700NJ | ||
# (different models are just different colours) | ||
def get_zha_actions_mapping(self) -> TypeActionsMapping: | ||
return { | ||
"1_on": Light.ON, | ||
"1_move_with_on_off": Light.HOLD_BRIGHTNESS_UP, | ||
"1_stop": Light.RELEASE, | ||
# "3_move_to_level_with_on_off" : "", # Nothing | ||
"3_move_to_color_temp": Light.SYNC, | ||
"3_move_to_saturation": Light.HOLD_COLOR_UP, | ||
"3_move_hue": Light.RELEASE, | ||
"2_off": Light.OFF, | ||
"2_move": Light.HOLD_BRIGHTNESS_DOWN, | ||
"2_stop": Light.RELEASE, | ||
} | ||
|
||
def get_zha_action(self, data: dict) -> Optional[str]: | ||
return f"{data['endpoint_id']}_{data['command']}" | ||
|
||
|
||
# on: Sent when arrow up is pressed | ||
# move_with_on_off: Sent when arrow up is held | ||
# stop: Sent when arrow up or down is released after hold | ||
# move_to_level_with_on_off: Sent when circle button is pressed | ||
# move_to_color_temp: Sent when circle button is released after press | ||
# move_to_saturation: Sent when circle button is held | ||
# move_hue: Sent when circle button is released after hold | ||
# off: Sent when arrow down is pressed | ||
# move: Sent when arrow down is held |
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,29 @@ | ||
name: AC02511XXNJ (OSRAM) | ||
device_support: | ||
- type: Light | ||
domain: light | ||
controller: OsramAC025XX00NJLightController | ||
delay: 350 | ||
mapping: | ||
- press arrow up button → Turn on | ||
- hold arrow up button → Brighten up | ||
- press circle button → Sync (Full brightness; 2700K/White colour) | ||
- hold circle button → Color temp up / Right color wheel | ||
- press arrow down button → Turn off | ||
- hold arrow down button → Dim down | ||
integrations: | ||
- name: ZHA | ||
codename: zha | ||
actions: | ||
- 1_on → Click arrow up | ||
- 1_move_with_on_off → Hold arrow up | ||
- 1_stop → Release arrow up after hold | ||
- 3_move_to_level_with_on_off → Click circle button | ||
- 3_move_to_color_temp → Release circle button after click | ||
- 3_move_to_saturation → Hold circle button | ||
- 3_move_hue → Release circle button | ||
- 2_off → Click arrow down | ||
- 2_move → Hold arrow down | ||
- 2_stop → Release arrow down after hold | ||
note: >- | ||
This controller is supported for AC0251100NJ / AC0251400NJ / AC0251600NJ / AC0251700NJ. Different models are just different colours. |
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: AC02511XXNJ (OSRAM) | ||
device: OSRAM-AC02511XXNJ | ||
--- |
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