-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
33 lines (25 loc) · 872 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
'use strict';
const Homey = require('homey');
const { Log } = require('homey-log');
const flowActions = require('./lib/flows/actions');
const flowConditions = require('./lib/flows/conditions');
class GoeCharger extends Homey.App {
/**
* onInit is called when the app is initialized.
*/
async onInit() {
this.log(`${this.homey.manifest.id} - ${this.homey.manifest.version} started...`);
this.homeyLog = new Log({ homey: this.homey });
await flowActions.init(this.homey);
await flowConditions.init(this.homey);
this.log('go-eCharger app has been initialized');
}
async sendNotification(message) {
await this.homey.notifications.createNotification({
excerpt: message,
}).catch((error) => {
this.log(`${this.homey.manifest.id} - ${this.homey.manifest.version} sendNotification - error: ${error}`);
});
}
}
module.exports = GoeCharger;