From 9949eeda7b16acb76169c56ed7462c774cc9b6e3 Mon Sep 17 00:00:00 2001 From: Jonathan Keslin Date: Fri, 29 Nov 2024 21:16:20 -0800 Subject: [PATCH 1/2] Add room_temperature attribute for Sinope floor heat thermostat --- zha/zigbee/cluster_handlers/manufacturerspecific.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/zha/zigbee/cluster_handlers/manufacturerspecific.py b/zha/zigbee/cluster_handlers/manufacturerspecific.py index f9c54ea13..a3afffc7d 100644 --- a/zha/zigbee/cluster_handlers/manufacturerspecific.py +++ b/zha/zigbee/cluster_handlers/manufacturerspecific.py @@ -532,6 +532,11 @@ class SinopeManufacturerClusterHandler(ClusterHandler): def __init__(self, cluster: zigpy.zcl.Cluster, endpoint: Endpoint) -> None: """Initialize Sinope cluster handler.""" super().__init__(cluster, endpoint) + + if self.cluster.endpoint.model == "TH1300ZB": + self.ZCL_INIT_ATTRS["room_temperature"] = True + return # Don't apply switch-specific attributes below + self.ZCL_INIT_ATTRS = { "double_up_full": True, "on_led_color": True, @@ -571,9 +576,12 @@ def matches(cls, cluster: zigpy.zcl.Cluster, endpoint: Endpoint) -> bool: "DM2550ZB", "DM2550ZB-G2", ) + thermostats = ( + "TH1300ZB", + ) _LOGGER.debug( "matching sinope device to cluster handler %s", cluster.endpoint.model ) - return cluster.endpoint.model in switches + return cluster.endpoint.model in (switches + thermostats) From 5e9e737ed8a42328a4744f38912b39446e1a54f0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 04:37:02 +0000 Subject: [PATCH 2/2] Apply pre-commit auto fixes --- zha/zigbee/cluster_handlers/manufacturerspecific.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/zha/zigbee/cluster_handlers/manufacturerspecific.py b/zha/zigbee/cluster_handlers/manufacturerspecific.py index a3afffc7d..ff27c6500 100644 --- a/zha/zigbee/cluster_handlers/manufacturerspecific.py +++ b/zha/zigbee/cluster_handlers/manufacturerspecific.py @@ -535,8 +535,8 @@ def __init__(self, cluster: zigpy.zcl.Cluster, endpoint: Endpoint) -> None: if self.cluster.endpoint.model == "TH1300ZB": self.ZCL_INIT_ATTRS["room_temperature"] = True - return # Don't apply switch-specific attributes below - + return # Don't apply switch-specific attributes below + self.ZCL_INIT_ATTRS = { "double_up_full": True, "on_led_color": True, @@ -576,9 +576,7 @@ def matches(cls, cluster: zigpy.zcl.Cluster, endpoint: Endpoint) -> bool: "DM2550ZB", "DM2550ZB-G2", ) - thermostats = ( - "TH1300ZB", - ) + thermostats = ("TH1300ZB",) _LOGGER.debug( "matching sinope device to cluster handler %s", cluster.endpoint.model