Skip to content

Commit

Permalink
Merge pull request #1212 from robbrad/feat_add_manual_refresh_control
Browse files Browse the repository at this point in the history
feat: adding manual refresh
  • Loading branch information
robbrad authored Feb 2, 2025
2 parents bef2571 + 9fd67ec commit 49d4b26
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions custom_components/uk_bin_collection/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ async def async_migrate_entry(self, config_entry: config_entries.ConfigEntry) ->
_LOGGER.info("Migrating config entry from version %s", config_entry.version)
data = dict(config_entry.data)

# If the manual_refresh_only key is not present, add it and set to True.
if "manual_refresh_only" not in data:
_LOGGER.info("Setting 'manual_refresh_only' to True in the migration")
data["manual_refresh_only"] = True

self.hass.config_entries.async_update_entry(config_entry, data=data)
_LOGGER.info("Migration to version %s successful", self.VERSION)
if config_entry.version < 3:
# If the manual_refresh_only key is not present, add it and set to True.
if "manual_refresh_only" not in data:
_LOGGER.info("Setting 'manual_refresh_only' to True in the migration")
data["manual_refresh_only"] = True

self.hass.config_entries.async_update_entry(config_entry, data=data)
_LOGGER.info("Migration to version %s successful", self.VERSION)
return True


Expand Down

0 comments on commit 49d4b26

Please sign in to comment.