From 4704023e960a69659c15eee001e4d143078e7e4e Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Mon, 3 Jul 2023 14:11:10 -0400 Subject: [PATCH] Add ntfy authentication --- net/config.sample.py | 3 ++- net/ntfy.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/net/config.sample.py b/net/config.sample.py index 81324a4..d70fc98 100644 --- a/net/config.sample.py +++ b/net/config.sample.py @@ -9,5 +9,6 @@ secrets = { 'adafruit_io_username': '', 'adafruit_io_key': '', 'ntfy_host': '', - 'ntfy_topic': '' + 'ntfy_topic': '', + 'ntfy_auth': '' } diff --git a/net/ntfy.py b/net/ntfy.py index 7b43818..435cc09 100644 --- a/net/ntfy.py +++ b/net/ntfy.py @@ -11,7 +11,8 @@ class Ntfy: host = secrets['ntfy_host'] topic = secrets['ntfy_topic'] - self.url = f'https://{host}/{topic}' + auth = secrets['ntfy_auth'] + self.url = f'https://{host}/{topic}?auth={auth}' def message(self, message): result = self.sendMessage(message)