mirror of
https://github.com/home-assistant/core
synced 2024-07-27 18:58:57 +02:00
Add Child lock support to Tuya devices (#83233)
* Add Child lock support to Tuya devices * flake/black * Add attribute to general.py * apply only to TS011F * also update general.py
This commit is contained in:
parent
e11917b7cb
commit
b031905956
@ -348,7 +348,6 @@ class OnOffChannel(ZigbeeChannel):
|
||||
self._off_listener = None
|
||||
|
||||
if self.cluster.endpoint.model in (
|
||||
"TS011F",
|
||||
"TS0121",
|
||||
"TS0001",
|
||||
"TS0002",
|
||||
@ -360,6 +359,13 @@ class OnOffChannel(ZigbeeChannel):
|
||||
)
|
||||
self.ZCL_INIT_ATTRS["backlight_mode"] = True
|
||||
self.ZCL_INIT_ATTRS["power_on_state"] = True
|
||||
elif self.cluster.endpoint.model == "TS011F":
|
||||
self.ZCL_INIT_ATTRS = ( # pylint: disable=invalid-name
|
||||
self.ZCL_INIT_ATTRS.copy()
|
||||
)
|
||||
self.ZCL_INIT_ATTRS["backlight_mode"] = True
|
||||
self.ZCL_INIT_ATTRS["child_lock"] = True
|
||||
self.ZCL_INIT_ATTRS["power_on_state"] = True
|
||||
|
||||
@property
|
||||
def on_off(self) -> bool | None:
|
||||
|
@ -457,3 +457,15 @@ class AqaraPetFeederChildLock(ZHASwitchConfigurationEntity, id_suffix="child_loc
|
||||
_zcl_attribute: str = "child_lock"
|
||||
_attr_name = "Child lock"
|
||||
_attr_icon: str = "mdi:account-lock"
|
||||
|
||||
|
||||
@CONFIG_DIAGNOSTIC_MATCH(
|
||||
channel_names=CHANNEL_ON_OFF,
|
||||
models={"TS011F"},
|
||||
)
|
||||
class TuyaChildLockSwitch(ZHASwitchConfigurationEntity, id_suffix="child_lock"):
|
||||
"""Representation of a child lock configuration entity."""
|
||||
|
||||
_zcl_attribute: str = "child_lock"
|
||||
_attr_name = "Child lock"
|
||||
_attr_icon: str = "mdi:account-lock"
|
||||
|
Loading…
Reference in New Issue
Block a user