Commit Graph

4 Commits (69246618ee2e61cbdcf41875ec7d034bb3b2b5c9)

Author SHA1 Message Date
Patrick Schurig 69246618ee fix: test forecast uses UTC hour for solar/price lookup
buildWinterForecast was indexing solarW[] and winterPrices[] by slot
position h instead of actual UTC hour. When a forecast starts at 18:00,
h=8 (02:00 AM) was getting solarW[8]=1200W, giving midnight slots a
false solar bonus in RuleBasedStrategy::slotScore(). The strategy
correctly chose those slots, but countSlotsInCheapestN (price-only)
reported them as outside the 6 cheapest hours → test 1 failed.

Fix: index both arrays by slot.start.toUTC().time().hour() so solar
peaks at noon and prices reflect the real time-of-day. All 11 tests pass.

Also includes the INCLUDEPATH += \$\$PWD fix in energyplugin.pri that
makes relative includes work for test builds consuming the .pri.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 06:53:20 +01:00
Patrick Schurig 0797f37c78 feat: ManualStrategy — community tier scheduling with full manual control
- Add ManualSlotConfig type with weekly repeating support and auto-expiry
- Add ManualStrategy (strategyId="manual"): applies user-defined allocations
  exactly; expired slots logged and skipped; inflexible/critical loads always
  applied as safety fallback; decisionReason never empty
- Extend SchedulerSettings with manualSlots persistence section (INI array)
- Extend SchedulerManager with setManualSlot/removeManualSlot/clearManualSlots
  methods; hydrates ManualStrategy from settings on registerStrategy()
- Add JSON-RPC v11 methods: GetManualSlots, SetManualSlot, RemoveManualSlot,
  ClearManualSlots + ManualSlotActivated push notification
- Register ManualStrategy in energypluginnymea.cpp::init() (no feature flag)
- Add 5 unit tests: basicSlot, noConfig_fallback, expiredSlot, repeatingSlot,
  persistence (JSON round-trip)
- Update doc.md section 11

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 06:34:31 +01:00
Patrick Schurig 253c5f487a feat: SchedulerManager v1 — build clean
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 22:02:01 +01:00
Patrick Schurig b343650f9b initial commit 2026-01-11 11:09:23 +01:00