Skip to content

Commit

Permalink
Merge pull request #489 from KipK/testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremypoulter authored Nov 27, 2022
2 parents 10c3d7f + 4e5070e commit cc9e73f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/evse_man.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ bool EvseManager::claim(EvseClient client, int priority, EvseProperties &target)
MicroTask.wakeTask(this);
StaticJsonDocument<128> event;
event["claims_version"] = ++_version;
if (client == EvseClient_OpenEVSE_Manual) {
event["override_version"] = manual.setVersion(manual.getVersion() + 1);
}
event_send(event);
}
return true;
Expand All @@ -501,6 +504,10 @@ bool EvseManager::release(EvseClient client)
MicroTask.wakeTask(this);
StaticJsonDocument<128> event;
event["claims_version"] = ++_version;
if (client == EvseClient_OpenEVSE_Manual) {
event["override_version"] = manual.setVersion(manual.getVersion() + 1);

}
event_send(event);
return true;
}
Expand Down
8 changes: 5 additions & 3 deletions src/manual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ bool ManualOverride::claim()
bool ManualOverride::claim(EvseProperties &props)
{
if (!props.hasAutoRelease()) props.setAutoRelease(true);
StaticJsonDocument<128> event;
event["override_version"] = ++_version;
event_send(event);
return _evse->claim(EvseClient_OpenEVSE_Manual, EvseManager_Priority_Manual, props);
}

Expand Down Expand Up @@ -54,4 +51,9 @@ bool ManualOverride::getProperties(EvseProperties &props)
uint8_t ManualOverride::getVersion() {
return _version;
}

uint8_t ManualOverride::setVersion(uint8_t version) {
_version = version;
return _version;
}

1 change: 1 addition & 0 deletions src/manual.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ManualOverride
}
bool getProperties(EvseProperties &props);
uint8_t getVersion();
uint8_t setVersion(uint8_t version);
};

extern ManualOverride manual;
Expand Down

0 comments on commit cc9e73f

Please sign in to comment.