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

Method evChargeCurrentWrappedMeterHandler

core/loadpoint.go:652–662  ·  view source on GitHub ↗

evChargeCurrentWrappedMeterHandler updates the dummy charge meter's charge power. This simplifies the main flow where the charge meter can always be treated as present. It assumes that the charge meter cannot consume more than total household consumption. If physical charge meter is present this han

(current float64)

Source from the content-addressed store, hash-verified

650// If physical charge meter is present this handler is not used.
651// The actual value is published by the evChargeCurrentHandler
652func (lp *Loadpoint) evChargeCurrentWrappedMeterHandler(current float64) {
653 power := current * float64(lp.ActivePhases()) * Voltage
654
655 // if disabled we cannot be charging
656 if !lp.enabled || !lp.charging() {
657 power = 0
658 }
659
660 // handler only called if charge meter was replaced by dummy
661 lp.chargeMeter.(*wrapper.ChargeMeter).SetPower(power)
662}
663
664// defaultMode executes the action
665func (lp *Loadpoint) defaultMode() {

Callers

nothing calls this directly

Calls 3

ActivePhasesMethod · 0.95
chargingMethod · 0.95
SetPowerMethod · 0.80

Tested by

no test coverage detected