mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Handle invalid device registry entry type (#60966)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
@@ -172,7 +172,11 @@ class DeviceRegistryStore(storage.Store):
|
||||
# From version 1.1
|
||||
for device in old_data["devices"]:
|
||||
# Introduced in 0.110
|
||||
device["entry_type"] = device.get("entry_type")
|
||||
try:
|
||||
device["entry_type"] = DeviceEntryType(device.get("entry_type"))
|
||||
except ValueError:
|
||||
device["entry_type"] = None
|
||||
|
||||
# Introduced in 0.79
|
||||
# renamed in 0.95
|
||||
device["via_device_id"] = device.get("via_device_id") or device.get(
|
||||
|
||||
Reference in New Issue
Block a user