Make sure diagnostic data is output in deterministic order ZHA (#123551)

Make sure diagnostic data is output in deterministic order

Sets are not ordered, so the tests for this failed sporadically since it is
converted into a list when converted to json.
This commit is contained in:
Joakim Plate 2024-08-10 20:55:31 +02:00 committed by GitHub
parent f53da62026
commit f69507527b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -166,5 +166,7 @@ def get_cluster_attr_data(cluster: Cluster) -> dict:
} }
for attr_id, attr_def in cluster.attributes.items() for attr_id, attr_def in cluster.attributes.items()
}, },
UNSUPPORTED_ATTRIBUTES: cluster.unsupported_attributes, UNSUPPORTED_ATTRIBUTES: sorted(
cluster.unsupported_attributes, key=lambda v: (isinstance(v, str), v)
),
} }