diff --git a/tests/components/wallbox/__init__.py b/tests/components/wallbox/__init__.py index fe9aa1ef3d66..8a31d2ebcd55 100644 --- a/tests/components/wallbox/__init__.py +++ b/tests/components/wallbox/__init__.py @@ -23,6 +23,7 @@ from homeassistant.components.wallbox.const import ( DOMAIN, ) from homeassistant.const import CONF_PASSWORD, CONF_USERNAME +from homeassistant.core import HomeAssistant from .const import CONF_ERROR, CONF_JWT, CONF_STATUS, CONF_TTL, CONF_USER_ID @@ -71,7 +72,7 @@ entry = MockConfigEntry( ) -async def setup_integration(hass): +async def setup_integration(hass: HomeAssistant) -> None: """Test wallbox sensor class setup.""" entry.add_to_hass(hass) @@ -99,7 +100,7 @@ async def setup_integration(hass): await hass.async_block_till_done() -async def setup_integration_connection_error(hass): +async def setup_integration_connection_error(hass: HomeAssistant) -> None: """Test wallbox sensor class setup with a connection error.""" with requests_mock.Mocker() as mock_request: @@ -125,7 +126,7 @@ async def setup_integration_connection_error(hass): await hass.async_block_till_done() -async def setup_integration_read_only(hass): +async def setup_integration_read_only(hass: HomeAssistant) -> None: """Test wallbox sensor class setup for read only.""" with requests_mock.Mocker() as mock_request: diff --git a/tests/components/wallbox/test_config_flow.py b/tests/components/wallbox/test_config_flow.py index 01993d889681..93f3fe77e103 100644 --- a/tests/components/wallbox/test_config_flow.py +++ b/tests/components/wallbox/test_config_flow.py @@ -75,7 +75,7 @@ async def test_show_set_form(hass: HomeAssistant) -> None: assert result["step_id"] == "user" -async def test_form_cannot_authenticate(hass): +async def test_form_cannot_authenticate(hass: HomeAssistant) -> None: """Test we handle cannot connect error.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} @@ -105,7 +105,7 @@ async def test_form_cannot_authenticate(hass): assert result2["errors"] == {"base": "invalid_auth"} -async def test_form_cannot_connect(hass): +async def test_form_cannot_connect(hass: HomeAssistant) -> None: """Test we handle cannot connect error.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} @@ -135,7 +135,7 @@ async def test_form_cannot_connect(hass): assert result2["errors"] == {"base": "cannot_connect"} -async def test_form_validate_input(hass): +async def test_form_validate_input(hass: HomeAssistant) -> None: """Test we can validate input.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} @@ -165,7 +165,7 @@ async def test_form_validate_input(hass): assert result2["data"]["station"] == "12345" -async def test_form_reauth(hass): +async def test_form_reauth(hass: HomeAssistant) -> None: """Test we handle reauth flow.""" await setup_integration(hass) assert entry.state == config_entries.ConfigEntryState.LOADED @@ -205,7 +205,7 @@ async def test_form_reauth(hass): await hass.config_entries.async_unload(entry.entry_id) -async def test_form_reauth_invalid(hass): +async def test_form_reauth_invalid(hass: HomeAssistant) -> None: """Test we handle reauth invalid flow.""" await setup_integration(hass) assert entry.state == config_entries.ConfigEntryState.LOADED diff --git a/tests/components/wallbox/test_init.py b/tests/components/wallbox/test_init.py index 66f0701e42ec..79e6871faca8 100644 --- a/tests/components/wallbox/test_init.py +++ b/tests/components/wallbox/test_init.py @@ -37,7 +37,7 @@ authorisation_response = json.loads( ) -async def test_wallbox_setup_unload_entry(hass: HomeAssistant): +async def test_wallbox_setup_unload_entry(hass: HomeAssistant) -> None: """Test Wallbox Unload.""" await setup_integration(hass) @@ -47,7 +47,7 @@ async def test_wallbox_setup_unload_entry(hass: HomeAssistant): assert entry.state == ConfigEntryState.NOT_LOADED -async def test_wallbox_unload_entry_connection_error(hass: HomeAssistant): +async def test_wallbox_unload_entry_connection_error(hass: HomeAssistant) -> None: """Test Wallbox Unload Connection Error.""" await setup_integration_connection_error(hass) @@ -57,7 +57,7 @@ async def test_wallbox_unload_entry_connection_error(hass: HomeAssistant): assert entry.state == ConfigEntryState.NOT_LOADED -async def test_wallbox_refresh_failed_invalid_auth(hass: HomeAssistant): +async def test_wallbox_refresh_failed_invalid_auth(hass: HomeAssistant) -> None: """Test Wallbox setup with authentication error.""" await setup_integration(hass) @@ -83,7 +83,7 @@ async def test_wallbox_refresh_failed_invalid_auth(hass: HomeAssistant): assert entry.state == ConfigEntryState.NOT_LOADED -async def test_wallbox_refresh_failed_connection_error(hass: HomeAssistant): +async def test_wallbox_refresh_failed_connection_error(hass: HomeAssistant) -> None: """Test Wallbox setup with connection error.""" await setup_integration(hass) @@ -109,7 +109,7 @@ async def test_wallbox_refresh_failed_connection_error(hass: HomeAssistant): assert entry.state == ConfigEntryState.NOT_LOADED -async def test_wallbox_refresh_failed_read_only(hass: HomeAssistant): +async def test_wallbox_refresh_failed_read_only(hass: HomeAssistant) -> None: """Test Wallbox setup for read-only user.""" await setup_integration_read_only(hass) diff --git a/tests/components/wallbox/test_lock.py b/tests/components/wallbox/test_lock.py index 7e24f997825f..4ea9132c6752 100644 --- a/tests/components/wallbox/test_lock.py +++ b/tests/components/wallbox/test_lock.py @@ -36,7 +36,7 @@ authorisation_response = json.loads( ) -async def test_wallbox_lock_class(hass: HomeAssistant): +async def test_wallbox_lock_class(hass: HomeAssistant) -> None: """Test wallbox lock class.""" await setup_integration(hass) @@ -78,7 +78,7 @@ async def test_wallbox_lock_class(hass: HomeAssistant): await hass.config_entries.async_unload(entry.entry_id) -async def test_wallbox_lock_class_connection_error(hass: HomeAssistant): +async def test_wallbox_lock_class_connection_error(hass: HomeAssistant) -> None: """Test wallbox lock class connection error.""" await setup_integration(hass) @@ -117,7 +117,7 @@ async def test_wallbox_lock_class_connection_error(hass: HomeAssistant): await hass.config_entries.async_unload(entry.entry_id) -async def test_wallbox_lock_class_authentication_error(hass: HomeAssistant): +async def test_wallbox_lock_class_authentication_error(hass: HomeAssistant) -> None: """Test wallbox lock not loaded on authentication error.""" await setup_integration_read_only(hass) diff --git a/tests/components/wallbox/test_number.py b/tests/components/wallbox/test_number.py index 989cb1b3c31a..e247aa59ece3 100644 --- a/tests/components/wallbox/test_number.py +++ b/tests/components/wallbox/test_number.py @@ -7,6 +7,7 @@ import requests_mock from homeassistant.components.input_number import ATTR_VALUE, SERVICE_SET_VALUE from homeassistant.components.wallbox import CONF_MAX_CHARGING_CURRENT_KEY from homeassistant.const import ATTR_ENTITY_ID +from homeassistant.core import HomeAssistant from tests.components.wallbox import entry, setup_integration from tests.components.wallbox.const import ( @@ -31,7 +32,7 @@ authorisation_response = json.loads( ) -async def test_wallbox_number_class(hass): +async def test_wallbox_number_class(hass: HomeAssistant) -> None: """Test wallbox sensor class.""" await setup_integration(hass) @@ -60,7 +61,7 @@ async def test_wallbox_number_class(hass): await hass.config_entries.async_unload(entry.entry_id) -async def test_wallbox_number_class_connection_error(hass): +async def test_wallbox_number_class_connection_error(hass: HomeAssistant) -> None: """Test wallbox sensor class.""" await setup_integration(hass) diff --git a/tests/components/wallbox/test_sensor.py b/tests/components/wallbox/test_sensor.py index 2551eed6a2ef..360040e1c2b6 100644 --- a/tests/components/wallbox/test_sensor.py +++ b/tests/components/wallbox/test_sensor.py @@ -1,5 +1,6 @@ """Test Wallbox Switch component.""" from homeassistant.const import CONF_ICON, CONF_UNIT_OF_MEASUREMENT, POWER_KILO_WATT +from homeassistant.core import HomeAssistant from tests.components.wallbox import entry, setup_integration from tests.components.wallbox.const import ( @@ -9,7 +10,7 @@ from tests.components.wallbox.const import ( ) -async def test_wallbox_sensor_class(hass): +async def test_wallbox_sensor_class(hass: HomeAssistant) -> None: """Test wallbox sensor class.""" await setup_integration(hass)