Migrate utility_meter to use async_update_entry to alter config entries (#110394)

This commit is contained in:
J. Nick Koston 2024-02-12 12:51:16 -06:00 committed by GitHub
parent 4d1e3cdf49
commit 332db5093f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -266,8 +266,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
if config_entry.version == 1: if config_entry.version == 1:
new = {**config_entry.options} new = {**config_entry.options}
new[CONF_METER_PERIODICALLY_RESETTING] = True new[CONF_METER_PERIODICALLY_RESETTING] = True
config_entry.version = 2 hass.config_entries.async_update_entry(config_entry, options=new, version=2)
hass.config_entries.async_update_entry(config_entry, options=new)
_LOGGER.info("Migration to version %s successful", config_entry.version) _LOGGER.info("Migration to version %s successful", config_entry.version)