File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1010#include " event_log.h"
1111#include " divert.h"
1212#include " current_shaper.h"
13+ #include " manual.h"
1314
1415static EvseProperties nullProperties;
1516
@@ -267,7 +268,6 @@ bool EvseManager::evaluateClaims(EvseProperties &properties)
267268 DynamicJsonDocument event (capacity);
268269 event[" manual_override" ] = 1 ;
269270 event_send (event);
270- // update /override topic to mqtt
271271 event.clear ();
272272 mqtt_publish_json (event, " /override" );
273273 }
@@ -439,6 +439,12 @@ unsigned long EvseManager::loop(MicroTasks::WakeReason reason)
439439 {
440440 _evaluateTargetState = false ;
441441 setTargetState (_targetProperties);
442+
443+ if ( manual.isActive () ) {
444+ // update /override topic to mqtt
445+ mqtt_publish_override ();
446+ }
447+
442448 }
443449 return MicroTask.Infinate ;
444450}
Original file line number Diff line number Diff line change @@ -404,22 +404,18 @@ mqtt_publish_claim() {
404404
405405void
406406mqtt_publish_override () {
407+ DBUGLN (" MQTT publish_override()" );
407408 if (!config_mqtt_enabled () || !mqttclient.connected ()) {
408409 return ;
409410 }
410411 const size_t capacity = JSON_OBJECT_SIZE (40 ) + 1024 ;
411412 DynamicJsonDocument override_data (capacity);
412413 EvseProperties props;
413414 // check if there an override claim
414- if (evse.clientHasClaim (EvseClient_OpenEVSE_Manual)) {
415+ if (evse.clientHasClaim (EvseClient_OpenEVSE_Manual) || manual. isActive () ) {
415416 props = evse.getClaimProperties (EvseClient_OpenEVSE_Manual);
416417 // check if there's state property in override
417- if (props.getState () != 0 ) {
418- props.serialize (override_data);
419- }
420- else {
421- override_data[" state" ] = " null" ;
422- }
418+ props.serialize (override_data);
423419 }
424420 else override_data[" state" ] = " null" ;
425421 mqtt_publish_json (override_data, " /override" );
You can’t perform that action at this time.
0 commit comments