From ec179cf2670978d5460024404805f94c51d09ace Mon Sep 17 00:00:00 2001 From: William Moore Date: Tue, 1 Mar 2022 18:37:55 -0600 Subject: [PATCH] Convert over to using a bot. --- temperato.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/temperato.py b/temperato.py index 342b183..e8afd4e 100644 --- a/temperato.py +++ b/temperato.py @@ -35,7 +35,8 @@ class tempThread (threading.Thread): while True: temp = sensor.temperature if temp >= set_point: - print(requests.post(os.environ.get('NOTIF_URL'), headers={'Content-Type': 'application/json'}, data=json.dumps({'text': '@all The water is too damn hot!', 'channel': os.environ.get('CHANNEL_ID')}), timeout=5)) + print('Bearer ' + os.environ.get('ACCESS_TOKEN')) + print(requests.post(os.environ.get('NOTIF_URL'), headers={'Content-Type': 'application/json', 'Authorization': 'Bearer ' + os.environ.get('ACCESS_TOKEN')}, data=json.dumps({'message': '@all The water is too damn hot!', 'channel_id': os.environ.get('CHANNEL_ID')}), timeout=5)) time.sleep(sleep_timer) T_thread = tempThread()