Fix restoring disabled_by flag of deleted devices (#151313)

This commit is contained in:
Erik Montnemery
2025-08-28 20:10:10 +02:00
committed by GitHub
parent 4130f3db2f
commit b01f93119f
2 changed files with 2 additions and 0 deletions

View File

@@ -936,6 +936,7 @@ class DeviceRegistry(BaseRegistry[dict[str, list[dict[str, Any]]]]):
connections, connections,
identifiers, identifiers,
) )
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

View File

@@ -3937,6 +3937,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")},