Mercurial > ~darius > hgwebdir.cgi > epro
comparison eprodbus.py @ 18:9c2e08444598
Make sure timer is called more than once.
Not sure how this worked earlier..
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Mon, 06 Dec 2021 12:07:30 +1030 |
parents | 3067bb98b482 |
children | 3a3dba401b4a |
comparison
equal
deleted
inserted
replaced
17:3067bb98b482 | 18:9c2e08444598 |
---|---|
142 logger.info('Got all packets, logging') | 142 logger.info('Got all packets, logging') |
143 cur = self.dbh.cursor() | 143 cur = self.dbh.cursor() |
144 row['tstamp'] = int(datetime.datetime.now().strftime('%s')) | 144 row['tstamp'] = int(datetime.datetime.now().strftime('%s')) |
145 cur.execute('INSERT INTO eprolog VALUES (:tstamp, :main_voltage, :aux_voltage, :battery_curr, :amp_hours, :state_of_charge, :time_remaining, :battery_temp, :auto_sync_volts, :auto_sync_curr, :e501, :alarm_test, :light, :display_test, :temp_sensor, :aux_hv, :aux_lv, :installer_lock, :main_hv, :main_lv, :low_battery, :battery_flat, :battery_full, :battery_charged, :no_sync, :monitor_reset)', row) | 145 cur.execute('INSERT INTO eprolog VALUES (:tstamp, :main_voltage, :aux_voltage, :battery_curr, :amp_hours, :state_of_charge, :time_remaining, :battery_temp, :auto_sync_volts, :auto_sync_curr, :e501, :alarm_test, :light, :display_test, :temp_sensor, :aux_hv, :aux_lv, :installer_lock, :main_hv, :main_lv, :low_battery, :battery_flat, :battery_full, :battery_charged, :no_sync, :monitor_reset)', row) |
146 self.dbh.commit() | 146 self.dbh.commit() |
147 return True | |
147 | 148 |
148 def doexit(signum, frame): | 149 def doexit(signum, frame): |
149 sys.exit(1) | 150 sys.exit(1) |
150 | 151 |
151 def main(): | 152 def main(): |