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

Method needsWelcomeCharge

core/loadpoint.go:1221–1238  ·  view source on GitHub ↗

needsWelcomeCharge checks if either the charger or a vehicle requires a welcome charge

()

Source from the content-addressed store, hash-verified

1219
1220// needsWelcomeCharge checks if either the charger or a vehicle requires a welcome charge
1221func (lp *Loadpoint) needsWelcomeCharge() bool {
1222 if lp.chargerHasFeature(api.WelcomeCharge) || hasFeature(lp.defaultVehicle, api.WelcomeCharge) {
1223 return true
1224 }
1225
1226 // Enable charging on connect if any available vehicle requires it.
1227 // We're using the PV timer to disable after the welcome
1228 if !lp.chargerHasFeature(api.IntegratedDevice) {
1229 for _, v := range lp.availableVehicles() {
1230 if slices.Contains(v.Features(), api.WelcomeCharge) {
1231 lp.log.DEBUG.Printf("welcome charge: %s", v.GetTitle())
1232 return true
1233 }
1234 }
1235 }
1236
1237 return false
1238}
1239
1240// effectiveCurrent returns the currently effective charging current
1241func (lp *Loadpoint) effectiveCurrent() float64 {

Callers 1

updateChargerStatusMethod · 0.95

Calls 7

chargerHasFeatureMethod · 0.95
availableVehiclesMethod · 0.95
PrintfMethod · 0.80
hasFeatureFunction · 0.70
FeaturesMethod · 0.65
GetTitleMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected