diff --git a/temperato.py b/temperato.py index f8bbf42..a0ae993 100644 --- a/temperato.py +++ b/temperato.py @@ -22,7 +22,6 @@ import threading import time import os import json -import xmpp from dotenv import load_dotenv load_dotenv() @@ -33,10 +32,6 @@ tick_threshold = 5 spi = board.SPI() cs = digitalio.DigitalInOut(getattr(board,os.environ.get('INPUT_PIN'))) sensor = adafruit_max31865.MAX31865(spi, cs, wires=3) -jid = xmpp.protocol.JID(os.environ.get('XMPP_SENDER')) -conn = xmpp.Client(server=jid.getDomain(), debug=False) -conn.connect() -conn.auth(user=jid.getNode(), password=os.environ.get('XMPP_SENDER_PASSWORD'), resource=jid.getResource()) class tempThread (threading.Thread): def run(self): @@ -50,7 +45,7 @@ class tempThread (threading.Thread): if ticks == tick_threshold: ticks = 0 - conn.send(xmpp.protocol.Message(to=os.environ.get('XMPP_RECEIVER'), body=os.environ.get('MESSAGE'))) + print(requests.post(os.environ.get('NOTIF_URL'), json={'message': os.environ.get('MESSAGE')})) time.sleep(sleep_timer) T_thread = tempThread()