From 909a440dc4d8c13acce5ee7f886d214c79e26d0f Mon Sep 17 00:00:00 2001 From: William Moore Date: Tue, 3 May 2022 10:21:55 -0500 Subject: [PATCH] Update to use more reliable endpoint concept --- temperato.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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()