Add authentication to ntfy
This commit is contained in:
parent
e854be1d3b
commit
b1f0d91d75
|
@ -16,6 +16,7 @@ eastPin = config['garage'].getint('east-pin')
|
||||||
westPin = config['garage'].getint('west-pin')
|
westPin = config['garage'].getint('west-pin')
|
||||||
ntfy = config['push'].get('ntfy')
|
ntfy = config['push'].get('ntfy')
|
||||||
topic = config['push'].get('topic')
|
topic = config['push'].get('topic')
|
||||||
|
auth = config['push'].get('auth')
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -70,7 +71,7 @@ def persistState():
|
||||||
|
|
||||||
def sendNotification():
|
def sendNotification():
|
||||||
requests.post(
|
requests.post(
|
||||||
url=f'https://{ntfy}/{topic}',
|
url=f'https://{ntfy}/{topic}?auth={auth}',
|
||||||
data='update'.encode(encoding='utf-8')
|
data='update'.encode(encoding='utf-8')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue