adjustment: reduce precision of charged- and discharged energy for pytes batteries (#1165)

Precision is reduced to match the CAN protocol definition.
This commit is contained in:
Andreas Böhm 2024-08-13 17:51:12 +02:00 committed by GitHub
parent dacf9d4be1
commit 599c5cea7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);