zha: Handle both input and output clusters (#8410)
bellows 0.3.0 changes the API to have both, renaming the attribute which used to be for input clusters in the process. This is in preparation for remotes.
This commit is contained in:
parent
7a4cc8e082
commit
2f474a0ed8
6 changed files with 42 additions and 28 deletions
|
@ -34,10 +34,10 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
|||
|
||||
from bellows.zigbee.zcl.clusters.security import IasZone
|
||||
|
||||
clusters = discovery_info['clusters']
|
||||
in_clusters = discovery_info['in_clusters']
|
||||
|
||||
device_class = None
|
||||
cluster = [c for c in clusters if isinstance(c, IasZone)][0]
|
||||
cluster = in_clusters[IasZone.cluster_id]
|
||||
if discovery_info['new_join']:
|
||||
yield from cluster.bind()
|
||||
ieee = cluster.endpoint.device.application.ieee
|
||||
|
@ -64,7 +64,7 @@ class BinarySensor(zha.Entity, BinarySensorDevice):
|
|||
super().__init__(**kwargs)
|
||||
self._device_class = device_class
|
||||
from bellows.zigbee.zcl.clusters.security import IasZone
|
||||
self._ias_zone_cluster = self._clusters[IasZone.cluster_id]
|
||||
self._ias_zone_cluster = self._in_clusters[IasZone.cluster_id]
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue