diff --git a/tests/components/roku/conftest.py b/tests/components/roku/conftest.py index c1ceb23934e..2015d01ea68 100644 --- a/tests/components/roku/conftest.py +++ b/tests/components/roku/conftest.py @@ -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() diff --git a/tests/components/roku/test_init.py b/tests/components/roku/test_init.py index 2ebad1e0b2b..7f291f020d9 100644 --- a/tests/components/roku/test_init.py +++ b/tests/components/roku/test_init.py @@ -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()