cose non cose
This commit is contained in:
@@ -74,6 +74,7 @@ def main() -> int:
|
||||
###### END MAIN LOOP #########
|
||||
##############################
|
||||
connection.disconnect()
|
||||
write_client.close()
|
||||
return 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -4,11 +4,10 @@ import time
|
||||
import serial
|
||||
import logging
|
||||
|
||||
|
||||
from pyutils.utils import *
|
||||
from copy import deepcopy
|
||||
from pyutils.utils import *
|
||||
from dataclasses import dataclass
|
||||
from influxdb_client_3 import InfluxDBClient3
|
||||
from influxdb_client_3 import InfluxDBClient3, WriteOptions
|
||||
|
||||
# Get environment variables
|
||||
env = dict(os.environ)
|
||||
@@ -78,7 +77,7 @@ class UPSbattery(UPScommand):
|
||||
data = self.request(port=port, cmd="QBV")
|
||||
self.battV = float(data[0])
|
||||
self.battPct = int(data[3])
|
||||
self.timeLeft = round(int(data[4]) / 60.0, 2)
|
||||
self.timeLeft = round(int(data[4]) / 60.0, 1)
|
||||
|
||||
##################
|
||||
###### MAIN ######
|
||||
@@ -141,6 +140,7 @@ def main() -> int:
|
||||
###### END MAIN LOOP #########
|
||||
##############################
|
||||
port.close()
|
||||
write_client.close()
|
||||
LOGGER.warning("Main thread exited normally")
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user