From fec6706bf7dbeb4919c732d5b091d9868d21695b Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Mon, 9 Sep 2019 09:21:34 -0400 Subject: [PATCH] use newly added is_server for cluster reporting (#26533) --- homeassistant/components/zha/core/channels/__init__.py | 2 +- tests/components/zha/common.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/zha/core/channels/__init__.py b/homeassistant/components/zha/core/channels/__init__.py index c703f339e43..aed12bc65a5 100644 --- a/homeassistant/components/zha/core/channels/__init__.py +++ b/homeassistant/components/zha/core/channels/__init__.py @@ -202,7 +202,7 @@ class ZigbeeChannel(LogMixin): # Xiaomi devices don't need this and it disrupts pairing if self._zha_device.manufacturer != "LUMI": await self.bind() - if self.cluster.cluster_id in self.cluster.endpoint.in_clusters: + if self.cluster.is_server: for report_config in self._report_config: await self.configure_reporting( report_config["attr"], report_config["config"] diff --git a/tests/components/zha/common.py b/tests/components/zha/common.py index d34c6983528..fc29e4012cd 100644 --- a/tests/components/zha/common.py +++ b/tests/components/zha/common.py @@ -50,7 +50,7 @@ class FakeEndpoint: """Add an input cluster.""" from zigpy.zcl import Cluster - cluster = Cluster.from_id(self, cluster_id) + cluster = Cluster.from_id(self, cluster_id, is_server=True) patch_cluster(cluster) self.in_clusters[cluster_id] = cluster if hasattr(cluster, "ep_attribute"): @@ -60,7 +60,7 @@ class FakeEndpoint: """Add an output cluster.""" from zigpy.zcl import Cluster - cluster = Cluster.from_id(self, cluster_id) + cluster = Cluster.from_id(self, cluster_id, is_server=False) patch_cluster(cluster) self.out_clusters[cluster_id] = cluster