fix service file and init of lib
This commit is contained in:
parent
ff7b95c032
commit
a1369c5ac9
|
@ -24,6 +24,8 @@ startTime = datetime.now()
|
||||||
eq3bt_metrics = list()
|
eq3bt_metrics = list()
|
||||||
mutex = threading.Lock()
|
mutex = threading.Lock()
|
||||||
|
|
||||||
|
thermostat = Thermostat(eq3bt_mac)
|
||||||
|
|
||||||
class RequestHandler(BaseHTTPRequestHandler):
|
class RequestHandler(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
def get_metrics(self):
|
def get_metrics(self):
|
||||||
|
@ -75,7 +77,6 @@ def update_metrics():
|
||||||
eq3bt_metrics.clear()
|
eq3bt_metrics.clear()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
thermostat = Thermostat(eq3bt_mac)
|
|
||||||
thermostat.update()
|
thermostat.update()
|
||||||
eq3bt_metrics.append("target_temperature " + str(int(thermostat.target_temperature)))
|
eq3bt_metrics.append("target_temperature " + str(int(thermostat.target_temperature)))
|
||||||
eq3bt_metrics.append("valve " + str(int(thermostat.valve_state)))
|
eq3bt_metrics.append("valve " + str(int(thermostat.valve_state)))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Prometheus gas station exporter for fuel prices
|
Description=Prometheus eq3bt exporter for thermostats
|
||||||
Documentation=https://git.mosad.xyz/localhorst/eq3bt-exporter
|
Documentation=https://git.mosad.xyz/localhorst/eq3bt-exporter
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
Loading…
Reference in New Issue