Skip to content

Commit

Permalink
No more afraid check :)
Browse files Browse the repository at this point in the history
  • Loading branch information
jb101010-2 committed Dec 28, 2024
1 parent ea0a32c commit 5a14024
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
5 changes: 0 additions & 5 deletions homeassistant/components/suez_water/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ async def async_migrate_entry(
if config_entry.version == 1:
# Migrate to version 2
counter_id = config_entry.data.get(CONF_COUNTER_ID)
if not counter_id:
_LOGGER.error(
"Failed to migrate to suez_water because no counter_id was previously defined"
)
return False
unique_id = str(counter_id)

hass.config_entries.async_update_entry(
Expand Down
15 changes: 0 additions & 15 deletions tests/components/suez_water/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,6 @@ async def test_migration_version_1_to_2(
suez_client: AsyncMock,
) -> None:
"""Test that a migration from 1 to 2 change unique_id."""

broken_data = MOCK_DATA.copy()
broken_data.pop(CONF_COUNTER_ID)

past_entry = MockConfigEntry(
unique_id=MOCK_DATA[CONF_USERNAME],
domain=DOMAIN,
title=MOCK_DATA[CONF_USERNAME],
data=broken_data,
version=1,
minor_version=0,
)
await setup_integration(hass, past_entry)
assert past_entry.state is ConfigEntryState.MIGRATION_ERROR

past_entry = MockConfigEntry(
unique_id=MOCK_DATA[CONF_USERNAME],
domain=DOMAIN,
Expand Down

0 comments on commit 5a14024

Please sign in to comment.