From 815e0344bd021dc1ab04cedd8390a47b9264a898 Mon Sep 17 00:00:00 2001 From: Carsten Schmiemann Date: Mon, 12 Jun 2023 00:43:32 +0200 Subject: [PATCH] Debug time remaining --- dbus-batrium-native/batrium.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dbus-batrium-native/batrium.py b/dbus-batrium-native/batrium.py index 0565b1f..aa1e063 100644 --- a/dbus-batrium-native/batrium.py +++ b/dbus-batrium-native/batrium.py @@ -114,12 +114,14 @@ class BatriumBattery(can.Listener): logging.debug("Cell number in bypass: %d", self.NumberInBypass) elif msg.arbitration_id == 0x00111800: - self.TimeToEmpty = ((msg.data[5] * 256) + msg.data[4] * 60) - logging.debug("Time to empty: %dmin", self.TimeToEmpty) + self.TimeToEmpty = ((msg.data[5] * 256) + msg.data[4]) * 60 + logging.debug("Time to empty: %dmin", (msg.data[5] * 256) + msg.data[4]) + logging.debug("Time to empty: %dsec", self.TimeToEmpty) elif msg.arbitration_id == 0x00111700: - self.TimeToFull = ((msg.data[5] * 256) + msg.data[4] * 60) - logging.debug("Time to full: %dmin", self.TimeToFull) + self.TimeToFull = ((msg.data[5] * 256) + msg.data[4]) * 60 + logging.debug("Time to full: %dmin", (msg.data[5] * 256) + msg.data[4]) + logging.debug("Time to full: %dsec", self.TimeToFull) elif msg.arbitration_id == 0x00140400: self.maxDischargeCurrent = ((msg.data[3] * 256) + msg.data[2]) * 0.01