-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
app.js
42 lines (31 loc) · 912 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"use strict";
const Homey = require("homey");
const flowActions = require('./lib/flows/actions');
const flowConditions = require('./lib/flows/conditions');
let _devices = [];
class App extends Homey.App {
log() {
console.log.bind(this, "[log]").apply(this, arguments);
}
error() {
console.error.bind(this, "[error]").apply(this, arguments);
}
// -------------------- INIT ----------------------
async onInit() {
this.log(`${this.homey.manifest.id} - ${this.homey.manifest.version} started...`);
this.debugLogs = false;
await flowActions.init(this.homey);
await flowConditions.init(this.homey);;
}
// ---------------------------- GETTERS/SETTERS ----------------------------------
setDevices(device) {
_devices.push(device);
}
getDevices() {
return _devices;
}
setDebugLogging(debug) {
this.debugLogs = debug;
}
}
module.exports = App;