fix issues with clock changes inbetween scans

This commit is contained in:
Daniel Havlik
2022-10-30 11:17:23 +01:00
parent 665c127096
commit 4321597c80
+3 -3
View File
@@ -552,7 +552,7 @@ def main():
# Core polling loop # Core polling loop
while True: while True:
loop_start = datetime.now() loop_start = time.perf_counter()
inverter.checkConnection() inverter.checkConnection()
@@ -567,8 +567,8 @@ def main():
inverter.disconnect() inverter.disconnect()
logging.warning(f"Data collection failed, skipped exporting data. Retying in {scan_interval} secs") logging.warning(f"Data collection failed, skipped exporting data. Retying in {scan_interval} secs")
loop_end = datetime.now() loop_end = time.perf_counter()
process_time = round(float(((loop_end - loop_start).seconds) + ((loop_end - loop_start).microseconds / 1000000)),2) process_time = round(loop_end - loop_start, 2)
logging.debug(f'Processing Time: {process_time} secs') logging.debug(f'Processing Time: {process_time} secs')
if 'runonce' in locals(): if 'runonce' in locals():