From fc1c513f33928226e533582b99b9ea14852d399d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 12 Feb 2024 13:13:53 -0600 Subject: [PATCH] Migrate obihai to use async_update_entry to alter config entries (#110368) --- homeassistant/components/obihai/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/obihai/__init__.py b/homeassistant/components/obihai/__init__.py index a3e16fbad76..0ba0b3dfc5e 100644 --- a/homeassistant/components/obihai/__init__.py +++ b/homeassistant/components/obihai/__init__.py @@ -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)