Add direct binding for remotes and lights for ZHA (#21498)

* cluster matching and binding apis

implement binding

callback

fix loop

fix loops

* review comments

* use any because it is clearer
This commit is contained in:
David F. Mulcahey authored and Paulus Schoutsen committed 2019-02-28 10:04:35 -08:00
1 parent 5ce4fe65b2
commit 82bdd9568d
5 files changed
+192 -5

No files matched your search

@@ -242,6 +242,18 @@ class ZHADevice:
if ep_id != 0
}
@callback
def async_get_zha_clusters(self):
"""Get zigbee home automation clusters for this device."""
from zigpy.profiles.zha import PROFILE_ID
return {
ep_id: {
IN: endpoint.in_clusters,
OUT: endpoint.out_clusters
} for (ep_id, endpoint) in self._zigpy_device.endpoints.items()
if ep_id != 0 and endpoint.profile_id == PROFILE_ID
}
@callback
def async_get_cluster(self, endpoint_id, cluster_id, cluster_type=IN):
"""Get zigbee cluster from this entity."""