Files
EMS/Makefile
Lutz Finsterle 79828a46c5 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>
2026-04-06 10:06:01 +02:00

32 lines
735 B
Makefile

BINARY := ems
CONFIG := configs/ems-config.yaml
.PHONY: build test dry-run run install lint
build:
go build -o $(BINARY) .
test:
go test ./...
dry-run: build
./$(BINARY) -config $(CONFIG) -dry-run
run: build
./$(BINARY) -config $(CONFIG)
install: build
install -Dm755 $(BINARY) /usr/local/bin/$(BINARY)
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:
go vet ./...