Planner: add tolerance for single slot use (#26814)

This commit is contained in:
Ingo 2026-01-19 19:31:10 +01:00 • committed by GitHub
parent 8388363586
commit 0f53d54273
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -169,7 +169,7 @@ func (lp *Loadpoint) plannerActive() (active bool) {
if active {
// ignore short plans if not already active
if slotRemaining := lp.clock.Until(activeSlot.End); !lp.planActive && slotRemaining < tariff.SlotDuration && !planner.SlotHasSuccessor(activeSlot, plan) {
if slotRemaining := lp.clock.Until(activeSlot.End); !lp.planActive && slotRemaining < tariff.SlotDuration-time.Minute && !planner.SlotHasSuccessor(activeSlot, plan) {
lp.log.DEBUG.Printf("plan: slot too short- ignoring remaining %v", slotRemaining.Round(time.Second))
return false
}