This commit is contained in:
2023-10-02 20:06:29 +02:00
parent 62f904d7df
commit 56ea217f4c
@@ -40,10 +40,9 @@ while True:
data = json.dumps({'payload': 'RING', 'topic': 'lewe/doorbell', 'retain': 'False'}).encode('utf8')
request = urllib.request.Request("localhost:8123/api/services/mqtt/publish", data, headers)
# request = urllib.request.Request("https://www.nodebucket.de:8123/api/services/mqtt/publish", data, headers)
response = urllib.request.urlopen(reqest)
response = urllib.request.urlopen(request)
except Exception as err:
logger.error("Could not ring doorbell")
logger.error(err.message)
time.sleep(300)
else:
logger.info(data)