add flags for bin colors

This commit is contained in:
l.weber 2025-08-12 11:16:40 +02:00
parent cb42bee299
commit e88668207f
2 changed files with 30 additions and 7 deletions

26
ntfy.go
View file

@ -8,23 +8,37 @@ import (
var NotifyChannel string
func SendAwlNotification(binColors []string) error {
func SendAwlNotification(binColors []string, pink, yellow, blue, gray, brown bool) error {
var bins = make([]string, 0, 5)
for _, color := range binColors {
switch color {
case "pink":
bins = append(bins, "🟣 Pink")
if pink {
bins = append(bins, "🟣 Pink")
}
case "gelb":
bins = append(bins, "🟡 Gelb")
if yellow {
bins = append(bins, "🟡 Gelb")
}
case "blau":
bins = append(bins, "🔵 Blau")
if blue {
bins = append(bins, "🔵 Blau")
}
case "grau":
bins = append(bins, "⚫ Grau")
if gray {
bins = append(bins, "⚫ Grau")
}
case "braun":
bins = append(bins, "🟤 Braun")
if brown {
bins = append(bins, "🟤 Braun")
}
}
}
if len(bins) == 0 {
return nil
}
var message string
if len(bins) == 1 {
message = "Morgen wird folgende Tonne abgeholt: "