getPlanRequiredDuration is the estimated total charging duration
(goal, maxPower float64)
| 80 | |
| 81 | // getPlanRequiredDuration is the estimated total charging duration |
| 82 | func (lp *Loadpoint) getPlanRequiredDuration(goal, maxPower float64) time.Duration { |
| 83 | if lp.socBasedPlanning() { |
| 84 | if lp.socEstimator == nil { |
| 85 | return soc.RemainingChargeDuration(goal, maxPower, lp.vehicleSoc, lp.GetVehicle().Capacity()) |
| 86 | } |
| 87 | return lp.socEstimator.RemainingChargeDuration(goal, maxPower) |
| 88 | } |
| 89 | |
| 90 | energy := lp.remainingPlanEnergy(goal) |
| 91 | return time.Duration(energy * 1e3 / maxPower * float64(time.Hour)) |
| 92 | } |
| 93 | |
| 94 | // GetPlanGoal returns the plan goal in %, true or kWh, false |
| 95 | func (lp *Loadpoint) GetPlanGoal() (float64, bool) { |
no test coverage detected