Преглед изворни кода

unique_id_migration: use a unique name for the migration function

Avoid a name clash with the earlier migration, which probably results in the
wrong migration being done (no migration messages were found in the log, and
duplicate entities were created).
Jason Rumney пре 3 година
родитељ
комит
b9fcdbedf6
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      custom_components/tuya_local/__init__.py

+ 2 - 2
custom_components/tuya_local/__init__.py

@@ -174,7 +174,7 @@ async def async_migrate_entry(hass, entry: ConfigEntry):
             return False
 
         @callback
-        def update_unique_id(entity_entry):
+        def update_unique_id12(entity_entry):
             """Update the unique id of an entity entry."""
             old_id = entity_entry.unique_id
             e = conf_file.primary_entity
@@ -201,7 +201,7 @@ async def async_migrate_entry(hass, entry: ConfigEntry):
                         "new_unique_id": entity_entry.unique_id.replace(old_id, new_id)
                     }
 
-        await async_migrate_entries(hass, entry.entry_id, update_unique_id)
+        await async_migrate_entries(hass, entry.entry_id, update_unique_id12)
         entry.version = 12
 
     return True