Migrate obihai to use async_update_entry to alter config entries (#110368)

This commit is contained in:
J. Nick Koston
2024-02-12 13:13:53 -06:00
committed by GitHub
parent 2bd64dba6b
commit fc1c513f33
+3 -3
View File
@@ -36,9 +36,9 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
device_mac = await hass.async_add_executor_job(
requester.pyobihai.get_device_mac
)
hass.config_entries.async_update_entry(entry, unique_id=format_mac(device_mac))
entry.version = 2
hass.config_entries.async_update_entry(
entry, unique_id=format_mac(device_mac), version=2
)
LOGGER.info("Migration to version %s successful", entry.version)