From 7ba57e3094531bafb536c851ef50f710cc4c722c Mon Sep 17 00:00:00 2001 From: andig Date: Wed, 6 May 2020 20:26:48 +0200 Subject: [PATCH] Apply now and off modes immediately --- core/loadpoint.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/loadpoint.go b/core/loadpoint.go index f51538a3bb..7d8d497b6e 100644 --- a/core/loadpoint.go +++ b/core/loadpoint.go @@ -451,8 +451,12 @@ func (lp *LoadPoint) update() { // execute loading strategy switch mode := lp.GetMode(); mode { case api.ModeOff: + // apply immediately + lp.guardUpdated = lp.clock.Now() err = lp.rampOff() case api.ModeNow: + // apply immediately + lp.guardUpdated = lp.clock.Now() // ensure that new connections happen at min current current := lp.MinCurrent if lp.connected() {