@@ -21,8 +21,8 @@ unsigned long CurrentShaperTask::loop(MicroTasks::WakeReason reason) {
2121 if (_enabled && !_evse->clientHasClaim (EvseClient_OpenEVSE_Divert)) {
2222 EvseProperties props;
2323 if (_changed) {
24- props.setChargeCurrent (_chg_cur );
25- if (_chg_cur < evse.getMinCurrent () ) {
24+ props.setMaxCurrent (_max_cur );
25+ if (_max_cur < evse.getMinCurrent () ) {
2626 // pause temporary, not enough amps available
2727 props.setState (EvseState::Disabled);
2828 }
@@ -36,7 +36,8 @@ unsigned long CurrentShaperTask::loop(MicroTasks::WakeReason reason) {
3636 event[" shaper" ] = 1 ;
3737 event[" shaper_live_pwr" ] = _live_pwr;
3838 event[" shaper_max_pwr" ] = _max_pwr;
39- event[" shaper_cur" ] = _chg_cur;
39+ event[" shaper_cur" ] = _max_cur;
40+ event[" shaper_updated" ] = true ;
4041 event_send (event);
4142 }
4243 if (millis () - _timer > EVSE_SHAPER_FAILSAFE_TIME) {
@@ -48,7 +49,8 @@ unsigned long CurrentShaperTask::loop(MicroTasks::WakeReason reason) {
4849 event[" shaper" ] = 1 ;
4950 event[" shaper_live_pwr" ] = _live_pwr;
5051 event[" shaper_max_pwr" ] = _max_pwr;
51- event[" shaper_cur" ] = _chg_cur;
52+ event[" shaper_cur" ] = _max_cur;
53+ event[" shaper_updated" ] = false ;
5254 event_send (event);
5355 }
5456 }
@@ -69,7 +71,7 @@ void CurrentShaperTask::begin(EvseManager &evse) {
6971 this -> _evse = &evse;
7072 this -> _max_pwr = current_shaper_max_pwr;
7173 this -> _live_pwr = 0 ;
72- this -> _chg_cur = 0 ;
74+ this -> _max_cur = 0 ;
7375 MicroTask.startTask (this );
7476 StaticJsonDocument<128 > event;
7577 event[" shaper" ] = 1 ;
@@ -110,7 +112,7 @@ void CurrentShaperTask::setState(bool state) {
110112}
111113
112114void CurrentShaperTask::shapeCurrent () {
113- _chg_cur = round (((_max_pwr - _live_pwr) / evse.getVoltage ()) + (evse.getAmps ()));
115+ _max_cur = round (((_max_pwr - _live_pwr) / evse.getVoltage ()) + (evse.getAmps ()));
114116 _changed = true ;
115117}
116118
@@ -120,8 +122,9 @@ int CurrentShaperTask::getMaxPwr() {
120122int CurrentShaperTask::getLivePwr () {
121123 return _live_pwr;
122124}
123- uint8_t CurrentShaperTask::getChgCur () {
124- return _chg_cur;
125+
126+ uint8_t CurrentShaperTask::getMaxCur () {
127+ return _max_cur;
125128}
126129bool CurrentShaperTask::getState () {
127130 return _enabled;
0 commit comments