Skip to content

Commit

Permalink
Assign default vehicle on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Aug 24, 2022
1 parent 6841f86 commit 3281750
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/loadpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ func (lp *LoadPoint) evVehicleDisconnectHandler() {
// remove active vehicle if not default
if lp.vehicle != lp.defaultVehicle {
lp.setActiveVehicle(lp.defaultVehicle)
lp.unpublishVehicle()
}

// set default mode on disconnect
Expand Down Expand Up @@ -533,6 +532,11 @@ func (lp *LoadPoint) Prepare(uiChan chan<- util.Param, pushChan chan<- push.Even
lp.publishTimer(phaseTimer, 0, timerInactive)
lp.publishTimer(pvTimer, 0, timerInactive)

// assign and publish default vehicle
if lp.defaultVehicle != nil {
lp.setActiveVehicle(lp.defaultVehicle)
}

lp.Lock()
lp.publish("mode", lp.Mode)
lp.publish("targetSoC", lp.SoC.target)
Expand Down

0 comments on commit 3281750

Please sign in to comment.