ACT-001: actuator-first sensor lifecycle
This commit is contained in:
@@ -88,6 +88,26 @@ def test_get_history_calls_home_assistant_history_api() -> None:
|
||||
assert call.kwargs["params"]["end_time"] == "2026-06-02T00:00:00+00:00"
|
||||
|
||||
|
||||
def test_list_entity_metadata_calls_template_api() -> None:
|
||||
response = _response()
|
||||
response.text = (
|
||||
'[{"entity_id":"sensor.temperature","area_name":"Kueche","device_name":"Thermometer"}]'
|
||||
)
|
||||
client = HaClient(HaClientSettings(url="http://ha.local", token="test-token"))
|
||||
client._session.post = Mock(return_value=response) # type: ignore[method-assign]
|
||||
|
||||
metadata = client.list_entity_metadata(["sensor.temperature"])
|
||||
|
||||
assert metadata == {
|
||||
"sensor.temperature": {
|
||||
"area_id": None,
|
||||
"area_name": "Kueche",
|
||||
"device_id": None,
|
||||
"device_name": "Thermometer",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("entity_ids", "start", "end"),
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user