From f510534c583331076fc408f4e6497a755b1b988b Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 22 Nov 2021 20:38:51 +0100 Subject: [PATCH] Bump entity registry version to 1.3 (#60164) --- homeassistant/helpers/entity_registry.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/helpers/entity_registry.py b/homeassistant/helpers/entity_registry.py index 076ea652f79..6e68d4f5499 100644 --- a/homeassistant/helpers/entity_registry.py +++ b/homeassistant/helpers/entity_registry.py @@ -59,7 +59,7 @@ DISABLED_INTEGRATION = "integration" DISABLED_USER = "user" STORAGE_VERSION_MAJOR = 1 -STORAGE_VERSION_MINOR = 2 +STORAGE_VERSION_MINOR = 3 STORAGE_KEY = "core.entity_registry" # Attributes relevant to describing entity @@ -751,9 +751,13 @@ async def _async_migrate( entity["supported_features"] = entity.get("supported_features", 0) 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 entity["original_device_class"] = entity["device_class"] entity["device_class"] = None + if old_major_version > 1: raise NotImplementedError return data