Skip to content

Commit

Permalink
feat(mqtt): add client ID to variables available to payload template
Browse files Browse the repository at this point in the history
  • Loading branch information
activeshadow committed Aug 17, 2023
1 parent 209cd88 commit 90f3c4b
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 90f3c4b

Please sign in to comment.