Fixed ntfy not working when deployed
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Dreaded_X 2022-09-17 03:55:10 +02:00
parent 748e12b1e3
commit 8b9e139b36
Signed by: Dreaded_X
GPG Key ID: 76BDEC4E165D8AD9
2 changed files with 2 additions and 3 deletions

View File

@ -27,6 +27,8 @@ steps:
from_secret: MQTT_PASS from_secret: MQTT_PASS
HUE_BRIDGE: HUE_BRIDGE:
from_secret: HUE_BRIDGE from_secret: HUE_BRIDGE
NTFY_TOPIC:
from_secret: NTFY_TOPIC
commands: commands:
- docker stop automation || true - docker stop automation || true

View File

@ -99,8 +99,6 @@ func (ntfy *ntfy) notifyPresence(home bool) {
actions = "broadcast, Set as home, extras.cmd=presence, extras.state=1, clear=true" 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)) req, err := http.NewRequest("POST", fmt.Sprintf("https://ntfy.sh/%s", ntfy.topic), strings.NewReader(description))
if err != nil { if err != nil {
panic(err) panic(err)
@ -163,7 +161,6 @@ func connectMQTT() MQTT.Client {
func connectNtfy() ntfy { func connectNtfy() ntfy {
topic, _ := os.LookupEnv("NTFY_TOPIC") topic, _ := os.LookupEnv("NTFY_TOPIC")
fmt.Println(topic)
ntfy := ntfy{topic} ntfy := ntfy{topic}
// @TODO Make sure the topic is valid? // @TODO Make sure the topic is valid?