changeset 25:64d0d5aaf329

Report time remaining as None when charging, the value is apparently meaningless then.
author Daniel O'Connor <darius@dons.net.au>
date Tue, 14 Dec 2021 13:04:12 +1030
parents 41eba85c0c84
children 3090d8bf4242
files eprodbus.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/eprodbus.py	Mon Dec 13 23:04:37 2021 +1030
+++ b/eprodbus.py	Tue Dec 14 13:04:12 2021 +1030
@@ -67,7 +67,11 @@
                 self.dbusservice['/ConsumedAmphours'] = p.amphrs
             elif type(p) == epro.TimeRemaining:
                 # ePro reports in minutes, Venus expects seconds
-                self.dbusservice['/TimeToGo'] = p.time * 60
+                if p.time >= 0:
+                    self.dbusservice['/TimeToGo'] = p.time * 60
+                else:
+                    # Battery is charging
+                    self.dbusservice['/TimeToGo'] = None
             elif type(p) == epro.AuxVoltage:
                 self.dbusservice['/Dc/1/Voltage'] = p.volts
             elif type(p) == epro.MonitorStatus: