forked from Zsoltt-dom/MiTempHum-Homey
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
31 lines (23 loc) · 713 Bytes
/
app.js
File metadata and controls
31 lines (23 loc) · 713 Bytes
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
'use strict';
const Homey = require('homey');
const { Device } = require('homey');
const { workerData } = require('worker_threads');
const SERVICE_UUID = '181a';
// Capture the original method for setWarning to prevent errors : Not Found: Device with ID
const originalSetWarning = Device.prototype.setWarning;
Device.prototype.setWarning = async function(message) {
try {
await originalSetWarning.call(this, message);
} catch (err) {
this.log(`Suppressed setWarning error: ${err.message}`);
}
};
class MyApp extends Homey.App {
/**
* onInit is called when the app is initialized.
*/
async onInit() {
this.log('Xiaomi Mijia has been initialized');
}
}
module.exports = MyApp;