Update doorbell.py
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user