feat(agent): display_state im Status-Report
This commit is contained in:
parent
1047572157
commit
a3255a0ced
1 changed files with 6 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ type Snapshot struct {
|
|||
HeartbeatEverySeconds int
|
||||
StartedAt time.Time
|
||||
LastHeartbeatAt time.Time
|
||||
DisplayState string
|
||||
}
|
||||
|
||||
type statusPayload struct {
|
||||
|
|
@ -31,6 +32,7 @@ type statusPayload struct {
|
|||
HeartbeatEverySeconds int `json:"heartbeat_every_seconds"`
|
||||
StartedAt string `json:"started_at,omitempty"`
|
||||
LastHeartbeatAt string `json:"last_heartbeat_at,omitempty"`
|
||||
DisplayState string `json:"display_state,omitempty"`
|
||||
}
|
||||
|
||||
// MQTTConfig holds the MQTT broker configuration returned by the server in the
|
||||
|
|
@ -138,5 +140,9 @@ func buildPayload(snapshot Snapshot, now time.Time) statusPayload {
|
|||
payload.LastHeartbeatAt = snapshot.LastHeartbeatAt.Format(time.RFC3339)
|
||||
}
|
||||
|
||||
if snapshot.DisplayState != "" {
|
||||
payload.DisplayState = snapshot.DisplayState
|
||||
}
|
||||
|
||||
return payload
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue