Skip to content

Commit

Permalink
Migrate roku to use async_update_entry to alter config entries (home-…
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Feb 12, 2024
1 parent e27e799 commit 32e3f6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/components/roku/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/components/roku/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 32e3f6c

Please sign in to comment.