mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-11-29 13:15:10 +01:00
Add coverage for send_home_assistant_state (#739)
This commit is contained in:
parent
f15acf1b1a
commit
108074a2dc
@ -40,6 +40,7 @@ from aioesphomeapi.api_pb2 import (
|
||||
ExecuteServiceRequest,
|
||||
FanCommandRequest,
|
||||
HomeassistantServiceResponse,
|
||||
HomeAssistantStateResponse,
|
||||
LightCommandRequest,
|
||||
ListEntitiesBinarySensorResponse,
|
||||
ListEntitiesDoneResponse,
|
||||
@ -1384,6 +1385,17 @@ async def test_subscribe_logs(auth_client: APIClient) -> None:
|
||||
on_logs.assert_called_with(log_msg)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_send_home_assistant_state(auth_client: APIClient) -> None:
|
||||
send = patch_send(auth_client)
|
||||
await auth_client.send_home_assistant_state("binary_sensor.bla", None, "on")
|
||||
send.assert_called_once_with(
|
||||
HomeAssistantStateResponse(
|
||||
entity_id="binary_sensor.bla", state="on", attribute=None
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_subscribe_service_calls(auth_client: APIClient) -> None:
|
||||
send = patch_response_callback(auth_client)
|
||||
|
Loading…
Reference in New Issue
Block a user