Skip to content

Commit

Permalink
Merge pull request #192 from gustavosbarreto/missing_device_attributes
Browse files Browse the repository at this point in the history
client: also send device-attributes in state report
  • Loading branch information
otavio committed Feb 27, 2018
2 parents 3aa5712 + ecd1d80 commit 9f213b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (u *ReportClient) ReportState(api ApiRequester, packageUID string, previous
data["previous-state"] = previousState
data["package-uid"] = packageUID
data["error-message"] = errorMessage

data["device-attributes"] = fm.DeviceAttributes
data["product-uid"] = fm.ProductUID
data["device-identity"] = fm.DeviceIdentity
data["version"] = fm.Version
Expand Down
1 change: 1 addition & 0 deletions client/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func TestReportState(t *testing.T) {
expectedBody["hardware"] = "board"
expectedBody["product-uid"] = "229ffd7e08721d716163fc81a2dbaf6c90d449f0a3b009b6a2defe8a0b0d7381"
expectedBody["device-identity"] = map[string]interface{}{"id1": "value1"}
expectedBody["device-attributes"] = map[string]interface{}{"attr1": "value1", "attr2": "value2"}
expectedBody["previous-state"] = "previous_state"

assert.Equal(t, expectedBody, body)
Expand Down

0 comments on commit 9f213b7

Please sign in to comment.