File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -232,10 +232,11 @@ func (lp *Loadpoint) EffectiveMaxPower() float64 {
232232
233233// effectiveMaxPower returns the effective max power taking vehicle capabilities and phase scaling into account
234234func (lp * Loadpoint ) effectiveMaxPower () float64 {
235- if maxPower , ok := lp . vehicle . OnIdentified (). GetMaxPower (); ok && lp .vehicle != nil {
236- lp . log . DEBUG . Printf ( "Max power from vehicle: %.2f kWh" , maxPower / 1000 )
237- return maxPower
238- } else {
239- return Voltage * lp . effectiveMaxCurrent () * float64 ( lp . maxActivePhases ())
235+ if lp .vehicle != nil {
236+ if maxPower , ok := lp . vehicle . OnIdentified (). GetMaxPower (); ok {
237+ lp . log . DEBUG . Printf ( "Max power from vehicle: %.2f kWh" , maxPower / 1000 )
238+ return maxPower
239+ }
240240 }
241+ return Voltage * lp .effectiveMaxCurrent () * float64 (lp .maxActivePhases ())
241242}
You can’t perform that action at this time.
0 commit comments