setPlanStrategy sets the plan strategy (no mutex)
(strategy api.PlanStrategy)
| 406 | |
| 407 | // setPlanStrategy sets the plan strategy (no mutex) |
| 408 | func (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 |
| 424 | func (lp *Loadpoint) SetPlanStrategy(strategy api.PlanStrategy) error { |
no test coverage detected