Skip to content

Commit 96eddca

Browse files
committed
feat: v0.4.0 — tema auto con sun.sun real, alerta fox_offline diurna, migraciones user_version, audit de alertas, code-path fuera del build
1 parent 3c48b78 commit 96eddca

17 files changed

Lines changed: 225 additions & 1763 deletions

‎ARCHITECTURE.md‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,21 @@ GET /api/solar/day?date 288 puntos 5-min + flag estimated
5959
GET /api/solar/kpis?date hoy (live) o pasado (SQLite daily)
6060
GET /api/solar/history días desde SQLite (from/to)
6161
POST /api/solar/history/refresh re-backfill manual
62-
GET /api/solar/stream SSE: push live throttled 1s + heartbeat 30s
62+
GET /api/solar/stream SSE: push live throttled 1s + heartbeat 25s (mensaje
63+
data {"type":"ping"}; el comentario `: ping` lo ignora EventSource)
64+
65+
## Alertas push (v0.3)
66+
67+
- Motor `server/src/alerts.js` (tick 60 s, flancos + anti-rebote): inversor_offline
68+
(solo de día + scraper fresco), fox_offline (pinza unavailable solo de día),
69+
corte_red (heurística isla), bateria_baja (SOC ≤ reserva), resumen_diario 21:00.
70+
- Web Push VAPID (`push.js`, `routes-push.js`): prefs por tipo, quiet hours con
71+
cola consolidada, i18n server-side es/en/zh. Sin VAPID arranca con push off.
72+
- Toda alerta disparada se audita (`audit_log`, action `alert:<tipo>`) para
73+
ajustar umbrales con historial real.
74+
- Migraciones de esquema: `user_version` en db.js (v1 daily solis/fox, v2 sessions
75+
viejo). Los CREATE IF NOT EXISTS son idempotentes; las transformaciones van en
76+
migraciones numeradas, nunca editadas a posteriori.
6377
GET/PUT /api/config ajustes instalación (kv)
6478
```
6579

‎app/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/>
2020
<script>
2121
// Preferencias antes del primer pintado (evita flash). Modos: auto | light | dark.
22-
// Auto: claro entre 06:50 y 21:40 (mock julio, España). Clave nueva helios-theme-mode
22+
// Auto pre-auth: fallback por reloj 06:50-21:40 (tras login manda sun.sun vía HAOS). Clave helios-theme-mode
2323
// con fallback a la legacy helios-theme. Densidad compacta = root 13.5px.
2424
(function () {
2525
try {

0 commit comments

Comments
 (0)