From 4b06c5d2fb6b383fa5acdc3a3e7d5c0ea785b19b Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 31 May 2024 23:07:51 +0200 Subject: [PATCH] Update device connections in samsungtv (#118556) --- homeassistant/components/samsungtv/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/samsungtv/__init__.py b/homeassistant/components/samsungtv/__init__.py index fbae0d5552a..f49ae276665 100644 --- a/homeassistant/components/samsungtv/__init__.py +++ b/homeassistant/components/samsungtv/__init__.py @@ -301,9 +301,12 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> for device in dr.async_entries_for_config_entry( dev_reg, config_entry.entry_id ): - for connection in device.connections: - if connection == (dr.CONNECTION_NETWORK_MAC, "none"): - dev_reg.async_remove_device(device.id) + new_connections = device.connections.copy() + new_connections.discard((dr.CONNECTION_NETWORK_MAC, "none")) + if new_connections != device.connections: + dev_reg.async_update_device( + device.id, new_connections=new_connections + ) minor_version = 2 hass.config_entries.async_update_entry(config_entry, minor_version=2)