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

Method publishTimer

core/loadpoint.go:1473–1489  ·  view source on GitHub ↗

TODO move up to timer functions

(name string, delay time.Duration, action string)

Source from the content-addressed store, hash-verified

1471
1472// TODO move up to timer functions
1473func (lp *Loadpoint) publishTimer(name string, delay time.Duration, action string) {
1474 timer := lp.pvTimer
1475 if name == phaseTimer {
1476 timer = lp.phaseTimer
1477 }
1478
1479 remaining := max(delay-lp.clock.Since(timer), 0)
1480
1481 lp.publish(name+"Action", action)
1482 lp.publish(name+"Remaining", remaining)
1483
1484 if action == timerInactive {
1485 lp.log.DEBUG.Printf("%s timer %s", name, action)
1486 } else {
1487 lp.log.DEBUG.Printf("%s %s in %v", name, action, remaining.Round(time.Second))
1488 }
1489}
1490
1491// boostPower returns the additional power that the loadpoint should draw from the battery
1492func (lp *Loadpoint) boostPower(batteryBoostPower float64) float64 {

Callers 6

PrepareMethod · 0.95
elapsePVTimerMethod · 0.95
resetPVTimerMethod · 0.95
resetPhaseTimerMethod · 0.95
pvScalePhasesMethod · 0.95
pvMaxCurrentMethod · 0.95

Calls 2

publishMethod · 0.95
PrintfMethod · 0.80

Tested by

no test coverage detected