View datapoint values

This commit is contained in:
Magnus Åhall 2024-05-05 20:16:28 +02:00
parent 5f6a48e7e0
commit d72694a8b4
14 changed files with 288 additions and 28 deletions

View file

@ -44,7 +44,7 @@ func (ntfy *NTFY) GetPrio() int {
return ntfy.Prio
}
func (ntfy NTFY) Send(uuid string, msg []byte) (err error) {
func (ntfy NTFY) Send(problemID int, msg []byte) (err error) {
var req *http.Request
var res *http.Response
req, err = http.NewRequest("POST", ntfy.URL, bytes.NewReader(msg))
@ -53,9 +53,9 @@ func (ntfy NTFY) Send(uuid string, msg []byte) (err error) {
return
}
ackURL := fmt.Sprintf("http, OK, %s/notification/ack?uuid=%s", ntfy.AcknowledgeURL, uuid)
ackURL := fmt.Sprintf("http, OK, %s/notification/ack?problemID=%d", ntfy.AcknowledgeURL, problemID)
req.Header.Add("X-Actions", ackURL)
req.Header.Add("X-Priority", "3") // XXX: should be 5
req.Header.Add("X-Priority", "4") // XXX: should be 5
req.Header.Add("X-Tags", "calendar")
res, err = http.DefaultClient.Do(req)