aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mqtt_watch.py
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2023-02-04 14:18:18 +0100
committerDennis Eriksen <d@ennis.no>2023-02-04 14:18:18 +0100
commiteb5e90aded9a7259ddecc94d9244393fa5abd2e6 (patch)
tree8e166a3bec6435c1490cff04cd704ae847b47eba /scripts/mqtt_watch.py
parentqueue sleep as variable (diff)
downloadenergyscripts-eb5e90aded9a7259ddecc94d9244393fa5abd2e6.tar.gz
moving some variables around
Diffstat (limited to 'scripts/mqtt_watch.py')
-rw-r--r--scripts/mqtt_watch.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/mqtt_watch.py b/scripts/mqtt_watch.py
index e460f13..775b84a 100644
--- a/scripts/mqtt_watch.py
+++ b/scripts/mqtt_watch.py
@@ -2,11 +2,9 @@
''' Listen for mqtt-events, and trigger for some '''
import os
-import json
-from datetime import datetime
import paho.mqtt.client as mqtt
-from common import dbi
+import common
mqtt_server = os.environ['el_mqtt_server']
mqtt_port = int(os.environ['el_mqtt_port'])
@@ -23,8 +21,6 @@ def on_connect(client, userdata, flags, rc):
# The callback for when a PUBLISH message is received from the server.
def on_message(client, userdata, msg):
- name = msg.topic.split('/')[1]
- #data = json.loads(msg.payload)
print(msg.topic, msg.payload)
@@ -39,7 +35,7 @@ def on_message(client, userdata, msg):
#else:
# return
- #dbi(sql, values, verbose=True)
+ #common.dbi(sql, values, verbose=True)