mirror of
https://github.com/home-assistant/core.git
synced 2025-08-30 09:51:37 +02:00
Fix restoring disabled_by flag of deleted devices (#151313)
This commit is contained in:
committed by
Franck Nijhof
parent
e21c2fa08b
commit
bec8cf3ea8
@@ -944,6 +944,8 @@ class DeviceRegistry(BaseRegistry[dict[str, list[dict[str, Any]]]]):
|
|||||||
identifiers,
|
identifiers,
|
||||||
disabled_by,
|
disabled_by,
|
||||||
)
|
)
|
||||||
|
disabled_by = UNDEFINED
|
||||||
|
|
||||||
self.devices[device.id] = device
|
self.devices[device.id] = device
|
||||||
# If creating a new device, default to the config entry name
|
# If creating a new device, default to the config entry name
|
||||||
if device_info_type == "primary" and (not name or name is UNDEFINED):
|
if device_info_type == "primary" and (not name or name is UNDEFINED):
|
||||||
|
@@ -4066,6 +4066,7 @@ async def test_restore_disabled_by(
|
|||||||
config_subentry_id=None,
|
config_subentry_id=None,
|
||||||
configuration_url="http://config_url_new.bla",
|
configuration_url="http://config_url_new.bla",
|
||||||
connections={(dr.CONNECTION_NETWORK_MAC, "12:34:56:AB:CD:EF")},
|
connections={(dr.CONNECTION_NETWORK_MAC, "12:34:56:AB:CD:EF")},
|
||||||
|
disabled_by=None,
|
||||||
entry_type=None,
|
entry_type=None,
|
||||||
hw_version="hw_version_new",
|
hw_version="hw_version_new",
|
||||||
identifiers={("bridgeid", "0123")},
|
identifiers={("bridgeid", "0123")},
|
||||||
|
Reference in New Issue
Block a user