diff --git a/tests/components/alarm_control_panel/__init__.py b/tests/components/alarm_control_panel/__init__.py index 1f43c567844..afaae8f1c70 100644 --- a/tests/components/alarm_control_panel/__init__.py +++ b/tests/components/alarm_control_panel/__init__.py @@ -1,8 +1,5 @@ """The tests for Alarm control panel platforms.""" -from homeassistant.components.alarm_control_panel import ( - DOMAIN as ALARM_CONTROL_PANEL_DOMAIN, -) from homeassistant.config_entries import ConfigEntry from homeassistant.const import Platform from homeassistant.core import HomeAssistant @@ -13,7 +10,7 @@ async def help_async_setup_entry_init( ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [ALARM_CONTROL_PANEL_DOMAIN] + config_entry, [Platform.ALARM_CONTROL_PANEL] ) return True diff --git a/tests/components/alarm_control_panel/conftest.py b/tests/components/alarm_control_panel/conftest.py index 541644def38..fd8fd6fc88e 100644 --- a/tests/components/alarm_control_panel/conftest.py +++ b/tests/components/alarm_control_panel/conftest.py @@ -12,6 +12,7 @@ from homeassistant.components.alarm_control_panel import ( ) from homeassistant.components.alarm_control_panel.const import CodeFormat from homeassistant.config_entries import ConfigEntry, ConfigFlow +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er, frame from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -172,7 +173,7 @@ async def setup_alarm_control_panel_platform_test_entity( ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [ALARM_CONTROL_PANEL_DOMAIN] + config_entry, [Platform.ALARM_CONTROL_PANEL] ) return True diff --git a/tests/components/assist_pipeline/test_select.py b/tests/components/assist_pipeline/test_select.py index fec34cb2496..c1577b4beaf 100644 --- a/tests/components/assist_pipeline/test_select.py +++ b/tests/components/assist_pipeline/test_select.py @@ -16,6 +16,7 @@ from homeassistant.components.assist_pipeline.select import ( ) from homeassistant.components.assist_pipeline.vad import VadSensitivity from homeassistant.config_entries import ConfigEntry, ConfigEntryState +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr from homeassistant.helpers.device_registry import DeviceInfo @@ -53,7 +54,9 @@ async def init_select(hass: HomeAssistant, init_components) -> ConfigEntry: domain="assist_pipeline", state=ConfigEntryState.LOADED ) config_entry.add_to_hass(hass) - await hass.config_entries.async_forward_entry_setups(config_entry, ["select"]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.SELECT] + ) return config_entry @@ -160,8 +163,12 @@ async def test_select_entity_changing_pipelines( assert state.state == pipeline_2.name # Reload config entry to test selected option persists - assert await hass.config_entries.async_forward_entry_unload(config_entry, "select") - await hass.config_entries.async_forward_entry_setups(config_entry, ["select"]) + assert await hass.config_entries.async_forward_entry_unload( + config_entry, Platform.SELECT + ) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.SELECT] + ) state = hass.states.get("select.assist_pipeline_test_prefix_pipeline") assert state is not None @@ -208,8 +215,12 @@ async def test_select_entity_changing_vad_sensitivity( assert state.state == VadSensitivity.AGGRESSIVE.value # Reload config entry to test selected option persists - assert await hass.config_entries.async_forward_entry_unload(config_entry, "select") - await hass.config_entries.async_forward_entry_setups(config_entry, ["select"]) + assert await hass.config_entries.async_forward_entry_unload( + config_entry, Platform.SELECT + ) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.SELECT] + ) state = hass.states.get("select.assist_pipeline_test_vad_sensitivity") assert state is not None diff --git a/tests/components/assist_satellite/conftest.py b/tests/components/assist_satellite/conftest.py index 79e4061bacc..e2a43b708f5 100644 --- a/tests/components/assist_satellite/conftest.py +++ b/tests/components/assist_satellite/conftest.py @@ -15,6 +15,7 @@ from homeassistant.components.assist_satellite import ( AssistSatelliteWakeWord, ) from homeassistant.config_entries import ConfigEntry, ConfigFlow +from homeassistant.const import Platform from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity import DeviceInfo from homeassistant.setup import async_setup_component @@ -144,14 +145,18 @@ async def init_components( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [AS_DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.ASSIST_SATELLITE] + ) return True async def async_unload_entry_init( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Unload test config entry.""" - await hass.config_entries.async_forward_entry_unload(config_entry, AS_DOMAIN) + await hass.config_entries.async_forward_entry_unload( + config_entry, Platform.ASSIST_SATELLITE + ) return True mock_integration( diff --git a/tests/components/binary_sensor/test_init.py b/tests/components/binary_sensor/test_init.py index de2b2565fe1..212cfd737d0 100644 --- a/tests/components/binary_sensor/test_init.py +++ b/tests/components/binary_sensor/test_init.py @@ -7,7 +7,7 @@ import pytest from homeassistant.components import binary_sensor from homeassistant.config_entries import ConfigEntry, ConfigFlow -from homeassistant.const import STATE_OFF, STATE_ON, EntityCategory +from homeassistant.const import STATE_OFF, STATE_ON, EntityCategory, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -62,7 +62,7 @@ async def test_name(hass: HomeAssistant) -> None: ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [binary_sensor.DOMAIN] + config_entry, [Platform.BINARY_SENSOR] ) return True @@ -142,7 +142,7 @@ async def test_entity_category_config_raises_error( ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [binary_sensor.DOMAIN] + config_entry, [Platform.BINARY_SENSOR] ) return True diff --git a/tests/components/button/test_init.py b/tests/components/button/test_init.py index 783fd786a50..f1c730a41b3 100644 --- a/tests/components/button/test_init.py +++ b/tests/components/button/test_init.py @@ -20,6 +20,7 @@ from homeassistant.const import ( CONF_PLATFORM, STATE_UNAVAILABLE, STATE_UNKNOWN, + Platform, ) from homeassistant.core import HomeAssistant, State from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -136,7 +137,9 @@ async def test_name(hass: HomeAssistant) -> None: hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.BUTTON] + ) return True mock_platform(hass, f"{TEST_DOMAIN}.config_flow") diff --git a/tests/components/calendar/conftest.py b/tests/components/calendar/conftest.py index 5bf061591ee..ed21f1336c8 100644 --- a/tests/components/calendar/conftest.py +++ b/tests/components/calendar/conftest.py @@ -120,7 +120,9 @@ def mock_setup_integration( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.CALENDAR] + ) return True async def async_unload_entry_init( diff --git a/tests/components/camera/conftest.py b/tests/components/camera/conftest.py index dcc02cf99fe..5e95bbd6fbe 100644 --- a/tests/components/camera/conftest.py +++ b/tests/components/camera/conftest.py @@ -201,7 +201,7 @@ async def mock_test_webrtc_cameras(hass: HomeAssistant) -> None: ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [camera.DOMAIN] + config_entry, [Platform.CAMERA] ) return True @@ -210,7 +210,7 @@ async def mock_test_webrtc_cameras(hass: HomeAssistant) -> None: ) -> bool: """Unload test config entry.""" await hass.config_entries.async_forward_entry_unload( - config_entry, camera.DOMAIN + config_entry, Platform.CAMERA ) return True diff --git a/tests/components/climate/conftest.py b/tests/components/climate/conftest.py index 4ade8606e77..678a1070a2f 100644 --- a/tests/components/climate/conftest.py +++ b/tests/components/climate/conftest.py @@ -4,7 +4,6 @@ from collections.abc import Generator import pytest -from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN from homeassistant.config_entries import ConfigEntry, ConfigFlow from homeassistant.const import Platform from homeassistant.core import HomeAssistant @@ -45,7 +44,7 @@ def register_test_integration( ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [CLIMATE_DOMAIN] + config_entry, [Platform.CLIMATE] ) return True diff --git a/tests/components/climate/test_intent.py b/tests/components/climate/test_intent.py index 4ce06199eb8..c992480cae7 100644 --- a/tests/components/climate/test_intent.py +++ b/tests/components/climate/test_intent.py @@ -59,7 +59,9 @@ def mock_setup_integration(hass: HomeAssistant) -> None: hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.CLIMATE] + ) return True async def async_unload_entry_init( diff --git a/tests/components/event/test_init.py b/tests/components/event/test_init.py index bc43a234ffc..0cd1f39228f 100644 --- a/tests/components/event/test_init.py +++ b/tests/components/event/test_init.py @@ -15,7 +15,7 @@ from homeassistant.components.event import ( EventEntityDescription, ) from homeassistant.config_entries import ConfigEntry, ConfigFlow -from homeassistant.const import CONF_PLATFORM, STATE_UNKNOWN +from homeassistant.const import CONF_PLATFORM, STATE_UNKNOWN, Platform from homeassistant.core import HomeAssistant, State from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.helpers.restore_state import STORAGE_KEY as RESTORE_STATE_KEY @@ -254,7 +254,9 @@ async def test_name(hass: HomeAssistant) -> None: hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.EVENT] + ) return True mock_platform(hass, f"{TEST_DOMAIN}.config_flow") diff --git a/tests/components/go2rtc/test_init.py b/tests/components/go2rtc/test_init.py index 38ff82fc9c8..3fca0d27b6b 100644 --- a/tests/components/go2rtc/test_init.py +++ b/tests/components/go2rtc/test_init.py @@ -40,7 +40,7 @@ from homeassistant.components.go2rtc.const import ( RECOMMENDED_VERSION, ) from homeassistant.config_entries import ConfigEntry, ConfigEntryState, ConfigFlow -from homeassistant.const import CONF_URL +from homeassistant.const import CONF_URL, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import issue_registry as ir from homeassistant.helpers.typing import ConfigType @@ -166,7 +166,7 @@ async def init_test_integration( ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [CAMERA_DOMAIN] + config_entry, [Platform.CAMERA] ) return True @@ -175,7 +175,7 @@ async def init_test_integration( ) -> bool: """Unload test config entry.""" await hass.config_entries.async_forward_entry_unload( - config_entry, CAMERA_DOMAIN + config_entry, Platform.CAMERA ) return True diff --git a/tests/components/homeassistant_hardware/test_update.py b/tests/components/homeassistant_hardware/test_update.py index 23d1e546791..81c6f2e0459 100644 --- a/tests/components/homeassistant_hardware/test_update.py +++ b/tests/components/homeassistant_hardware/test_update.py @@ -32,7 +32,7 @@ from homeassistant.components.homeassistant_hardware.util import ( ) from homeassistant.components.update import UpdateDeviceClass from homeassistant.config_entries import ConfigEntry, ConfigEntryState, ConfigFlow -from homeassistant.const import EVENT_STATE_CHANGED, EntityCategory +from homeassistant.const import EVENT_STATE_CHANGED, EntityCategory, Platform from homeassistant.core import ( Event, EventStateChangedData, @@ -173,7 +173,9 @@ async def mock_async_setup_entry( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, ["update"]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.UPDATE] + ) return True diff --git a/tests/components/humidifier/conftest.py b/tests/components/humidifier/conftest.py index 9fe1720ffc0..c03f9faf87e 100644 --- a/tests/components/humidifier/conftest.py +++ b/tests/components/humidifier/conftest.py @@ -4,7 +4,6 @@ from collections.abc import Generator import pytest -from homeassistant.components.humidifier import DOMAIN as HUMIDIFIER_DOMAIN from homeassistant.config_entries import ConfigEntry, ConfigFlow from homeassistant.const import Platform from homeassistant.core import HomeAssistant @@ -45,7 +44,7 @@ def register_test_integration( ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [HUMIDIFIER_DOMAIN] + config_entry, [Platform.HUMIDIFIER] ) return True diff --git a/tests/components/image/conftest.py b/tests/components/image/conftest.py index 6879bc793bb..0e8b79e751d 100644 --- a/tests/components/image/conftest.py +++ b/tests/components/image/conftest.py @@ -6,6 +6,7 @@ import pytest from homeassistant.components import image from homeassistant.config_entries import ConfigEntry, ConfigFlow +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import ( AddConfigEntryEntitiesCallback, @@ -176,7 +177,7 @@ async def mock_image_config_entry_fixture( ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [image.DOMAIN] + config_entry, [Platform.IMAGE] ) return True @@ -184,7 +185,7 @@ async def mock_image_config_entry_fixture( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Unload test config entry.""" - await hass.config_entries.async_unload_platforms(config_entry, [image.DOMAIN]) + await hass.config_entries.async_unload_platforms(config_entry, [Platform.IMAGE]) return True mock_integration( diff --git a/tests/components/intent/test_temperature.py b/tests/components/intent/test_temperature.py index 622e55fe24a..5cd5fd1a6c3 100644 --- a/tests/components/intent/test_temperature.py +++ b/tests/components/intent/test_temperature.py @@ -61,7 +61,7 @@ def mock_setup_integration(hass: HomeAssistant) -> None: ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [CLIMATE_DOMAIN] + config_entry, [Platform.CLIMATE] ) return True diff --git a/tests/components/lock/conftest.py b/tests/components/lock/conftest.py index 254a59cae0d..9cfde2a6b06 100644 --- a/tests/components/lock/conftest.py +++ b/tests/components/lock/conftest.py @@ -12,6 +12,7 @@ from homeassistant.components.lock import ( LockEntityFeature, ) from homeassistant.config_entries import ConfigEntry, ConfigFlow +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -99,7 +100,7 @@ async def setup_lock_platform_test_entity( ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [LOCK_DOMAIN] + config_entry, [Platform.LOCK] ) return True diff --git a/tests/components/mobile_app/test_device_tracker.py b/tests/components/mobile_app/test_device_tracker.py index 92a956ab629..bc744e05f43 100644 --- a/tests/components/mobile_app/test_device_tracker.py +++ b/tests/components/mobile_app/test_device_tracker.py @@ -5,6 +5,7 @@ from typing import Any from aiohttp.test_utils import TestClient +from homeassistant.const import Platform from homeassistant.core import HomeAssistant @@ -110,9 +111,11 @@ async def test_restoring_location( config_entry = hass.config_entries.async_entries("mobile_app")[1] # mobile app doesn't support unloading, so we just reload device tracker - await hass.config_entries.async_forward_entry_unload(config_entry, "device_tracker") + await hass.config_entries.async_forward_entry_unload( + config_entry, Platform.DEVICE_TRACKER + ) await hass.config_entries.async_forward_entry_setups( - config_entry, ["device_tracker"] + config_entry, [Platform.DEVICE_TRACKER] ) await hass.async_block_till_done() diff --git a/tests/components/notify/test_init.py b/tests/components/notify/test_init.py index 0c559ad779f..16a583fdf5c 100644 --- a/tests/components/notify/test_init.py +++ b/tests/components/notify/test_init.py @@ -56,7 +56,9 @@ async def help_async_setup_entry_init( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.NOTIFY] + ) return True diff --git a/tests/components/number/test_init.py b/tests/components/number/test_init.py index 7b19879d873..4ccf8f69c42 100644 --- a/tests/components/number/test_init.py +++ b/tests/components/number/test_init.py @@ -32,6 +32,7 @@ from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_UNIT_OF_MEASUREMENT, CONF_PLATFORM, + Platform, UnitOfTemperature, UnitOfVolumeFlowRate, ) @@ -935,7 +936,9 @@ async def test_name(hass: HomeAssistant) -> None: hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.NUMBER] + ) return True mock_platform(hass, f"{TEST_DOMAIN}.config_flow") diff --git a/tests/components/sensor/test_init.py b/tests/components/sensor/test_init.py index f1d527a2b9b..521c633f94a 100644 --- a/tests/components/sensor/test_init.py +++ b/tests/components/sensor/test_init.py @@ -31,6 +31,7 @@ from homeassistant.const import ( PERCENTAGE, STATE_UNKNOWN, EntityCategory, + Platform, UnitOfApparentPower, UnitOfArea, UnitOfBloodGlucoseConcentration, @@ -2704,7 +2705,7 @@ async def test_name(hass: HomeAssistant) -> None: ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [SENSOR_DOMAIN] + config_entry, [Platform.SENSOR] ) return True diff --git a/tests/components/stt/test_init.py b/tests/components/stt/test_init.py index cada4b0c533..98a4117293e 100644 --- a/tests/components/stt/test_init.py +++ b/tests/components/stt/test_init.py @@ -15,6 +15,7 @@ from homeassistant.components.stt import ( async_get_speech_to_text_engine, ) from homeassistant.config_entries import ConfigEntry, ConfigEntryState, ConfigFlow +from homeassistant.const import Platform from homeassistant.core import HomeAssistant, State from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.setup import async_setup_component @@ -122,14 +123,16 @@ async def mock_config_entry_setup( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.STT] + ) return True async def async_unload_entry_init( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Unload up test config entry.""" - await hass.config_entries.async_forward_entry_unload(config_entry, DOMAIN) + await hass.config_entries.async_forward_entry_unload(config_entry, Platform.STT) return True mock_integration( diff --git a/tests/components/todo/conftest.py b/tests/components/todo/conftest.py index bcee60e1d96..5742f253749 100644 --- a/tests/components/todo/conftest.py +++ b/tests/components/todo/conftest.py @@ -6,7 +6,6 @@ from unittest.mock import AsyncMock import pytest from homeassistant.components.todo import ( - DOMAIN, TodoItem, TodoItemStatus, TodoListEntity, @@ -38,7 +37,9 @@ def mock_setup_integration(hass: HomeAssistant) -> None: hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.TODO] + ) return True async def async_unload_entry_init( diff --git a/tests/components/tts/common.py b/tests/components/tts/common.py index 171334c136a..da960b145d9 100644 --- a/tests/components/tts/common.py +++ b/tests/components/tts/common.py @@ -25,6 +25,7 @@ from homeassistant.components.tts import ( _get_cache_files, ) from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType @@ -230,14 +231,16 @@ async def mock_config_entry_setup( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [TTS_DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.TTS] + ) return True async def async_unload_entry_init( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Unload test config entry.""" - await hass.config_entries.async_forward_entry_unload(config_entry, TTS_DOMAIN) + await hass.config_entries.async_forward_entry_unload(config_entry, Platform.TTS) return True mock_integration( diff --git a/tests/components/update/test_init.py b/tests/components/update/test_init.py index f3eb3f9344c..ef1ee22bb57 100644 --- a/tests/components/update/test_init.py +++ b/tests/components/update/test_init.py @@ -40,6 +40,7 @@ from homeassistant.const import ( STATE_ON, STATE_UNKNOWN, EntityCategory, + Platform, ) from homeassistant.core import HomeAssistant, State, callback from homeassistant.exceptions import HomeAssistantError @@ -818,7 +819,9 @@ async def test_name(hass: HomeAssistant) -> None: hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.UPDATE] + ) return True mock_platform(hass, f"{TEST_DOMAIN}.config_flow") diff --git a/tests/components/vacuum/__init__.py b/tests/components/vacuum/__init__.py index 26e31a87eee..7e27af46bac 100644 --- a/tests/components/vacuum/__init__.py +++ b/tests/components/vacuum/__init__.py @@ -3,7 +3,6 @@ from typing import Any from homeassistant.components.vacuum import ( - DOMAIN, StateVacuumEntity, VacuumActivity, VacuumEntityFeature, @@ -67,7 +66,9 @@ async def help_async_setup_entry_init( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.VACUUM] + ) return True diff --git a/tests/components/vacuum/conftest.py b/tests/components/vacuum/conftest.py index 2c700daece0..5938caa5ce4 100644 --- a/tests/components/vacuum/conftest.py +++ b/tests/components/vacuum/conftest.py @@ -7,6 +7,7 @@ import pytest from homeassistant.components.vacuum import DOMAIN as VACUUM_DOMAIN, VacuumEntityFeature from homeassistant.config_entries import ConfigEntry, ConfigFlow +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er, frame from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -68,7 +69,7 @@ async def setup_vacuum_platform_test_entity( ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [VACUUM_DOMAIN] + config_entry, [Platform.VACUUM] ) return True diff --git a/tests/components/wake_word/test_init.py b/tests/components/wake_word/test_init.py index e6e8ff72a6d..402793be926 100644 --- a/tests/components/wake_word/test_init.py +++ b/tests/components/wake_word/test_init.py @@ -11,7 +11,7 @@ import pytest from homeassistant.components import wake_word from homeassistant.config_entries import ConfigEntry, ConfigEntryState, ConfigFlow -from homeassistant.const import EntityCategory +from homeassistant.const import EntityCategory, Platform from homeassistant.core import HomeAssistant, State from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.setup import async_setup_component @@ -118,7 +118,7 @@ async def mock_config_entry_setup( ) -> bool: """Set up test config entry.""" await hass.config_entries.async_forward_entry_setups( - config_entry, [wake_word.DOMAIN] + config_entry, [Platform.WAKE_WORD] ) return True @@ -127,7 +127,7 @@ async def mock_config_entry_setup( ) -> bool: """Unload up test config entry.""" await hass.config_entries.async_forward_entry_unload( - config_entry, wake_word.DOMAIN + config_entry, Platform.WAKE_WORD ) return True diff --git a/tests/components/water_heater/test_init.py b/tests/components/water_heater/test_init.py index 191acdf24f9..58cb3e364e7 100644 --- a/tests/components/water_heater/test_init.py +++ b/tests/components/water_heater/test_init.py @@ -19,7 +19,7 @@ from homeassistant.components.water_heater import ( WaterHeaterEntityFeature, ) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import UnitOfTemperature +from homeassistant.const import Platform, UnitOfTemperature from homeassistant.core import HomeAssistant from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers import config_validation as cv @@ -139,7 +139,9 @@ async def test_operation_mode_validation( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.WATER_HEATER] + ) return True async def async_setup_entry_water_heater_platform( diff --git a/tests/components/weather/__init__.py b/tests/components/weather/__init__.py index 301e055129d..9585f327fd3 100644 --- a/tests/components/weather/__init__.py +++ b/tests/components/weather/__init__.py @@ -16,10 +16,10 @@ from homeassistant.components.weather import ( ATTR_FORECAST_NATIVE_WIND_SPEED, ATTR_FORECAST_UV_INDEX, ATTR_FORECAST_WIND_BEARING, - DOMAIN, Forecast, ) from homeassistant.config_entries import ConfigEntry +from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -84,7 +84,9 @@ async def create_entity( hass: HomeAssistant, config_entry: ConfigEntry ) -> bool: """Set up test config entry.""" - await hass.config_entries.async_forward_entry_setups(config_entry, [DOMAIN]) + await hass.config_entries.async_forward_entry_setups( + config_entry, [Platform.WEATHER] + ) return True async def async_setup_entry_weather_platform(