diff --git a/tests/components/netatmo/common.py b/tests/components/netatmo/common.py index a3f7dfcb9d2d74..0776b80a3cdff2 100644 --- a/tests/components/netatmo/common.py +++ b/tests/components/netatmo/common.py @@ -92,7 +92,11 @@ async def simulate_webhook(hass, webhook_id, response): @contextmanager def selected_platforms(platforms): """Restrict loaded platforms to list given.""" - with patch("homeassistant.components.netatmo.PLATFORMS", platforms), patch( + with patch( + "homeassistant.components.netatmo.data_handler.PLATFORMS", platforms + ), patch( "homeassistant.helpers.config_entry_oauth2_flow.async_get_config_entry_implementation", - ), patch("homeassistant.components.netatmo.webhook_generate_url"): + ), patch( + "homeassistant.components.netatmo.webhook_generate_url" + ): yield diff --git a/tests/components/netatmo/test_camera.py b/tests/components/netatmo/test_camera.py index 8bfe7176f5df28..e9a66cfefc818a 100644 --- a/tests/components/netatmo/test_camera.py +++ b/tests/components/netatmo/test_camera.py @@ -478,7 +478,7 @@ async def fake_post_no_data(*args, **kwargs): with patch( "homeassistant.components.netatmo.api.AsyncConfigEntryNetatmoAuth" ) as mock_auth, patch( - "homeassistant.components.netatmo.PLATFORMS", ["camera"] + "homeassistant.components.netatmo.data_handler.PLATFORMS", ["camera"] ), patch( "homeassistant.helpers.config_entry_oauth2_flow.async_get_config_entry_implementation", ), patch( @@ -491,7 +491,7 @@ async def fake_post_no_data(*args, **kwargs): assert await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done() - assert fake_post_hits == 11 + assert fake_post_hits == 8 async def test_camera_image_raises_exception( diff --git a/tests/components/netatmo/test_init.py b/tests/components/netatmo/test_init.py index c6146dca339550..e04295ae6684be 100644 --- a/tests/components/netatmo/test_init.py +++ b/tests/components/netatmo/test_init.py @@ -201,7 +201,7 @@ async def test_setup_with_cloud(hass: HomeAssistant, config_entry) -> None: ) as fake_delete_cloudhook, patch( "homeassistant.components.netatmo.api.AsyncConfigEntryNetatmoAuth" ) as mock_auth, patch( - "homeassistant.components.netatmo.PLATFORMS", [] + "homeassistant.components.netatmo.data_handler.PLATFORMS", [] ), patch( "homeassistant.helpers.config_entry_oauth2_flow.async_get_config_entry_implementation", ), patch( @@ -267,7 +267,7 @@ async def test_setup_with_cloudhook(hass: HomeAssistant) -> None: ) as fake_delete_cloudhook, patch( "homeassistant.components.netatmo.api.AsyncConfigEntryNetatmoAuth" ) as mock_auth, patch( - "homeassistant.components.netatmo.PLATFORMS", [] + "homeassistant.components.netatmo.data_handler.PLATFORMS", [] ), patch( "homeassistant.helpers.config_entry_oauth2_flow.async_get_config_entry_implementation", ), patch( diff --git a/tests/components/netatmo/test_light.py b/tests/components/netatmo/test_light.py index 5a875097636433..83218b6d6d1f57 100644 --- a/tests/components/netatmo/test_light.py +++ b/tests/components/netatmo/test_light.py @@ -99,7 +99,7 @@ async def fake_post_request_no_data(*args, **kwargs): with patch( "homeassistant.components.netatmo.api.AsyncConfigEntryNetatmoAuth" ) as mock_auth, patch( - "homeassistant.components.netatmo.PLATFORMS", ["light"] + "homeassistant.components.netatmo.data_handler.PLATFORMS", ["light"] ), patch( "homeassistant.helpers.config_entry_oauth2_flow.async_get_config_entry_implementation", ), patch( @@ -120,7 +120,7 @@ async def fake_post_request_no_data(*args, **kwargs): ) await hass.async_block_till_done() - assert fake_post_hits == 4 + assert fake_post_hits == 3 assert hass.config_entries.async_entries(DOMAIN) assert len(hass.states.async_all()) == 0