Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,18 @@ def zigpy_device_from_device_data(

for cluster_type in ("in_clusters", "out_clusters"):
for cluster in ep[cluster_type]:
real_cluster = getattr(endpoint, cluster_type)[
real_cluster = getattr(endpoint, cluster_type).get(
int(cluster["cluster_id"], 16)
]
)

if real_cluster is None:
_LOGGER.warning(
"Cluster %s not found in endpoint %s of device %s",
cluster["cluster_id"],
epid,
device.ieee,
)
continue

if patch_cluster:
patch_cluster_for_testing(real_cluster)
Expand Down
1 change: 1 addition & 0 deletions tools/import_legacy_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def zigpy_device_from_legacy_diagnostics(
for epid, ep in cluster_data.items():
endpoint.request = AsyncMock(return_value=[0])
for cluster_id, cluster in ep["in_clusters"].items():
# todo: likely also add here?
real_cluster = device.endpoints[int(epid)].in_clusters[int(cluster_id, 16)]
if patch_cluster:
patch_cluster_for_testing(real_cluster)
Expand Down
Loading