Mercurial > ~darius > hgwebdir.cgi > epro
diff eprodbus.py @ 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 | 02ba26698696 |
children | ea07d14075e6 |
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: