Add status page enhancements and engine improvements

Status page:
- Per-phase grid power (L1/L2/L3) with export/import direction
- Shelly PM live power badge on active wallbox rows
- Compressor power shown below consumer list
- SyncDeviceStates() method on Store for PM power readback

Engine:
- Fix wallbox mutex: re-read Active state after P3 so same-cycle
  WallboxA activation correctly blocks WallboxB in P4
- Fix RecoverState: set ActivatedAt to zero so recovered consumers
  are immediately eligible for shutdown decisions
- Add 3 new unit tests: mutual exclusion, car-not-charging,
  compressor-idle early release

Makefile:
- make install no longer overwrites /etc/ems/ems-config.yaml if it
  already exists (prevents password loss on updates)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 10:06:01 +02:00
parent 99613c52ae
commit 79828a46c5
3 changed files with 130 additions and 21 deletions

View File

@@ -17,9 +17,14 @@ run: build
install: build
install -Dm755 $(BINARY) /usr/local/bin/$(BINARY)
install -Dm644 $(CONFIG) /etc/ems/ems-config.yaml
install -Dm644 systemd/ems.service /etc/systemd/system/ems.service
systemctl daemon-reload
@if [ ! -f /etc/ems/ems-config.yaml ]; then \
install -Dm644 $(CONFIG) /etc/ems/ems-config.yaml; \
echo "Config installed to /etc/ems/ems-config.yaml (first time)"; \
else \
echo "Config already exists at /etc/ems/ems-config.yaml — not overwritten"; \
fi
@echo "Run: systemctl enable --now ems"
lint: