Clean up old migration in Twente Milieu (#130998)

This commit is contained in:
Franck Nijhof 2024-11-19 22:28:59 +01:00 committed by GitHub
parent fa28936995
commit 07051d0d0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 21 deletions

View File

@ -49,12 +49,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)
await coordinator.async_config_entry_first_refresh()
# For backwards compat, set unique ID
if entry.unique_id is None:
hass.config_entries.async_update_entry(
entry, unique_id=str(entry.data[CONF_ID])
)
entry.runtime_data = coordinator
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

View File

@ -44,18 +44,3 @@ async def test_config_entry_not_ready(
assert mock_request.call_count == 1
assert mock_config_entry.state is ConfigEntryState.SETUP_RETRY
@pytest.mark.usefixtures("mock_twentemilieu")
async def test_update_config_entry_unique_id(
hass: HomeAssistant,
mock_config_entry: MockConfigEntry,
) -> None:
"""Test the we update old config entries with an unique ID."""
mock_config_entry.add_to_hass(hass)
hass.config_entries.async_update_entry(mock_config_entry, unique_id=None)
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
assert mock_config_entry.unique_id == "12345"