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

Method setPlanStrategy

core/loadpoint_api.go:408–421  ·  view source on GitHub ↗

setPlanStrategy sets the plan strategy (no mutex)

(strategy api.PlanStrategy)

Source from the content-addressed store, hash-verified

406
407// setPlanStrategy sets the plan strategy (no mutex)
408func (lp *Loadpoint) setPlanStrategy(strategy api.PlanStrategy) error {
409 if err := lp.settings.SetJson(keys.PlanStrategy, strategy); err != nil {
410 return err
411 }
412
413 lp.planStrategy = strategy
414 lp.publish(keys.PlanStrategy, strategy)
415
416 lp.publish(keys.EffectivePlanStrategy, lp.getEffectivePlanStrategy())
417
418 lp.requestUpdate()
419
420 return nil
421}
422
423// SetPlanStrategy sets the plan strategy
424func (lp *Loadpoint) SetPlanStrategy(strategy api.PlanStrategy) error {

Callers 2

restoreSettingsMethod · 0.95
SetPlanStrategyMethod · 0.95

Calls 4

publishMethod · 0.95
requestUpdateMethod · 0.95
SetJsonMethod · 0.65

Tested by

no test coverage detected