From e2ec23955e7eecc3c3beba72a7a12c0bd44e6c2b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 12 Feb 2024 12:52:04 -0600 Subject: [PATCH] Migrate ps4 to use async_update_entry to alter config entries (#110373) --- homeassistant/components/ps4/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/ps4/__init__.py b/homeassistant/components/ps4/__init__.py index 4e7f78c4b18..f68ad6ce896 100644 --- a/homeassistant/components/ps4/__init__.py +++ b/homeassistant/components/ps4/__init__.py @@ -108,8 +108,8 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: if country in COUNTRIES: for device in data["devices"]: device[CONF_REGION] = country - version = entry.version = 2 - config_entries.async_update_entry(entry, data=data) + version = 2 + config_entries.async_update_entry(entry, data=data, version=2) _LOGGER.info( "PlayStation 4 Config Updated: Region changed to: %s", country, @@ -142,12 +142,11 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: config_entry=entry, device_id=e_entry.device_id, ) - entry.version = 3 _LOGGER.info( "PlayStation 4 identifier for entity: %s has changed", entity_id, ) - config_entries.async_update_entry(entry) + config_entries.async_update_entry(entry, version=3) return True msg = f"""{reason[version]} for the PlayStation 4 Integration.