Skip to content

Commit f692464

Browse files
committed
Unlock openEvse at evseBoot() if compiled with BOOTLOCK
1 parent 39dddf8 commit f692464

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

openevse-gui-v2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 606377e6f6e2bd36de7a3efd3005601ded791a8e

src/evse_monitor.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,19 @@ void EvseMonitor::evseBoot(const char *firmware)
273273
_openevse.heartbeatEnable(EVSE_HEATBEAT_INTERVAL, EVSE_HEARTBEAT_CURRENT, [this](int ret, int interval, int current, int triggered) {
274274
_heartbeat = RAPI_RESPONSE_OK == ret;
275275
});
276+
277+
// Unlock OpenEVSE if compiled with BOOTLOCK
278+
_openevse.clearBootLock([this](int ret)
279+
{
280+
if(RAPI_RESPONSE_OK == ret)
281+
{
282+
DBUGF("Unlocked OpenEVSE");
283+
}
284+
else {
285+
DBUGF("Unlock OpenEVSE failed")
286+
}
287+
288+
});
276289
}
277290

278291
void EvseMonitor::updateEvseState(uint8_t evse_state, uint8_t pilot_state, uint32_t vflags)
@@ -312,7 +325,7 @@ void EvseMonitor::updateEvseState(uint8_t evse_state, uint8_t pilot_state, uint3
312325
}
313326

314327
void EvseMonitor::verifyPilot() {
315-
// After some state changes the OpenEVSE module compiled with PP_AUTO_AMPACITY will reset to the maximum pilot level, so reset to what we expect
328+
// OpenEVSE module compiled with PP_AUTO_AMPACITY will reset to the maximum pilot level, so reset to what we expect
316329
_openevse.getCurrentCapacity([this](int ret, long min_current, long max_hardware_current, long pilot, long max_configured_current)
317330
{
318331
if(RAPI_RESPONSE_OK == ret && pilot > getPilot())

0 commit comments

Comments
 (0)