From ac08cd1201320f6b18a919415a94e8bb0af46281 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 10 Jun 2024 20:20:25 +0200 Subject: [PATCH] Revert SamsungTV migration (#119234) --- homeassistant/components/samsungtv/__init__.py | 11 +---------- tests/components/samsungtv/test_init.py | 6 +++++- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/samsungtv/__init__.py b/homeassistant/components/samsungtv/__init__.py index f49ae276665..992c86d5d7e 100644 --- a/homeassistant/components/samsungtv/__init__.py +++ b/homeassistant/components/samsungtv/__init__.py @@ -297,16 +297,7 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> if version == 2: if minor_version < 2: # Cleanup invalid MAC addresses - see #103512 - dev_reg = dr.async_get(hass) - for device in dr.async_entries_for_config_entry( - dev_reg, config_entry.entry_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 - ) + # Reverted due to device registry collisions - see #119082 / #119249 minor_version = 2 hass.config_entries.async_update_entry(config_entry, minor_version=2) diff --git a/tests/components/samsungtv/test_init.py b/tests/components/samsungtv/test_init.py index 4efcf62c1dd..479664d4ec0 100644 --- a/tests/components/samsungtv/test_init.py +++ b/tests/components/samsungtv/test_init.py @@ -220,10 +220,14 @@ async def test_incorrectly_formatted_mac_fixed(hass: HomeAssistant) -> None: @pytest.mark.usefixtures("remotews", "rest_api") +@pytest.mark.xfail async def test_cleanup_mac( hass: HomeAssistant, device_registry: dr.DeviceRegistry, snapshot: SnapshotAssertion ) -> None: - """Test for `none` mac cleanup #103512.""" + """Test for `none` mac cleanup #103512. + + Reverted due to device registry collisions in #119249 / #119082 + """ entry = MockConfigEntry( domain=SAMSUNGTV_DOMAIN, data=MOCK_ENTRY_WS_WITH_MAC,