Cleanup ZHA initialization for TS011F child_lock (#83478)

This commit is contained in:
TheJulianJES 2022-12-07 16:53:08 +01:00 committed by GitHub
parent 8ed6fcd58e
commit fccf7fe1ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -348,6 +348,7 @@ class OnOffChannel(ZigbeeChannel):
self._off_listener = None self._off_listener = None
if self.cluster.endpoint.model in ( if self.cluster.endpoint.model in (
"TS011F",
"TS0121", "TS0121",
"TS0001", "TS0001",
"TS0002", "TS0002",
@ -359,13 +360,8 @@ class OnOffChannel(ZigbeeChannel):
) )
self.ZCL_INIT_ATTRS["backlight_mode"] = True self.ZCL_INIT_ATTRS["backlight_mode"] = True
self.ZCL_INIT_ATTRS["power_on_state"] = True self.ZCL_INIT_ATTRS["power_on_state"] = True
elif self.cluster.endpoint.model == "TS011F": if self.cluster.endpoint.model == "TS011F":
self.ZCL_INIT_ATTRS = ( # pylint: disable=invalid-name self.ZCL_INIT_ATTRS["child_lock"] = True
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 @property
def on_off(self) -> bool | None: def on_off(self) -> bool | None: