Planner: remove expired plan when vehicle disconnects (#15160)

This commit is contained in:
Michael Geers 2024-07-31 14:42:25 +02:00 • committed by GitHub
parent 101d62a133
commit 4f0739f2bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -100,7 +100,9 @@ func (lp *Loadpoint) plannerActive() (active bool) {
if planTime.IsZero() {
return false
}
if lp.clock.Until(planTime) < 0 && !lp.planActive {
// keep overrunning plans as long as a vehicle is connected
if lp.clock.Until(planTime) < 0 && (!lp.planActive || !lp.connected()) {
lp.log.DEBUG.Println("plan: deleting expired plan")
lp.deletePlan()
return false
}