Add Tuya Backlight mode configuration (#81218)

* Tuya backlight configuration

* fix codespell
This commit is contained in:
javicalle 2022-11-04 14:54:19 +01:00 committed by GitHub
parent 2e92a0d1c2
commit 52c80b7c5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -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

View File

@ -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."""