Update doorbell.py

This commit is contained in:
2020-09-02 14:45:00 +00:00
parent 4c004bacfe
commit d5afefd458
+2
View File
@@ -5,6 +5,7 @@
import serial
import urllib.request
import logging
import time
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s - %(message)s')
logging.info('Initializing')
@@ -21,5 +22,6 @@ while True:
response = urllib.request.urlopen('http://192.168.178.51/bell/on', timeout=5).read().decode('utf-8')
except Exception:
logging.exception("Could not ring doorbell")
time.sleep(300)
else:
logging.info(data)