Skip to content

Commit

Permalink
Merge pull request #571 from KipK/master
Browse files Browse the repository at this point in the history
reset session_elapsed if no vehicle at reboot
  • Loading branch information
jeremypoulter authored Mar 16, 2023
2 parents 14dda51 + cdc76cf commit 3f6dd5f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/energy_meter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ void EnergyMeterData::deserialize(StaticJsonDocument<capacity> &doc)
}
if (doc.containsKey("el") && doc["el"].is<uint32_t>())
{
// old OpenEvse total_energy imported flag
// elapsed
elapsed = doc["el"];
}
if (doc.containsKey("sw") && doc["sw"].is<uint32_t>())
{
// old OpenEvse total_energy imported flag
// switches
switches = doc["sw"];
}
};
Expand Down Expand Up @@ -165,6 +165,8 @@ void EnergyMeter::begin(EvseMonitor *monitor)
else
{
_data.elapsed = 0;
_elapsed = 0;
_data.session = 0;
save();
}
}
Expand Down

0 comments on commit 3f6dd5f

Please sign in to comment.