diff --git a/homeassistant/helpers/area_registry.py b/homeassistant/helpers/area_registry.py index bf6dd0d6fcb..3e101f185ed 100644 --- a/homeassistant/helpers/area_registry.py +++ b/homeassistant/helpers/area_registry.py @@ -133,10 +133,9 @@ class AreaRegistryStore(Store[AreasRegistryStoreData]): if old_minor_version < 7: # Version 1.7 adds created_at and modiefied_at + created_at = utc_from_timestamp(0).isoformat() for area in old_data["areas"]: - area["created_at"] = area["modified_at"] = utc_from_timestamp( - 0 - ).isoformat() + area["created_at"] = area["modified_at"] = created_at if old_major_version > 1: raise NotImplementedError diff --git a/homeassistant/helpers/floor_registry.py b/homeassistant/helpers/floor_registry.py index 257da3dc47e..f14edef293a 100644 --- a/homeassistant/helpers/floor_registry.py +++ b/homeassistant/helpers/floor_registry.py @@ -87,10 +87,9 @@ class FloorRegistryStore(Store[FloorRegistryStoreData]): if old_major_version == 1: if old_minor_version < 2: # Version 1.2 implements migration and adds created_at and modified_at + created_at = utc_from_timestamp(0).isoformat() for floor in old_data["floors"]: - floor["created_at"] = floor["modified_at"] = utc_from_timestamp( - 0 - ).isoformat() + floor["created_at"] = floor["modified_at"] = created_at return old_data # type: ignore[return-value] diff --git a/homeassistant/helpers/label_registry.py b/homeassistant/helpers/label_registry.py index ab6fdc847fa..1007b17bc5d 100644 --- a/homeassistant/helpers/label_registry.py +++ b/homeassistant/helpers/label_registry.py @@ -87,10 +87,9 @@ class LabelRegistryStore(Store[LabelRegistryStoreData]): if old_major_version == 1: if old_minor_version < 2: # Version 1.2 implements migration and adds created_at and modified_at + created_at = utc_from_timestamp(0).isoformat() for label in old_data["labels"]: - label["created_at"] = label["modified_at"] = utc_from_timestamp( - 0 - ).isoformat() + label["created_at"] = label["modified_at"] = created_at return old_data # type: ignore[return-value]