24 lines
386 B
Go
24 lines
386 B
Go
package mood
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.lorenzzz.dev/lorenzhohermuth/home-assistant/pkg/http"
|
|
)
|
|
|
|
var key = "mood"
|
|
var moods = []string{"relax"}
|
|
var eventName = "SET_MOOD_EVENT"
|
|
|
|
func createBody(mood string) string {
|
|
return fmt.Sprintf("{\"%s\": \"%s\"}", key, mood)
|
|
}
|
|
|
|
func GetMoods() []string {
|
|
return moods
|
|
}
|
|
|
|
func SetMood(mood string) {
|
|
http.FireEvent(eventName, createBody(mood))
|
|
}
|