Migrate roku to use async_update_entry to alter config entries (#110363)

pull/110487/head
J. Nick Koston 2024-02-12 13:10:06 -06:00 committed by GitHub
parent e27e799dd5
commit 32e3f6c5a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -87,8 +87,10 @@ async def init_integration(
mock_roku: MagicMock,
) -> MockConfigEntry:
"""Set up the Roku integration for testing."""
mock_config_entry.unique_id = mock_device.info.serial_number
mock_config_entry.add_to_hass(hass)
hass.config_entries.async_update_entry(
mock_config_entry, unique_id=mock_device.info.serial_number
)
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()

View File

@ -32,8 +32,8 @@ async def test_config_entry_no_unique_id(
mock_roku: AsyncMock,
) -> None:
"""Test the Roku configuration entry with missing unique id."""
mock_config_entry.unique_id = None
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()