1
0
Fork 0

Attribute topic type

main v0.24.1
Jordan Hotmann 2024-09-19 11:54:37 -06:00
parent 034b4dcc93
commit 690a0718a8
No known key found for this signature in database
GPG Key ID: 01B504170C2A2EA3
2 changed files with 15 additions and 0 deletions

12
Taskfile.yml Normal file
View File

@ -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

View File

@ -11,6 +11,7 @@ import (
type TopicType string type TopicType string
const StateTopicType TopicType = "states" const StateTopicType TopicType = "states"
const AttributeTopicType TopicType = "attributes"
const TimerTopicType TopicType = "timers" const TimerTopicType TopicType = "timers"
const ScheduleTopicType TopicType = "schedules" const ScheduleTopicType TopicType = "schedules"
const CommandTopicType TopicType = "command" const CommandTopicType TopicType = "command"
@ -23,6 +24,8 @@ func (t TopicType) GetTopic(id string) string {
switch t { switch t {
case StateTopicType: case StateTopicType:
return fmt.Sprintf("homeassistant.%s.%s.>", t, id) return fmt.Sprintf("homeassistant.%s.%s.>", t, id)
case AttributeTopicType:
return fmt.Sprintf("homeassistant.%s.%s.>", t, id)
case TimerTopicType: case TimerTopicType:
return fmt.Sprintf("homeassistant.%s.%s.finished", t, id) return fmt.Sprintf("homeassistant.%s.%s.finished", t, id)
case ScheduleTopicType, CommandTopicType: case ScheduleTopicType, CommandTopicType: