homey-api 3.0.0 → 3.0.2
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.
- package/assets/specifications/HomeyAPIV3Local.json +0 -22
- package/assets/types/homey-api.d.ts +222 -222
- package/assets/types/homey-api.private.d.ts +222 -222
- package/lib/AthomCloudAPI/User.js +4 -0
- package/lib/HomeyAPI/HomeyAPI.js +17 -2
- package/lib/HomeyAPI/HomeyAPIV2/Manager.js +1 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerDevices.js +2 -2
- package/lib/HomeyAPI/HomeyAPIV2/ManagerDevkit.js +9 -0
- package/lib/HomeyAPI/HomeyAPIV2/ManagerFlow.js +2 -2
- package/lib/HomeyAPI/HomeyAPIV2.js +2 -0
- package/lib/HomeyAPI/HomeyAPIV3/Item.js +43 -4
- package/lib/HomeyAPI/HomeyAPIV3/Manager.js +19 -3
- package/lib/HomeyAPI/HomeyAPIV3/ManagerApps/App.js +14 -4
- package/lib/HomeyAPI/HomeyAPIV3/ManagerDevices/Capability.js +6 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerDevices/Device.js +26 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerDevices/DeviceCapability.js +1 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerDrivers/Driver.js +6 -1
- package/lib/HomeyAPI/HomeyAPIV3/ManagerDrivers/PairSession.js +6 -1
- package/lib/HomeyAPI/HomeyAPIV3/ManagerDrivers.js +6 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/AdvancedFlow.js +10 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/Flow.js +7 -1
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/FlowCard.js +6 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/FlowCardAction.js +6 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/FlowCardCondition.js +6 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlow/FlowCardTrigger.js +6 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerFlowToken/FlowToken.js +6 -0
- package/lib/HomeyAPI/HomeyAPIV3/ManagerInsights/Log.js +6 -0
- package/lib/HomeyAPI/HomeyAPIV3.js +7 -3
- package/lib/HomeyAPI/HomeyAPIV3Cloud/Item.js +6 -0
- package/lib/HomeyAPI/HomeyAPIV3Local/Item.js +6 -0
- package/lib/HomeyAPI/HomeyAPIV3Local/ManagerDevkit.js +12 -2
- package/package.json +1 -1
package/lib/HomeyAPI/HomeyAPI.js
CHANGED
|
@@ -80,8 +80,15 @@ class HomeyAPI {
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
// Set Language
|
|
83
|
-
Object.defineProperty(this, '
|
|
84
|
-
value: properties.
|
|
83
|
+
Object.defineProperty(this, 'language', {
|
|
84
|
+
value: properties.language ?? null,
|
|
85
|
+
enumerable: true,
|
|
86
|
+
writable: true,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// Set Role
|
|
90
|
+
Object.defineProperty(this, 'role', {
|
|
91
|
+
value: properties.role ?? null,
|
|
85
92
|
enumerable: true,
|
|
86
93
|
writable: true,
|
|
87
94
|
});
|
|
@@ -158,6 +165,14 @@ class HomeyAPI {
|
|
|
158
165
|
return null;
|
|
159
166
|
}
|
|
160
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Check the current role.
|
|
170
|
+
* @param {string} roleId - The role ID, e.g. `owner`, `manager`, `user` or `guest`.
|
|
171
|
+
*/
|
|
172
|
+
hasRole(roleId) {
|
|
173
|
+
return this.role === roleId;
|
|
174
|
+
}
|
|
175
|
+
|
|
161
176
|
/**
|
|
162
177
|
* Creates a {@link HomeyAPIV3Local} or {@link HomeyAPIV2} instance for use in the Apps SDK.
|
|
163
178
|
* @param {Object} opts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const ManagerDevicesV3 = require('../HomeyAPIV3/ManagerDevices');
|
|
4
4
|
const Capability = require('./ManagerDevices/Capability');
|
|
5
5
|
const Device = require('./ManagerDevices/Device');
|
|
6
6
|
|
|
7
|
-
class ManagerDevices extends
|
|
7
|
+
class ManagerDevices extends ManagerDevicesV3 {
|
|
8
8
|
|
|
9
9
|
static CRUD = {
|
|
10
10
|
...super.CRUD,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const ManagerFlowV3 = require('../HomeyAPIV3/ManagerFlow');
|
|
4
4
|
const Flow = require('./ManagerFlow/Flow');
|
|
5
5
|
const AdvancedFlow = require('./ManagerFlow/AdvancedFlow');
|
|
6
6
|
const FlowCardTrigger = require('./ManagerFlow/FlowCardTrigger');
|
|
7
7
|
const FlowCardCondition = require('./ManagerFlow/FlowCardCondition');
|
|
8
8
|
const FlowCardAction = require('./ManagerFlow/FlowCardAction');
|
|
9
9
|
|
|
10
|
-
class ManagerFlow extends
|
|
10
|
+
class ManagerFlow extends ManagerFlowV3 {
|
|
11
11
|
|
|
12
12
|
static CRUD = {
|
|
13
13
|
...super.CRUD,
|
|
@@ -5,6 +5,7 @@ const ManagerFlow = require('./HomeyAPIV2/ManagerFlow');
|
|
|
5
5
|
const ManagerFlowToken = require('./HomeyAPIV2/ManagerFlowToken');
|
|
6
6
|
const ManagerDevices = require('./HomeyAPIV2/ManagerDevices');
|
|
7
7
|
const ManagerDrivers = require('./HomeyAPIV2/ManagerDrivers');
|
|
8
|
+
const ManagerDevkit = require('./HomeyAPIV2/ManagerDevkit');
|
|
8
9
|
const ManagerInsights = require('./HomeyAPIV2/ManagerInsights');
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -22,6 +23,7 @@ class HomeyAPIV2 extends HomeyAPIV3 {
|
|
|
22
23
|
ManagerFlowToken,
|
|
23
24
|
ManagerDevices,
|
|
24
25
|
ManagerDrivers,
|
|
26
|
+
ManagerDevkit,
|
|
25
27
|
ManagerInsights,
|
|
26
28
|
};
|
|
27
29
|
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
const EventEmitter = require('../../EventEmitter');
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* A superclass for all CRUD Items.
|
|
7
|
+
* @class
|
|
8
|
+
* @hideconstructor
|
|
9
|
+
* @memberof HomeyAPIV3
|
|
10
|
+
*/
|
|
5
11
|
class Item extends EventEmitter {
|
|
6
12
|
|
|
7
13
|
static ID = null; // Set by Manager.js
|
|
@@ -14,22 +20,21 @@ class Item extends EventEmitter {
|
|
|
14
20
|
}) {
|
|
15
21
|
super();
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
Object.defineProperty(this, 'id', {
|
|
23
|
+
Object.defineProperty(this, '__id', {
|
|
19
24
|
value: id,
|
|
20
25
|
enumerable: true,
|
|
21
26
|
writable: false,
|
|
22
27
|
});
|
|
23
28
|
|
|
24
29
|
// Set Homey
|
|
25
|
-
Object.defineProperty(this, '
|
|
30
|
+
Object.defineProperty(this, '__homey', {
|
|
26
31
|
value: homey,
|
|
27
32
|
enumerable: false,
|
|
28
33
|
writable: false,
|
|
29
34
|
});
|
|
30
35
|
|
|
31
36
|
// Set Manager
|
|
32
|
-
Object.defineProperty(this, '
|
|
37
|
+
Object.defineProperty(this, '__manager', {
|
|
33
38
|
value: manager,
|
|
34
39
|
enumerable: false,
|
|
35
40
|
writable: false,
|
|
@@ -54,10 +59,38 @@ class Item extends EventEmitter {
|
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
61
|
|
|
62
|
+
/**
|
|
63
|
+
* The ID of the Item.
|
|
64
|
+
* @type {String}
|
|
65
|
+
*/
|
|
66
|
+
get id() {
|
|
67
|
+
return this.__id;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The URI of the Item, e.g. `homey:foo:bar`.
|
|
72
|
+
* @type {String}
|
|
73
|
+
*/
|
|
57
74
|
get uri() {
|
|
58
75
|
return `homey:${this.constructor.ID}:${this.id}`;
|
|
59
76
|
}
|
|
60
77
|
|
|
78
|
+
/**
|
|
79
|
+
* The Manager of the Item.
|
|
80
|
+
* @type {HomeyAPIV3.Manager}
|
|
81
|
+
*/
|
|
82
|
+
get manager() {
|
|
83
|
+
return this.__manager;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The Homey of the Item.
|
|
88
|
+
* @type {HomeyAPIV3}
|
|
89
|
+
*/
|
|
90
|
+
get homey() {
|
|
91
|
+
return this.__homey;
|
|
92
|
+
}
|
|
93
|
+
|
|
61
94
|
__debug(...props) {
|
|
62
95
|
this.manager.__debug(`[${this.constructor.name}:${this.id}]`, ...props);
|
|
63
96
|
}
|
|
@@ -77,6 +110,9 @@ class Item extends EventEmitter {
|
|
|
77
110
|
this.emit('delete');
|
|
78
111
|
}
|
|
79
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Connect to this item's Socket.io namespace.
|
|
115
|
+
*/
|
|
80
116
|
async connect() {
|
|
81
117
|
this.__debug('connect');
|
|
82
118
|
|
|
@@ -130,6 +166,9 @@ class Item extends EventEmitter {
|
|
|
130
166
|
await this.__connectPromise;
|
|
131
167
|
}
|
|
132
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Discconnect from this item's Socket.io namespace.
|
|
171
|
+
*/
|
|
133
172
|
async disconnect() {
|
|
134
173
|
this.__debug('disconnect');
|
|
135
174
|
|
|
@@ -12,6 +12,7 @@ const Item = require('./Item');
|
|
|
12
12
|
/**
|
|
13
13
|
* @class
|
|
14
14
|
* @hideconstructor
|
|
15
|
+
* @extends EventEmitter
|
|
15
16
|
* @memberof HomeyAPIV3
|
|
16
17
|
*/
|
|
17
18
|
class Manager extends EventEmitter {
|
|
@@ -27,7 +28,7 @@ class Manager extends EventEmitter {
|
|
|
27
28
|
super();
|
|
28
29
|
|
|
29
30
|
// Set Homey
|
|
30
|
-
Object.defineProperty(this, '
|
|
31
|
+
Object.defineProperty(this, '__homey', {
|
|
31
32
|
value: homey,
|
|
32
33
|
enumerable: false,
|
|
33
34
|
writable: false,
|
|
@@ -357,6 +358,18 @@ class Manager extends EventEmitter {
|
|
|
357
358
|
}
|
|
358
359
|
}
|
|
359
360
|
|
|
361
|
+
/**
|
|
362
|
+
* The Homey of the Manager.
|
|
363
|
+
* @type {HomeyAPIV3}
|
|
364
|
+
*/
|
|
365
|
+
get homey() {
|
|
366
|
+
return this.__homey;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* The URI of the Item, e.g. `homey:manager:bar`.
|
|
371
|
+
* @type {String}
|
|
372
|
+
*/
|
|
360
373
|
get uri() {
|
|
361
374
|
return `homey:manager:${this.constructor.ID}`;
|
|
362
375
|
}
|
|
@@ -374,7 +387,7 @@ class Manager extends EventEmitter {
|
|
|
374
387
|
}
|
|
375
388
|
|
|
376
389
|
/**
|
|
377
|
-
* Connect to
|
|
390
|
+
* Connect to this manager's Socket.io namespace.
|
|
378
391
|
* @returns {Promise<void>}
|
|
379
392
|
*/
|
|
380
393
|
async connect() {
|
|
@@ -476,7 +489,7 @@ class Manager extends EventEmitter {
|
|
|
476
489
|
}
|
|
477
490
|
|
|
478
491
|
/**
|
|
479
|
-
*
|
|
492
|
+
* Discconnect from this manager's Socket.io namespace.
|
|
480
493
|
* @returns {Promise<void>}
|
|
481
494
|
*/
|
|
482
495
|
async disconnect() {
|
|
@@ -509,6 +522,9 @@ class Manager extends EventEmitter {
|
|
|
509
522
|
await this.__disconnectPromise;
|
|
510
523
|
}
|
|
511
524
|
|
|
525
|
+
/**
|
|
526
|
+
* Destroy this Manager by cleaning up all references, unbinding event listeners and disconnecting from the Socket.io namespace.
|
|
527
|
+
*/
|
|
512
528
|
destroy() {
|
|
513
529
|
// Clear cache
|
|
514
530
|
for (const id of Object.keys(this.__cache)) {
|
|
@@ -2,8 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
const Item = require('../Item');
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @class
|
|
7
|
+
* @hideconstructor
|
|
8
|
+
* @extends HomeyAPIV3.Item
|
|
9
|
+
* @memberof HomeyAPIV3.ManagerApps
|
|
10
|
+
*/
|
|
5
11
|
class App extends Item {
|
|
6
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Call the app's API endpoint.
|
|
15
|
+
* @param {Object} opts
|
|
16
|
+
* @param {('GET'|'POST'|'PUT'|'DELETE')} opts.method HTTP Method of the API endpoint.
|
|
17
|
+
* @param {String} opts.path - Path to the API endpoint.
|
|
18
|
+
* @param {mixed} opts.body
|
|
19
|
+
* @returns {Promise<any>}
|
|
20
|
+
*/
|
|
7
21
|
async call({
|
|
8
22
|
method,
|
|
9
23
|
path,
|
|
@@ -35,7 +49,6 @@ class App extends Item {
|
|
|
35
49
|
* @param {object} opts
|
|
36
50
|
* @param {string} opts.path
|
|
37
51
|
* @returns {Promise<any>}
|
|
38
|
-
* @function HomeyAPIV2.ManagerApps.App#get
|
|
39
52
|
*/
|
|
40
53
|
async get({ path }) {
|
|
41
54
|
return this.call({
|
|
@@ -50,7 +63,6 @@ class App extends Item {
|
|
|
50
63
|
* @param {string} opts.path
|
|
51
64
|
* @param {object} opts.body
|
|
52
65
|
* @returns {Promise<any>}
|
|
53
|
-
* @function HomeyAPIV2.ManagerApps.App#post
|
|
54
66
|
*/
|
|
55
67
|
async post({ path, body }) {
|
|
56
68
|
return this.call({
|
|
@@ -66,7 +78,6 @@ class App extends Item {
|
|
|
66
78
|
* @param {string} opts.path
|
|
67
79
|
* @param {object} opts.body
|
|
68
80
|
* @returns {Promise<any>}
|
|
69
|
-
* @function HomeyAPIV2.ManagerApps.App#put
|
|
70
81
|
*/
|
|
71
82
|
async put({ path, body }) {
|
|
72
83
|
return this.call({
|
|
@@ -81,7 +92,6 @@ class App extends Item {
|
|
|
81
92
|
* @param {object} opts
|
|
82
93
|
* @param {string} opts.path
|
|
83
94
|
* @returns {Promise<any>}
|
|
84
|
-
* @function HomeyAPIV2.ManagerApps.App#delete
|
|
85
95
|
*/
|
|
86
96
|
async delete({ path }) {
|
|
87
97
|
return this.call({
|
|
@@ -4,6 +4,12 @@ const Util = require('../../../Util');
|
|
|
4
4
|
const Item = require('../Item');
|
|
5
5
|
const DeviceCapability = require('./DeviceCapability');
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @class
|
|
9
|
+
* @hideconstructor
|
|
10
|
+
* @extends HomeyAPIV3.Item
|
|
11
|
+
* @memberof HomeyAPIV3.ManagerDevices
|
|
12
|
+
*/
|
|
7
13
|
class Device extends Item {
|
|
8
14
|
|
|
9
15
|
constructor(...props) {
|
|
@@ -134,18 +140,30 @@ class Device extends Item {
|
|
|
134
140
|
}
|
|
135
141
|
}
|
|
136
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Get the device's zone.
|
|
145
|
+
* @returns {Promise<HomeyAPIV3.ManagerZones.Zone>}
|
|
146
|
+
*/
|
|
137
147
|
async getZone() {
|
|
138
148
|
return this.homey.zones.getZone({
|
|
139
149
|
id: this.zone,
|
|
140
150
|
});
|
|
141
151
|
}
|
|
142
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Get the device's driver.
|
|
155
|
+
* @returns {Promise<HomeyAPIV3.ManagerDrivers.Driver>}
|
|
156
|
+
*/
|
|
143
157
|
async getDriver() {
|
|
144
158
|
return this.homey.drivers.getDriver({
|
|
145
159
|
id: this.driverId,
|
|
146
160
|
});
|
|
147
161
|
}
|
|
148
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Get the device's logs.
|
|
165
|
+
* @returns {Promise<{String, HomeyAPIV3.ManagerInsights.Log}>}
|
|
166
|
+
*/
|
|
149
167
|
async getLogs() {
|
|
150
168
|
const logs = await this.homey.insights.getLogs();
|
|
151
169
|
return Object.values(logs)
|
|
@@ -156,6 +174,10 @@ class Device extends Item {
|
|
|
156
174
|
}), {});
|
|
157
175
|
}
|
|
158
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Get the device's flows.
|
|
179
|
+
* @returns {Promise<{String, HomeyAPIV3.ManagerFlow.Flow}>}
|
|
180
|
+
*/
|
|
159
181
|
async getFlows() {
|
|
160
182
|
const flows = await this.homey.flow.getFlows();
|
|
161
183
|
return Object.values(flows)
|
|
@@ -175,6 +197,10 @@ class Device extends Item {
|
|
|
175
197
|
}), {});
|
|
176
198
|
}
|
|
177
199
|
|
|
200
|
+
/**
|
|
201
|
+
* @returns {Promise<{String, HomeyAPIV3.ManagerFlow.AdvancedFlow}>}
|
|
202
|
+
* @returns {Promise<Object>}
|
|
203
|
+
*/
|
|
178
204
|
async getAdvancedFlows() {
|
|
179
205
|
const advancedFlows = await this.homey.flow.getAdvancedFlows();
|
|
180
206
|
return Object.values(advancedFlows)
|
|
@@ -4,6 +4,12 @@ const Manager = require('./Manager');
|
|
|
4
4
|
const Driver = require('./ManagerDrivers/Driver');
|
|
5
5
|
const PairSession = require('./ManagerDrivers/PairSession');
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @class
|
|
9
|
+
* @hideconstructor
|
|
10
|
+
* @extends HomeyAPIV3.Manager
|
|
11
|
+
* @memberof HomeyAPIV3
|
|
12
|
+
*/
|
|
7
13
|
class ManagerDrivers extends Manager {
|
|
8
14
|
|
|
9
15
|
static CRUD = {
|
|
@@ -4,8 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
const Item = require('../Item');
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @class
|
|
9
|
+
* @hideconstructor
|
|
10
|
+
* @extends HomeyAPIV3.Item
|
|
11
|
+
* @memberof HomeyAPIV3.ManagerFlow
|
|
12
|
+
*/
|
|
7
13
|
class AdvancedFlow extends Item {
|
|
8
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Check whether this Flow misses one or more {@link FlowCard} or {@link FlowToken}.
|
|
17
|
+
* @returns Promise<Boolean> - A boolean whether this Flow is broken.
|
|
18
|
+
*/
|
|
9
19
|
async isBroken() {
|
|
10
20
|
const managerFlow = this.homey.flow;
|
|
11
21
|
if (!managerFlow.isConnected()) {
|
|
@@ -4,11 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
const Item = require('../Item');
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @class
|
|
9
|
+
* @hideconstructor
|
|
10
|
+
* @extends HomeyAPIV3.Item
|
|
11
|
+
* @memberof HomeyAPIV3.ManagerFlow
|
|
12
|
+
*/
|
|
7
13
|
class Flow extends Item {
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
16
|
* Check whether this Flow misses one or more {@link FlowCard} or {@link FlowToken}.
|
|
11
|
-
* @returns Promise<Boolean>
|
|
17
|
+
* @returns Promise<Boolean> - A boolean whether this Flow is broken.
|
|
12
18
|
*/
|
|
13
19
|
async isBroken() {
|
|
14
20
|
const managerFlow = this.homey.flow;
|
|
@@ -395,9 +395,13 @@ class HomeyAPIV3 extends HomeyAPI {
|
|
|
395
395
|
headers['Authorization'] = `Bearer ${this.__token}`;
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
-
if (
|
|
399
|
-
|
|
400
|
-
|
|
398
|
+
if (['PUT', 'POST'].includes(method)) {
|
|
399
|
+
if (body && json === true) {
|
|
400
|
+
headers['Content-Type'] = 'application/json';
|
|
401
|
+
body = JSON.stringify(body);
|
|
402
|
+
}
|
|
403
|
+
} else {
|
|
404
|
+
body = undefined;
|
|
401
405
|
}
|
|
402
406
|
|
|
403
407
|
this.__debug(method, `${baseUrl}${path}`);
|
|
@@ -6,8 +6,18 @@ const Manager = require('./Manager');
|
|
|
6
6
|
|
|
7
7
|
class ManagerDevkit extends Manager {
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Upload & run an app on Homey Pro.
|
|
11
|
+
* @param {Object} opts
|
|
12
|
+
* @param {ReadableStream} opts.app - A .tar.gz filestream.
|
|
13
|
+
* @param {Object} opts.env - Environment variables.
|
|
14
|
+
* @param {Boolean} opts.debug - Enable debug mode.
|
|
15
|
+
* @param {Boolean} opts.clean - Purge all app settings before running the app.
|
|
16
|
+
* @returns {Promise<any>}
|
|
17
|
+
* @function HomeyAPIV3Local.ManagerDevkit#runApp
|
|
18
|
+
*/
|
|
9
19
|
async runApp({
|
|
10
|
-
app,
|
|
20
|
+
app,
|
|
11
21
|
env = {},
|
|
12
22
|
debug = false,
|
|
13
23
|
clean = false,
|
|
@@ -16,7 +26,7 @@ class ManagerDevkit extends Manager {
|
|
|
16
26
|
form.append('app', app);
|
|
17
27
|
form.append('env', JSON.stringify(env));
|
|
18
28
|
form.append('debug', debug ? 'true' : 'false');
|
|
19
|
-
form.append('
|
|
29
|
+
form.append('purgeSettings', clean ? 'true' : 'false');
|
|
20
30
|
|
|
21
31
|
return this.homey.call({
|
|
22
32
|
$timeout: 1000 * 60 * 5, // 5 minutes
|