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:
parent
5ce4fe65b2
commit
82bdd9568d
5 changed files with 192 additions and 5 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue