Add timeout for pesky long running HTTP POST.
This commit is contained in:
parent
2ec9f47eb0
commit
730d5c7413
@ -34,7 +34,7 @@ class tempThread (threading.Thread):
|
||||
temp = sensor.temperature
|
||||
print(temp)
|
||||
if temp > set_point:
|
||||
requests.post(os.environ.get('NOTIF_URL'), data={'message': 'The water is too damn hot!', 'title': 'Water temperature'})
|
||||
requests.post(os.environ.get('NOTIF_URL'), data={'message': 'The water is too damn hot!', 'title': 'Water temperature'}, timeout=5)
|
||||
time.sleep(5)
|
||||
|
||||
T_thread = tempThread()
|
||||
|
Loading…
Reference in New Issue
Block a user