Skip to content

Commit 7683328

Browse files
committed
hotfix: apply migration consistently.
Previous migration had multiple issues: - migration was defined as 13_14, but was calling the 13_13 migration function instead. This was out of scope for some users so threw an error, but that did not happen for me for some reason. - version was upgraded to 13_14, but new configs were still created as 13_12. Fixed for re-release of 2026.1.1 Issue #4308
1 parent aa07b52 commit 7683328

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

custom_components/tuya_local/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,8 @@ def update_unique_id13_13(entity_entry):
740740
await async_migrate_entries(hass, entry.entry_id, update_unique_id13_13)
741741
hass.config_entries.async_update_entry(entry, minor_version=13)
742742

743-
if entry.version == 13 and entry.minor_version < 14:
743+
# 13.14 was botched, so repeat as 13.15
744+
if entry.version == 13 and entry.minor_version < 15:
744745
# Migrate unique ids of existing entities to new id taking into
745746
# account translation_key, and standardising naming
746747
device_id = get_device_unique_id(entry)
@@ -756,7 +757,7 @@ def update_unique_id13_13(entity_entry):
756757
return False
757758

758759
@callback
759-
def update_unique_id13_14(entity_entry):
760+
def update_unique_id13_15(entity_entry):
760761
"""Update the unique id of an entity entry."""
761762
# Standardistion of entity naming to use translation_key
762763
replacements = {
@@ -784,8 +785,8 @@ def update_unique_id13_14(entity_entry):
784785
}
785786
return replace_unique_ids(entity_entry, device_id, conf_file, replacements)
786787

787-
await async_migrate_entries(hass, entry.entry_id, update_unique_id13_13)
788-
hass.config_entries.async_update_entry(entry, minor_version=14)
788+
await async_migrate_entries(hass, entry.entry_id, update_unique_id13_15)
789+
hass.config_entries.async_update_entry(entry, minor_version=15)
789790
return True
790791

791792

custom_components/tuya_local/config_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
4949
VERSION = 13
50-
MINOR_VERSION = 12
50+
MINOR_VERSION = 15
5151
CONNECTION_CLASS = CONN_CLASS_LOCAL_PUSH
5252
device = None
5353
data = {}

0 commit comments

Comments
 (0)