From fccf7fe1caca8b01cbba0694abdbee5674cf46fa Mon Sep 17 00:00:00 2001 From: TheJulianJES Date: Wed, 7 Dec 2022 16:53:08 +0100 Subject: [PATCH] Cleanup ZHA initialization for TS011F child_lock (#83478) --- homeassistant/components/zha/core/channels/general.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/zha/core/channels/general.py b/homeassistant/components/zha/core/channels/general.py index fbafbdc03e7..47d0cafb01c 100644 --- a/homeassistant/components/zha/core/channels/general.py +++ b/homeassistant/components/zha/core/channels/general.py @@ -348,6 +348,7 @@ class OnOffChannel(ZigbeeChannel): self._off_listener = None if self.cluster.endpoint.model in ( + "TS011F", "TS0121", "TS0001", "TS0002", @@ -359,13 +360,8 @@ 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 + if self.cluster.endpoint.model == "TS011F": + self.ZCL_INIT_ATTRS["child_lock"] = True @property def on_off(self) -> bool | None: