From 8b9e139b36c1504a900a5ceffb04cd6c12a0da1c Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Sat, 17 Sep 2022 03:55:10 +0200 Subject: [PATCH] Fixed ntfy not working when deployed --- .drone.yml | 2 ++ main.go | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 6a27825..2b80164 100644 --- a/.drone.yml +++ b/.drone.yml @@ -27,6 +27,8 @@ steps: from_secret: MQTT_PASS HUE_BRIDGE: from_secret: HUE_BRIDGE + NTFY_TOPIC: + from_secret: NTFY_TOPIC commands: - docker stop automation || true diff --git a/main.go b/main.go index d75ce15..7092afb 100644 --- a/main.go +++ b/main.go @@ -99,8 +99,6 @@ func (ntfy *ntfy) notifyPresence(home bool) { actions = "broadcast, Set as home, extras.cmd=presence, extras.state=1, clear=true" } - fmt.Printf("https://ntfy.sh/%s\n", ntfy.topic) - req, err := http.NewRequest("POST", fmt.Sprintf("https://ntfy.sh/%s", ntfy.topic), strings.NewReader(description)) if err != nil { panic(err) @@ -163,7 +161,6 @@ func connectMQTT() MQTT.Client { func connectNtfy() ntfy { topic, _ := os.LookupEnv("NTFY_TOPIC") - fmt.Println(topic) ntfy := ntfy{topic} // @TODO Make sure the topic is valid?