homey-api 1.5.2 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1038,6 +1038,12 @@
|
|
|
1038
1038
|
"private": true,
|
|
1039
1039
|
"parameters": {}
|
|
1040
1040
|
},
|
|
1041
|
+
"getAppDriversStatistics": {
|
|
1042
|
+
"path": "/stats/app-drivers",
|
|
1043
|
+
"method": "get",
|
|
1044
|
+
"private": true,
|
|
1045
|
+
"parameters": {}
|
|
1046
|
+
},
|
|
1041
1047
|
"getLocationStatistics": {
|
|
1042
1048
|
"path": "/stats/locations",
|
|
1043
1049
|
"method": "get",
|
package/lib/AthomCloudAPI.js
CHANGED
|
@@ -57,16 +57,16 @@ if (!loggedIn) {
|
|
|
57
57
|
const user = await cloudApi.getAuthenticatedUser();
|
|
58
58
|
|
|
59
59
|
// Get the first Homey of the logged in user
|
|
60
|
-
const
|
|
60
|
+
const homey = await user.getFirstHomey();
|
|
61
61
|
|
|
62
62
|
// Create a session on this Homey
|
|
63
|
-
const
|
|
63
|
+
const homeyApi = await homey.authenticate();
|
|
64
64
|
|
|
65
65
|
// Loop all devices
|
|
66
|
-
const devices = await
|
|
66
|
+
const devices = await homeyApi.devices.getDevices();
|
|
67
67
|
for(const device of Object.values(devices)) {
|
|
68
68
|
// Turn device on
|
|
69
|
-
await device.setCapabilityValue('onoff', true);
|
|
69
|
+
await device.setCapabilityValue({ capabilityId: 'onoff', value: true });
|
|
70
70
|
}`;
|
|
71
71
|
|
|
72
72
|
static JSDOC_PARAMS = `
|