Add room management settings
This commit is contained in:
@@ -623,6 +623,25 @@ def test_dashboard_system_and_start_do_not_materialize_entity_cache(
|
||||
assert start_response.json()["actuators"][0]["friendly_name"] == "Abstellkammer Licht"
|
||||
|
||||
|
||||
def test_room_management_overview_groups_actuators_with_sensors_and_rules(tmp_path: Path) -> None:
|
||||
with TestClient(app) as client:
|
||||
_install_service(tmp_path)
|
||||
client.post("/v1/actuators", json={"actuator_entity_id": "light.abstellkammer"})
|
||||
|
||||
response = client.get("/v1/actuators/settings/rooms")
|
||||
|
||||
assert response.status_code == 200
|
||||
payload = response.json()
|
||||
room = payload["rooms"][0]
|
||||
assert room["room"] == "Abstellkammer"
|
||||
assert room["actuator_count"] == 1
|
||||
actuator = room["actuators"][0]
|
||||
assert actuator["actuator_entity_id"] == "light.abstellkammer"
|
||||
assert actuator["sensors"]
|
||||
assert actuator["prediction_rules"]
|
||||
assert any(sensor["entity_id"] == "binary_sensor.abstellkammer_motion" for sensor in room["sensors"])
|
||||
|
||||
|
||||
def test_actuator_detail_uses_compact_payload(tmp_path: Path) -> None:
|
||||
with TestClient(app) as client:
|
||||
_install_service(tmp_path)
|
||||
|
||||
Reference in New Issue
Block a user