File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ void CurrentShaperTask::setup() {
1818}
1919
2020unsigned long CurrentShaperTask::loop (MicroTasks::WakeReason reason) {
21- if (_enabled) {
21+ if (_enabled && !_evse-> clientHasClaim (EvseClient_OpenEVSE_Divert) ) {
2222 EvseProperties props;
2323 if (_changed) {
2424 props.setChargeCurrent (_chg_cur);
@@ -97,7 +97,6 @@ void CurrentShaperTask::setState(bool state) {
9797 if (!_enabled) {
9898 // remove claim
9999 evse.release (EvseClient_OpenEVSE_Shaper);
100-
101100 }
102101 StaticJsonDocument<128 > event;
103102 event[" shaper" ] = state?1 :0 ;
@@ -106,7 +105,7 @@ void CurrentShaperTask::setState(bool state) {
106105
107106void CurrentShaperTask::shapeCurrent () {
108107 _chg_cur = round (((_max_pwr - _live_pwr) / evse.getVoltage ()) + (evse.getAmps ()));
109- _changed = true ; // update claim in the loop
108+ _changed = true ;
110109}
111110
112111int CurrentShaperTask::getMaxPwr () {
Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ void buildStatus(DynamicJsonDocument &doc) {
241241 doc[" divert_update" ] = (millis () - divert.getLastUpdate ()) / 1000 ;
242242 doc[" divert_active" ] = divert.isActive ();
243243
244- doc[" shaper" ] = shaper.isActive ()?1 :0 ;
244+ doc[" shaper" ] = shaper.getState ()?1 :0 ;
245245 doc[" shaper_live_pwr" ] = shaper.getLivePwr ();
246246 doc[" shaper_chg_cur" ] = shaper.getChgCur ();
247247
You can’t perform that action at this time.
0 commit comments