From 690a0718a841f17986ce03a155bb1f714a1daeeb Mon Sep 17 00:00:00 2001 From: Jordan Hotmann Date: Thu, 19 Sep 2024 11:54:37 -0600 Subject: [PATCH] Attribute topic type --- Taskfile.yml | 12 ++++++++++++ pkg/nats/subscribers.go | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 Taskfile.yml diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..c2e499d --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,12 @@ +version: '3' + +tasks: + tag: + cmds: + - git tag {{.VERSION}} + - git push origin {{.VERSION}} + requires: + vars: [VERSION] + tags: + cmds: + - git --no-pager tag --list diff --git a/pkg/nats/subscribers.go b/pkg/nats/subscribers.go index fe24195..9c9c9c8 100644 --- a/pkg/nats/subscribers.go +++ b/pkg/nats/subscribers.go @@ -11,6 +11,7 @@ import ( type TopicType string const StateTopicType TopicType = "states" +const AttributeTopicType TopicType = "attributes" const TimerTopicType TopicType = "timers" const ScheduleTopicType TopicType = "schedules" const CommandTopicType TopicType = "command" @@ -23,6 +24,8 @@ func (t TopicType) GetTopic(id string) string { switch t { case StateTopicType: return fmt.Sprintf("homeassistant.%s.%s.>", t, id) + case AttributeTopicType: + return fmt.Sprintf("homeassistant.%s.%s.>", t, id) case TimerTopicType: return fmt.Sprintf("homeassistant.%s.%s.finished", t, id) case ScheduleTopicType, CommandTopicType: