fix static analysis CI

albatross
Adeeb Shihadeh 2021-03-09 17:49:15 -08:00
parent 81433f1e54
commit 2d79ccb9ad
1 changed files with 3 additions and 5 deletions

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python3
import os
import sys
import time
@ -7,7 +6,6 @@ def average(avg, sample):
# Weighted avg between existing value and new sample
return ((avg[0] * avg[1] + sample) / (avg[1] + 1), avg[1] + 1)
if __name__ == '__main__':
sample_time = None
@ -16,9 +14,9 @@ if __name__ == '__main__':
start_time = time.monotonic()
try:
voltage_average = (0., 0) # average, count
current_average = (0., 0)
power_average = (0., 0)
voltage_average = (0, 0) # average, count
current_average = (0, 0)
power_average = (0, 0)
while sample_time is None or time.monotonic() - start_time < sample_time:
with open("/sys/bus/i2c/devices/0-0040/hwmon/hwmon1/in1_input") as f:
voltage = int(f.read()) / 1000.