Skip to content

Commit cd1ab56

Browse files
committed
fix(configure-device): shadow version not needed
Closes #143
1 parent d1d379e commit cd1ab56

File tree

5 files changed

+5
-12
lines changed

5 files changed

+5
-12
lines changed

features/DeviceConfiguration.feature.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ When I send this message via the websocket
3434
"payload": {
3535
"@context": "https://github.com/hello-nrfcloud/proto/configure-device",
3636
"id": "${fingerprint_deviceId}",
37-
"shadowVersion": 8835,
3837
"configuration": {
3938
"gnss": true
4039
}
@@ -50,7 +49,6 @@ Soon I should receive a message on the websocket that matches
5049
{
5150
"@context": "https://github.com/hello-nrfcloud/proto/device-configured",
5251
"id": "${fingerprint_deviceId}",
53-
"shadowVersion": 8836,
5452
"configuration": { "gnss": true }
5553
}
5654
```
@@ -62,7 +60,6 @@ Soon the nRF Cloud API should have been called with
6260
```
6361
PATCH /v1/devices/${fingerprint_deviceId}/state HTTP/1.1
6462
Content-Type: application/json
65-
If-Match: 8835
6663
6764
{"desired":{"config":{"nod":null}}}
6865
```

lambda/configureDevice.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ const h = async (
6767
deviceId,
6868
message: {
6969
request: {
70-
shadowVersion,
7170
configuration: { gnss },
7271
},
7372
},
@@ -95,7 +94,6 @@ const h = async (
9594
const res = await fetch(url, {
9695
method: 'PATCH',
9796
headers: {
98-
'If-Match': shadowVersion.toString(),
9997
'Content-Type': 'application/json',
10098
Authorization: `Bearer ${apiKey}`,
10199
},
@@ -107,7 +105,6 @@ const h = async (
107105
const message: Static<typeof DeviceConfigured> = {
108106
...event.detail.message.request,
109107
'@context': Context.deviceConfigured.toString(),
110-
shadowVersion: event.detail.message.request.shadowVersion + 1,
111108
}
112109
await eventBus.putEvents({
113110
Entries: [

nrfcloud/apiClient.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ export const apiClient = ({
118118
{
119119
headers: {
120120
...headers,
121-
'If-Match': version.toString(),
122121
'Content-Type': 'application/json',
123122
},
124123
method: 'PATCH',

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"prettier": "@nordicsemiconductor/asset-tracker-cloud-code-style/.prettierrc",
119119
"dependencies": {
120120
"@aws-lambda-powertools/metrics": "1.12.1",
121-
"@hello.nrfcloud.com/proto": "3.2.1",
121+
"@hello.nrfcloud.com/proto": "3.2.2",
122122
"@middy/core": "4.5.5",
123123
"@nordicsemiconductor/from-env": "2.0.0",
124124
"@nordicsemiconductor/timestream-helpers": "5.0.0",

0 commit comments

Comments
 (0)