Skip to content

Commit

Permalink
adjustment: reduce precision of charged- and discharged energy for py…
Browse files Browse the repository at this point in the history
…tes batteries (#1165)

Precision is reduced to match the CAN protocol definition.
  • Loading branch information
AndreasBoehm authored Aug 13, 2024
1 parent dacf9d4 commit 599c5ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BatteryStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ void PytesBatteryStats::getLiveViewData(JsonVariant& root) const
addLiveViewValue(root, "availableCapacity", _availableCapacity, "Ah", 0);

if (_chargedEnergy != -1) {
addLiveViewValue(root, "chargedEnergy", _chargedEnergy, "kWh", 2);
addLiveViewValue(root, "chargedEnergy", _chargedEnergy, "kWh", 1);
}

if (_dischargedEnergy != -1) {
addLiveViewValue(root, "dischargedEnergy", _dischargedEnergy, "kWh", 2);
addLiveViewValue(root, "dischargedEnergy", _dischargedEnergy, "kWh", 1);
}

addLiveViewInSection(root, "cells", "cellMinVoltage", static_cast<float>(_cellMinMilliVolt)/1000, "V", 3);
Expand Down

0 comments on commit 599c5ce

Please sign in to comment.