From c5abb6ce7b100ab3659c4027b49777c68e4e5cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Bo=CC=88hm?= Date: Tue, 13 Aug 2024 13:39:30 +0200 Subject: [PATCH] adjustment: reduce precision of charged- and discharged energy for pytes batteries Precision is reduced to match the CAN protocol definition. --- src/BatteryStats.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BatteryStats.cpp b/src/BatteryStats.cpp index c4b428d34..9f32931b7 100644 --- a/src/BatteryStats.cpp +++ b/src/BatteryStats.cpp @@ -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(_cellMinMilliVolt)/1000, "V", 3);