v0.14.2-connectivity

This commit is contained in:
Mateusz Gruszczyński
2026-09-15 10:02:49 +02:00
parent 2fd7e47eb9
commit c3f6e773f8
41 changed files with 1295 additions and 108 deletions
+12
View File
@@ -58,6 +58,7 @@ assert isinstance(settings, dict), "bootstrap.settings missing"
paths = {
"application": "/api/settings/application",
"gree": "/api/settings/gree",
"gree_cloud": "/api/settings/gree-cloud",
"history": "/api/settings/history",
"influxdb": "/api/settings/influxdb",
"notifications": "/api/settings/notifications",
@@ -73,6 +74,7 @@ for section, path in paths.items():
assert "password" not in settings["influxdb"]
assert "token" not in settings["influxdb"]
assert "password" not in settings["gree_cloud"]
assert "token" not in settings["home_assistant"]
for secret in ("pushover_app_token", "pushover_user_key", "slack_webhook_url", "discord_webhook_url"):
assert secret not in settings["notifications"], f"secret field leaked: {secret}"
@@ -88,6 +90,16 @@ curl -fsS -X POST \
grep -q '"ok":true' "$TMP/probe.json"
grep -q '"response_time_ms":0' "$TMP/probe.json"
curl -fsS "http://127.0.0.1:$PORT/api/history/network?hours=24&limit=100" >"$TMP/network-history.json"
python3 - "$TMP/network-history.json" <<'PYNETWORK'
import json, sys
data = json.load(open(sys.argv[1], encoding="utf-8"))
assert isinstance(data.get("readings"), list)
assert isinstance(data.get("targets"), list)
assert isinstance(data.get("bucket_seconds"), int) and data["bucket_seconds"] > 0
assert isinstance(data.get("storage"), str) and data["storage"]
PYNETWORK
curl -fsS -X POST -H 'Content-Type: application/json' \
-d '{"name":"Test","device_id":"sim-salon","enabled":true,"mode":"cool","setpoint":23,"hysteresis":0.6,"min_on_seconds":0,"min_off_seconds":0,"sensor_source":"device"}' \
"http://127.0.0.1:$PORT/api/zones" >"$TMP/zone.json"