mirror of
https://github.com/home-assistant/core
synced 2024-10-01 05:30:36 +02:00
Bump entity registry version to 1.3 (#60164)
This commit is contained in:
parent
c87ab574a7
commit
f510534c58
@ -59,7 +59,7 @@ DISABLED_INTEGRATION = "integration"
|
|||||||
DISABLED_USER = "user"
|
DISABLED_USER = "user"
|
||||||
|
|
||||||
STORAGE_VERSION_MAJOR = 1
|
STORAGE_VERSION_MAJOR = 1
|
||||||
STORAGE_VERSION_MINOR = 2
|
STORAGE_VERSION_MINOR = 3
|
||||||
STORAGE_KEY = "core.entity_registry"
|
STORAGE_KEY = "core.entity_registry"
|
||||||
|
|
||||||
# Attributes relevant to describing entity
|
# Attributes relevant to describing entity
|
||||||
@ -751,9 +751,13 @@ async def _async_migrate(
|
|||||||
entity["supported_features"] = entity.get("supported_features", 0)
|
entity["supported_features"] = entity.get("supported_features", 0)
|
||||||
entity["unit_of_measurement"] = entity.get("unit_of_measurement")
|
entity["unit_of_measurement"] = entity.get("unit_of_measurement")
|
||||||
|
|
||||||
|
if old_major_version < 2 and old_minor_version < 3:
|
||||||
|
# From version 1.2
|
||||||
|
for entity in data["entities"]:
|
||||||
# Move device_class to original_device_class
|
# Move device_class to original_device_class
|
||||||
entity["original_device_class"] = entity["device_class"]
|
entity["original_device_class"] = entity["device_class"]
|
||||||
entity["device_class"] = None
|
entity["device_class"] = None
|
||||||
|
|
||||||
if old_major_version > 1:
|
if old_major_version > 1:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
return data
|
return data
|
||||||
|
Loading…
Reference in New Issue
Block a user