@daemonitor/plugins 1.0.1 → 1.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.
@@ -19,7 +19,8 @@ export class EwelinkPlugin extends MonitoringPlugin {
19
19
  email: process.env.EWELINK_EMAIL,
20
20
  password: process.env.EWELINK_PASSWORD
21
21
  });
22
- this.refresh().then(() => { });
22
+ this.refresh().then(() => {
23
+ });
23
24
  return Promise.resolve();
24
25
  }
25
26
  async get(key) {
@@ -39,9 +40,11 @@ export class EwelinkPlugin extends MonitoringPlugin {
39
40
  async refresh() {
40
41
  /* get all devices */
41
42
  return this.connection.getDevices().then((devices) => {
42
- this.devices = devices;
43
- for (const device of this.devices) {
44
- this.send(device, device.deviceid);
43
+ if (Array.isArray(devices)) {
44
+ this.devices = devices;
45
+ for (const device of this.devices) {
46
+ this.send(device, device.deviceid);
47
+ }
45
48
  }
46
49
  });
47
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daemonitor/plugins",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "daemonitor plugins",
5
5
  "types": "types/index.d.ts",
6
6
  "main": "dist/index.js",