Skip to content

Commit 9861258

Browse files
committed
1 parent 468e04a commit 9861258

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/Services/cayenne.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,21 @@ class Cayenne {
236236
return this.auth.send(this.service, 'POST', url, { payload });
237237
}
238238

239+
/**
240+
* Pairs a thing to account
241+
* @param {Object} userId
242+
* @param {Object} thingId
243+
* @param {String} payload.name Thing's name
244+
* @param {String} payload.hardware_id Thing's unique hardware id
245+
* @param {String} payload.network Thing's network
246+
*/
247+
pairUpdateThing(userId, thingId, payload) {
248+
const url = `${this.url}/things/${thingId}/pair`;
249+
payload.user_id = userId;
250+
251+
return this.auth.send(this.service, 'PUT', url, { payload });
252+
}
253+
239254
/**
240255
* Gets a device properties by hardware id
241256
* @param {String} hardwareId Device's unique hardware id

0 commit comments

Comments
 (0)