1
0
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:
Paulus Schoutsen
2021-12-04 00:20:12 -08:00
committed by GitHub
parent 2fe48702f3
commit a59ec9ca5e
2 changed files with 35 additions and 3 deletions

View File

@@ -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(