Filter autopilot actuator candidates

This commit is contained in:
2026-06-18 18:43:53 +02:00
parent 8057751c11
commit bf832b49f4
6 changed files with 46 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ def test_addon_config_declares_future_addon() -> None:
config = yaml.safe_load(Path("addon/config.yaml").read_text(encoding="utf-8"))
assert config["slug"] == "sillyhome_future"
assert config["version"] == "2.0.0-alpha.14"
assert config["version"] == "2.0.0-alpha.15"
assert config["ingress"] is True
assert config["ingress_port"] == 8099
assert config["homeassistant_api"] is True

View File

@@ -19,7 +19,7 @@ def test_health_and_backup_roundtrip(tmp_path, monkeypatch) -> None: # type: ig
restore = client.post("/v2/backup/restore", json=backup.json())
assert health.status_code == 200
assert health.json()["version"] == "2.0.0-alpha.14"
assert health.json()["version"] == "2.0.0-alpha.15"
assert backup.status_code == 200
assert restore.status_code == 200
assert restore.json() == {"status": "restored"}
@@ -47,6 +47,12 @@ def test_dashboard_control_and_learning_endpoints(tmp_path, monkeypatch) -> None
state="off",
area_name="Storage",
),
"switch.storage_motion": EntityState(
entity_id="switch.storage_motion",
domain="switch",
state="off",
area_name="Storage",
),
}
)
)
@@ -162,6 +168,10 @@ def test_dashboard_control_and_learning_endpoints(tmp_path, monkeypatch) -> None
assert evaluations.json()
assert autopilot.status_code == 200
assert autopilot.json()["candidates"]
assert all(
candidate["actuator_entity_id"] != "switch.storage_motion"
for candidate in autopilot.json()["candidates"]
)
assert candidates.status_code == 200
assert accepted.status_code == 200
assert jobs.status_code == 200