fix service file and init of lib

This commit is contained in:
Hendrik Schutter 2023-01-11 20:33:17 +01:00
parent ff7b95c032
commit a1369c5ac9
2 changed files with 3 additions and 2 deletions

View File

@ -24,6 +24,8 @@ startTime = datetime.now()
eq3bt_metrics = list()
mutex = threading.Lock()
thermostat = Thermostat(eq3bt_mac)
class RequestHandler(BaseHTTPRequestHandler):
def get_metrics(self):
@ -75,7 +77,6 @@ def update_metrics():
eq3bt_metrics.clear()
try:
thermostat = Thermostat(eq3bt_mac)
thermostat.update()
eq3bt_metrics.append("target_temperature " + str(int(thermostat.target_temperature)))
eq3bt_metrics.append("valve " + str(int(thermostat.valve_state)))

View File

@ -1,5 +1,5 @@
[Unit]
Description=Prometheus gas station exporter for fuel prices
Description=Prometheus eq3bt exporter for thermostats
Documentation=https://git.mosad.xyz/localhorst/eq3bt-exporter
Wants=network-online.target
After=network-online.target