cose non cose

This commit is contained in:
2025-06-12 11:28:52 +02:00
parent 71880fc66b
commit f17e6ef863
2 changed files with 5 additions and 4 deletions

View File

@@ -74,6 +74,7 @@ def main() -> int:
###### END MAIN LOOP #########
##############################
connection.disconnect()
write_client.close()
return 0
if __name__ == "__main__":

View File

@@ -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