Mercurial > ~darius > hgwebdir.cgi > epro
comparison 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 |
comparison
equal
deleted
inserted
replaced
24:41eba85c0c84 | 25:64d0d5aaf329 |
---|---|
65 self.dbusservice['/Dc/0/Temperature'] = p.temp | 65 self.dbusservice['/Dc/0/Temperature'] = p.temp |
66 elif type(p) == epro.AmpHours: | 66 elif type(p) == epro.AmpHours: |
67 self.dbusservice['/ConsumedAmphours'] = p.amphrs | 67 self.dbusservice['/ConsumedAmphours'] = p.amphrs |
68 elif type(p) == epro.TimeRemaining: | 68 elif type(p) == epro.TimeRemaining: |
69 # ePro reports in minutes, Venus expects seconds | 69 # ePro reports in minutes, Venus expects seconds |
70 self.dbusservice['/TimeToGo'] = p.time * 60 | 70 if p.time >= 0: |
71 self.dbusservice['/TimeToGo'] = p.time * 60 | |
72 else: | |
73 # Battery is charging | |
74 self.dbusservice['/TimeToGo'] = None | |
71 elif type(p) == epro.AuxVoltage: | 75 elif type(p) == epro.AuxVoltage: |
72 self.dbusservice['/Dc/1/Voltage'] = p.volts | 76 self.dbusservice['/Dc/1/Voltage'] = p.volts |
73 elif type(p) == epro.MonitorStatus: | 77 elif type(p) == epro.MonitorStatus: |
74 self.dbusservice['/Alarms/LowVoltage'] = 2 if p.mainlv else 0 | 78 self.dbusservice['/Alarms/LowVoltage'] = 2 if p.mainlv else 0 |
75 self.dbusservice['/Alarms/HighVoltage'] = 2 if p.mainhv else 0 | 79 self.dbusservice['/Alarms/HighVoltage'] = 2 if p.mainhv else 0 |