Skip to content

Commit 2f48c76

Browse files
authored
Merge pull request #8 from myDevicesIoT/feat/add-delorean-state-api
Fix: add channel state api
2 parents 7036f13 + f746b93 commit 2f48c76

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/Services/delorean-es.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ class DeloreanES {
3737
return this.auth.send(this.service, 'GET', url, { query });
3838
}
3939

40+
/**
41+
* @param {String} userId
42+
* @param {String} deviceId
43+
* @param {String} channel
44+
* @param {Object} query
45+
* @param {String} query.event
46+
* @param {String} query.units
47+
*/
48+
getChannelState(userId, deviceId, channel, query) {
49+
const url = `${this.url}/devices/${deviceId}/channels/${channel}/state`;
50+
query = { ...query, user_id: userId };
51+
return this.auth.send(this.service, 'GET', url, { query });
52+
}
53+
4054
/**
4155
* @param {String} userId
4256
* @param {String} deviceIds

0 commit comments

Comments
 (0)