mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Fix motionblinds ble test (#123990)
* Fix motionblinds ble test * Fix motionblinds ble test
This commit is contained in:
parent
a50aeb0a66
commit
874ae15d6a
@ -28,10 +28,10 @@ from tests.common import MockConfigEntry
|
||||
],
|
||||
)
|
||||
async def test_button(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
mock_motion_device: Mock,
|
||||
name: str,
|
||||
hass: HomeAssistant,
|
||||
button: str,
|
||||
) -> None:
|
||||
"""Test states of the button."""
|
||||
|
@ -31,6 +31,7 @@ from . import setup_integration
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("motionblinds_ble_connect")
|
||||
@pytest.mark.parametrize("blind_type", [MotionBlindType.VENETIAN])
|
||||
@pytest.mark.parametrize(
|
||||
("service", "method", "kwargs"),
|
||||
@ -46,10 +47,10 @@ from tests.common import MockConfigEntry
|
||||
],
|
||||
)
|
||||
async def test_cover_service(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
mock_motion_device: Mock,
|
||||
name: str,
|
||||
hass: HomeAssistant,
|
||||
service: str,
|
||||
method: str,
|
||||
kwargs: dict[str, Any],
|
||||
@ -67,6 +68,7 @@ async def test_cover_service(
|
||||
getattr(mock_motion_device, method).assert_called_once()
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("motionblinds_ble_connect")
|
||||
@pytest.mark.parametrize(
|
||||
("running_type", "state"),
|
||||
[
|
||||
@ -77,10 +79,10 @@ async def test_cover_service(
|
||||
],
|
||||
)
|
||||
async def test_cover_update_running(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
mock_motion_device: Mock,
|
||||
name: str,
|
||||
hass: HomeAssistant,
|
||||
running_type: str | None,
|
||||
state: str,
|
||||
) -> None:
|
||||
@ -94,6 +96,7 @@ async def test_cover_update_running(
|
||||
assert hass.states.get(f"cover.{name}").state == state
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("motionblinds_ble_connect")
|
||||
@pytest.mark.parametrize(
|
||||
("position", "tilt", "state"),
|
||||
[
|
||||
@ -104,10 +107,10 @@ async def test_cover_update_running(
|
||||
],
|
||||
)
|
||||
async def test_cover_update_position(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
mock_motion_device: Mock,
|
||||
name: str,
|
||||
hass: HomeAssistant,
|
||||
position: int,
|
||||
tilt: int,
|
||||
state: str,
|
||||
|
@ -33,10 +33,10 @@ from tests.common import MockConfigEntry
|
||||
],
|
||||
)
|
||||
async def test_entity_update(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
mock_motion_device: Mock,
|
||||
name: str,
|
||||
hass: HomeAssistant,
|
||||
platform: Platform,
|
||||
entity: str,
|
||||
) -> None:
|
||||
|
@ -13,7 +13,8 @@ from tests.components.bluetooth import inject_bluetooth_service_info
|
||||
|
||||
|
||||
async def test_options_update_listener(
|
||||
mock_config_entry: MockConfigEntry, hass: HomeAssistant
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
) -> None:
|
||||
"""Test options_update_listener."""
|
||||
|
||||
@ -33,8 +34,8 @@ async def test_options_update_listener(
|
||||
|
||||
|
||||
async def test_update_ble_device(
|
||||
mock_config_entry: MockConfigEntry,
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
service_info: BluetoothServiceInfoBleak,
|
||||
) -> None:
|
||||
"""Test async_update_ble_device."""
|
||||
|
@ -24,10 +24,10 @@ from tests.common import MockConfigEntry
|
||||
|
||||
@pytest.mark.parametrize(("select", "args"), [(ATTR_SPEED, MotionSpeedLevel.HIGH)])
|
||||
async def test_select(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
mock_motion_device: Mock,
|
||||
name: str,
|
||||
hass: HomeAssistant,
|
||||
select: str,
|
||||
args: Any,
|
||||
) -> None:
|
||||
@ -58,10 +58,10 @@ async def test_select(
|
||||
],
|
||||
)
|
||||
async def test_select_update(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
mock_motion_device: Mock,
|
||||
name: str,
|
||||
hass: HomeAssistant,
|
||||
select: str,
|
||||
register_callback: Callable[[MotionDevice], Callable[..., None]],
|
||||
value: type[Enum],
|
||||
|
@ -87,10 +87,10 @@ from tests.common import MockConfigEntry
|
||||
],
|
||||
)
|
||||
async def test_sensor(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
mock_motion_device: Mock,
|
||||
name: str,
|
||||
hass: HomeAssistant,
|
||||
sensor: str,
|
||||
register_callback: Callable[[MotionDevice], Callable[..., None]],
|
||||
initial_value: str,
|
||||
|
Loading…
x
Reference in New Issue
Block a user