MCPcopy Create free account
hub / github.com/evcc-io/evcc / getPlanRequiredDuration

Method getPlanRequiredDuration

core/loadpoint_plan.go:82–92  ·  view source on GitHub ↗

getPlanRequiredDuration is the estimated total charging duration

(goal, maxPower float64)

Source from the content-addressed store, hash-verified

80
81// getPlanRequiredDuration is the estimated total charging duration
82func (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
95func (lp *Loadpoint) GetPlanGoal() (float64, bool) {

Callers 2

nextActivePlanMethod · 0.95

Calls 7

socBasedPlanningMethod · 0.95
GetVehicleMethod · 0.95
remainingPlanEnergyMethod · 0.95
RemainingChargeDurationFunction · 0.92
DurationMethod · 0.80
CapacityMethod · 0.65

Tested by

no test coverage detected