Fix ZHA startup failure with the Konke button (#92144)

* Ensure devices with bad cluster subclasses do not prevent startup

* Explicitly unit test an affected SML001 device

* Do not use invalid `hue_occupancy` attribute name

* Actually remove `hue_occupancy`

* Bump ZHA dependencies
This commit is contained in:
puddly 2023-04-27 18:35:07 -04:00 committed by GitHub
parent cdbffee781
commit 9d0dd0b784
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 198 additions and 11 deletions

View file

@ -240,6 +240,15 @@ def zigpy_device_mock(zigpy_app_controller):
):
common.patch_cluster(cluster)
if attributes is not None:
for ep_id, clusters in attributes.items():
for cluster_name, attrs in clusters.items():
cluster = getattr(device.endpoints[ep_id], cluster_name)
for name, value in attrs.items():
attr_id = cluster.find_attribute(name).id
cluster._attr_cache[attr_id] = value
return device
return _mock_dev