mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Migrate ps4 to use async_update_entry to alter config entries (#110373)
This commit is contained in:
parent
df8a168c97
commit
e2ec23955e
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user