forked from PeterKawa/nl.onzewifi.timelinemanager2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.js
23 lines (22 loc) · 708 Bytes
/
api.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module.exports = {
async testCredentials({ homey, query }) {
const result = await homey.app.testCredentials(query.client_id, query.client_secret, query.username, query.password, query.otptoken);
if (!(result.failed)) {
var credentials = {}
credentials.client_id = query.client_id
credentials.client_secret = query.client_secret
credentials.username = query.username
credentials.password = query.password
await homey.settings.set('credentials', credentials)
}
return result;
},
async getlogs({ homey }) {
const result = await homey.app.getlogs();
return result;
},
async deletelogs({ homey }) {
const result = await homey.app.deletelogs();
return result;
}
};