Fix HomeKit with entity registry restoration where supported_features is a non-None falsey (#30657)
* Fix homekit with #30094 * Fix test
This commit is contained in:
1 parent
f505310f11
commit
449e6841a7
7 files changed
+300
-4
No files matched your search
@@ -490,13 +490,13 @@ def async_setup_entity_restore(
|
||||
|
||||
attrs: Dict[str, Any] = {ATTR_RESTORED: True}
|
||||
|
||||
if entry.capabilities:
|
||||
if entry.capabilities is not None:
|
||||
attrs.update(entry.capabilities)
|
||||
|
||||
if entry.supported_features:
|
||||
if entry.supported_features is not None:
|
||||
attrs[ATTR_SUPPORTED_FEATURES] = entry.supported_features
|
||||
|
||||
if entry.device_class:
|
||||
if entry.device_class is not None:
|
||||
attrs[ATTR_DEVICE_CLASS] = entry.device_class
|
||||
|
||||
states.async_set(entry.entity_id, STATE_UNAVAILABLE, attrs)
|
||||
|
||||
Reference in new issue
Block a user