mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Update device connections in samsungtv (#118556)
This commit is contained in:
parent
32b51b8792
commit
738935a73a
@ -301,9 +301,12 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
|
|||||||
for device in dr.async_entries_for_config_entry(
|
for device in dr.async_entries_for_config_entry(
|
||||||
dev_reg, config_entry.entry_id
|
dev_reg, config_entry.entry_id
|
||||||
):
|
):
|
||||||
for connection in device.connections:
|
new_connections = device.connections.copy()
|
||||||
if connection == (dr.CONNECTION_NETWORK_MAC, "none"):
|
new_connections.discard((dr.CONNECTION_NETWORK_MAC, "none"))
|
||||||
dev_reg.async_remove_device(device.id)
|
if new_connections != device.connections:
|
||||||
|
dev_reg.async_update_device(
|
||||||
|
device.id, new_connections=new_connections
|
||||||
|
)
|
||||||
|
|
||||||
minor_version = 2
|
minor_version = 2
|
||||||
hass.config_entries.async_update_entry(config_entry, minor_version=2)
|
hass.config_entries.async_update_entry(config_entry, minor_version=2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user