Skip to content

Commit

Permalink
Fix migrate multi versions
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou committed Jan 11, 2024
1 parent b5d67b2 commit fe50c74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/localtuya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry):
ent_items[k] = str(v) if type(v) is int else v
new_data[CONF_DEVICES][device][CONF_ENTITIES][i].update(ent_items)
i = i + 1
config_entry.version = new_version
config_entry.version = 3
hass.config_entries.async_update_entry(config_entry, data=new_data)
if config_entry.version <= 3:
# Convert values and friendly name values to dict.
Expand Down Expand Up @@ -275,7 +275,7 @@ def convert_str_to_dict(list1: str, list2: str = ""):
new_entity_data
)
current_entity += 1
config_entry.version = new_version
config_entry.version = 4
hass.config_entries.async_update_entry(config_entry, data=new_data)

_LOGGER.info(
Expand Down

0 comments on commit fe50c74

Please sign in to comment.