Skip to content

Commit

Permalink
Add client ID to template variables available to payload template
Browse files Browse the repository at this point in the history
  • Loading branch information
activeshadow committed Aug 4, 2023
1 parent df307b8 commit f89139c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/go/mqtt/mqtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func init() {
type data struct {
Epoch int64
Timestamp string
Client string
Topic string
Value any
}
Expand Down Expand Up @@ -208,6 +209,7 @@ func (this *MQTTClient) Run(ctx context.Context, pubEndpoint, _ string) error {
pdata := data{
Epoch: tstamp.Unix(),
Timestamp: tstamp.Format(this.timestampTmpl),
Client: this.id,
Topic: topic,
Value: val,
}
Expand Down

0 comments on commit f89139c

Please sign in to comment.