Skip to content

Commit

Permalink
Planner: remove expired plan when vehicle disconnects (#15160)
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis committed Jul 31, 2024
1 parent 101d62a commit 4f0739f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/loadpoint_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 4f0739f

Please sign in to comment.