mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Add Tuya Backlight mode configuration (#81218)
* Tuya backlight configuration * fix codespell
This commit is contained in:
parent
2e92a0d1c2
commit
52c80b7c5b
@ -352,6 +352,7 @@ class OnOffChannel(ZigbeeChannel):
|
||||
self.ZCL_INIT_ATTRS = ( # pylint: disable=invalid-name
|
||||
self.ZCL_INIT_ATTRS.copy()
|
||||
)
|
||||
self.ZCL_INIT_ATTRS["backlight_mode"] = True
|
||||
self.ZCL_INIT_ATTRS["power_on_state"] = True
|
||||
|
||||
@property
|
||||
|
@ -269,6 +269,26 @@ class TuyaPowerOnStateSelectEntity(ZCLEnumSelectEntity, id_suffix="power_on_stat
|
||||
_attr_name = "Power on state"
|
||||
|
||||
|
||||
class TuyaBacklightMode(types.enum8):
|
||||
"""Tuya switch backlight mode enum."""
|
||||
|
||||
Off = 0x00
|
||||
LightWhenOn = 0x01
|
||||
LightWhenOff = 0x02
|
||||
|
||||
|
||||
@CONFIG_DIAGNOSTIC_MATCH(
|
||||
channel_names=CHANNEL_ON_OFF,
|
||||
models={"TS011F", "TS0121", "TS0001", "TS0002", "TS0003", "TS0004"},
|
||||
)
|
||||
class TuyaBacklightModeSelectEntity(ZCLEnumSelectEntity, id_suffix="backlight_mode"):
|
||||
"""Representation of a ZHA backlight mode select entity."""
|
||||
|
||||
_select_attr = "backlight_mode"
|
||||
_enum = TuyaBacklightMode
|
||||
_attr_name = "Backlight mode"
|
||||
|
||||
|
||||
class MoesBacklightMode(types.enum8):
|
||||
"""MOES switch backlight mode enum."""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user