mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add type hints to integration tests (b-c) (#87698)
This commit is contained in:
@@ -4,6 +4,7 @@ from datetime import timedelta
|
||||
from homeassistant.components.broadlink.const import DOMAIN
|
||||
from homeassistant.components.broadlink.updater import BroadlinkSP4UpdateManager
|
||||
from homeassistant.const import ATTR_FRIENDLY_NAME, Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_component import async_update_entity
|
||||
from homeassistant.helpers.entity_registry import async_entries_for_device
|
||||
from homeassistant.util import dt
|
||||
@@ -13,7 +14,7 @@ from . import get_device
|
||||
from tests.common import async_fire_time_changed, mock_device_registry, mock_registry
|
||||
|
||||
|
||||
async def test_a1_sensor_setup(hass):
|
||||
async def test_a1_sensor_setup(hass: HomeAssistant) -> None:
|
||||
"""Test a successful e-Sensor setup."""
|
||||
device = get_device("Bedroom")
|
||||
mock_api = device.get_mock_api()
|
||||
@@ -54,7 +55,7 @@ async def test_a1_sensor_setup(hass):
|
||||
}
|
||||
|
||||
|
||||
async def test_a1_sensor_update(hass):
|
||||
async def test_a1_sensor_update(hass: HomeAssistant) -> None:
|
||||
"""Test a successful e-Sensor update."""
|
||||
device = get_device("Bedroom")
|
||||
mock_api = device.get_mock_api()
|
||||
@@ -104,7 +105,7 @@ async def test_a1_sensor_update(hass):
|
||||
}
|
||||
|
||||
|
||||
async def test_rm_pro_sensor_setup(hass):
|
||||
async def test_rm_pro_sensor_setup(hass: HomeAssistant) -> None:
|
||||
"""Test a successful RM pro sensor setup."""
|
||||
device = get_device("Office")
|
||||
mock_api = device.get_mock_api()
|
||||
@@ -133,7 +134,7 @@ async def test_rm_pro_sensor_setup(hass):
|
||||
assert sensors_and_states == {(f"{device.name} Temperature", "18.2")}
|
||||
|
||||
|
||||
async def test_rm_pro_sensor_update(hass):
|
||||
async def test_rm_pro_sensor_update(hass: HomeAssistant) -> None:
|
||||
"""Test a successful RM pro sensor update."""
|
||||
device = get_device("Office")
|
||||
mock_api = device.get_mock_api()
|
||||
@@ -165,7 +166,7 @@ async def test_rm_pro_sensor_update(hass):
|
||||
assert sensors_and_states == {(f"{device.name} Temperature", "25.8")}
|
||||
|
||||
|
||||
async def test_rm_pro_filter_crazy_temperature(hass):
|
||||
async def test_rm_pro_filter_crazy_temperature(hass: HomeAssistant) -> None:
|
||||
"""Test we filter a crazy temperature variation.
|
||||
|
||||
Firmware issue. See https://github.com/home-assistant/core/issues/42100.
|
||||
@@ -200,7 +201,7 @@ async def test_rm_pro_filter_crazy_temperature(hass):
|
||||
assert sensors_and_states == {(f"{device.name} Temperature", "22.9")}
|
||||
|
||||
|
||||
async def test_rm_mini3_no_sensor(hass):
|
||||
async def test_rm_mini3_no_sensor(hass: HomeAssistant) -> None:
|
||||
"""Test we do not set up sensors for RM mini 3."""
|
||||
device = get_device("Entrance")
|
||||
mock_api = device.get_mock_api()
|
||||
@@ -220,7 +221,7 @@ async def test_rm_mini3_no_sensor(hass):
|
||||
assert len(sensors) == 0
|
||||
|
||||
|
||||
async def test_rm4_pro_hts2_sensor_setup(hass):
|
||||
async def test_rm4_pro_hts2_sensor_setup(hass: HomeAssistant) -> None:
|
||||
"""Test a successful RM4 pro sensor setup with HTS2 cable."""
|
||||
device = get_device("Garage")
|
||||
mock_api = device.get_mock_api()
|
||||
@@ -252,7 +253,7 @@ async def test_rm4_pro_hts2_sensor_setup(hass):
|
||||
}
|
||||
|
||||
|
||||
async def test_rm4_pro_hts2_sensor_update(hass):
|
||||
async def test_rm4_pro_hts2_sensor_update(hass: HomeAssistant) -> None:
|
||||
"""Test a successful RM4 pro sensor update with HTS2 cable."""
|
||||
device = get_device("Garage")
|
||||
mock_api = device.get_mock_api()
|
||||
@@ -287,7 +288,7 @@ async def test_rm4_pro_hts2_sensor_update(hass):
|
||||
}
|
||||
|
||||
|
||||
async def test_rm4_pro_no_sensor(hass):
|
||||
async def test_rm4_pro_no_sensor(hass: HomeAssistant) -> None:
|
||||
"""Test we do not set up sensors for RM4 pro without HTS2 cable."""
|
||||
device = get_device("Garage")
|
||||
mock_api = device.get_mock_api()
|
||||
@@ -307,7 +308,7 @@ async def test_rm4_pro_no_sensor(hass):
|
||||
assert len(sensors) == 0
|
||||
|
||||
|
||||
async def test_scb1e_sensor_setup(hass):
|
||||
async def test_scb1e_sensor_setup(hass: HomeAssistant) -> None:
|
||||
"""Test a successful SCB1E sensor setup."""
|
||||
device = get_device("Dining room")
|
||||
mock_api = device.get_mock_api()
|
||||
@@ -352,7 +353,7 @@ async def test_scb1e_sensor_setup(hass):
|
||||
}
|
||||
|
||||
|
||||
async def test_scb1e_sensor_update(hass):
|
||||
async def test_scb1e_sensor_update(hass: HomeAssistant) -> None:
|
||||
"""Test a successful SCB1E sensor update."""
|
||||
device = get_device("Dining room")
|
||||
mock_api = device.get_mock_api()
|
||||
|
||||
Reference in New Issue
Block a user