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

Method SetBatteryBoost

core/loadpoint_api.go:625–646  ·  view source on GitHub ↗

SetBatteryBoost sets the battery boost

(enable bool)

Source from the content-addressed store, hash-verified

623
624// SetBatteryBoost sets the battery boost
625func (lp *Loadpoint) SetBatteryBoost(enable bool) error {
626 lp.Lock()
627 defer lp.Unlock()
628
629 if enable && lp.mode != api.ModePV && lp.mode != api.ModeMinPV {
630 return errors.New("battery boost is only available in PV modes")
631 }
632
633 lp.log.DEBUG.Println("set battery boost:", enable)
634
635 if enable != (lp.batteryBoost != boostDisabled) {
636 lp.publish(keys.BatteryBoost, enable)
637
638 lp.batteryBoost = boostDisabled
639 if enable {
640 lp.batteryBoost = boostStart
641 lp.requestUpdate()
642 }
643 }
644
645 return nil
646}
647
648// GetBatteryBoostLimit returns the battery boost soc limit
649func (lp *Loadpoint) GetBatteryBoostLimit() int {

Callers 2

UpdateMethod · 0.95

Calls 6

LockMethod · 0.95
UnlockMethod · 0.95
publishMethod · 0.95
requestUpdateMethod · 0.95
PrintlnMethod · 0.80
NewMethod · 0.65

Tested by

no test coverage detected