iobroker.device-watcher 2.9.1 → 2.9.3

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.
package/main.js CHANGED
@@ -412,7 +412,7 @@ class DeviceWatcher extends utils.Adapter {
412
412
  instanceData.isAlive = instanceStatusRaw[0];
413
413
  instanceData.isHealthy = instanceStatusRaw[1];
414
414
  instanceData.status = instanceStatusRaw[2];
415
-
415
+ instanceData.checkIsRunning = false;
416
416
  if (oldIsHealthyValue === instanceData.isHealthy) continue;
417
417
  // send message when instance was deactivated
418
418
  if (this.config.checkSendInstanceDeactivatedMsg && !instanceData.isAlive) {
@@ -424,8 +424,6 @@ class DeviceWatcher extends utils.Adapter {
424
424
  if (this.blacklistInstancesNotify.includes(instanceID)) continue;
425
425
  await this.sendStateNotifications('errorInstance', instanceID);
426
426
  }
427
-
428
- instanceData.checkIsRunning = false;
429
427
  }
430
428
  break;
431
429
  }
@@ -541,7 +539,7 @@ class DeviceWatcher extends utils.Adapter {
541
539
  deviceData.SignalStrength = contactData[2];
542
540
  }
543
541
  if (this.config.checkSendOfflineMsg && oldStatus !== deviceData.Status && !this.blacklistNotify.includes(deviceData.Path)) {
544
- if (deviceData.instanceDeviceConnectionDP !== undefined) {
542
+ if (deviceData.instanceDeviceConnectionDP.val !== undefined) {
545
543
  // check if the generally deviceData connected state is for a while true
546
544
  if (await this.getTimestampConnectionDP(deviceData.instanceDeviceConnectionDP, 20000)) {
547
545
  await this.sendStateNotifications('onlineStateDevice', device);
@@ -1425,7 +1423,7 @@ class DeviceWatcher extends utils.Adapter {
1425
1423
  }
1426
1424
  }
1427
1425
  } else {
1428
- if (deviceUnreachState === 0 && deviceTimeSelector) {
1426
+ if ((!deviceUnreachState || deviceUnreachState === 0) && deviceTimeSelector) {
1429
1427
  lastContactString = await this.getLastContact(deviceTimeSelector.lc);
1430
1428
  } else {
1431
1429
  if (deviceTimeSelector) lastContactString = await this.getLastContact(deviceTimeSelector.ts);
@@ -1482,6 +1480,7 @@ class DeviceWatcher extends utils.Adapter {
1482
1480
  case 'deconz':
1483
1481
  case 'shelly':
1484
1482
  case 'sonoff':
1483
+ case 'tradfri':
1485
1484
  case 'unifi':
1486
1485
  case 'zigbee':
1487
1486
  case 'zigbee2MQTT':
@@ -1604,10 +1603,12 @@ class DeviceWatcher extends utils.Adapter {
1604
1603
  }
1605
1604
  break;
1606
1605
  default:
1607
- if (deviceUpdateSelector) {
1608
- isUpgradable = true;
1609
- } else if (!deviceUpdateSelector) {
1610
- isUpgradable = false;
1606
+ if (deviceUpdateSelector !== null && typeof deviceUpdateSelector === 'boolean') {
1607
+ if (deviceUpdateSelector) {
1608
+ isUpgradable = true;
1609
+ } else if (!deviceUpdateSelector) {
1610
+ isUpgradable = false;
1611
+ }
1611
1612
  }
1612
1613
  }
1613
1614
 
@@ -2245,7 +2246,6 @@ class DeviceWatcher extends utils.Adapter {
2245
2246
  let daemonIsNotAlive;
2246
2247
  let instanceDeactivationTime = (this.config.offlineTimeInstances * 1000) / 2;
2247
2248
  let instanceErrorTime = (this.config.errorTimeInstances * 1000) / 2;
2248
-
2249
2249
  switch (instanceMode) {
2250
2250
  case 'schedule':
2251
2251
  scheduleIsAlive = await this.checkScheduleisHealty(instanceID, scheduleTime);
@@ -2264,9 +2264,7 @@ class DeviceWatcher extends utils.Adapter {
2264
2264
  instanceErrorTime = this.userTimeInstancesList.get(instanceID).errorTime;
2265
2265
  instanceErrorTime = (instanceErrorTime * 1000) / 2; // calculate sec to ms and divide into two
2266
2266
  }
2267
-
2268
2267
  daemonIsAlive = await this.checkDaemonIsHealthy(instanceID);
2269
-
2270
2268
  if (daemonIsAlive[0]) {
2271
2269
  if (daemonIsAlive[1]) {
2272
2270
  isAlive = Boolean(daemonIsAlive[0]);
@@ -3265,7 +3263,7 @@ class DeviceWatcher extends utils.Adapter {
3265
3263
 
3266
3264
  for (const id of this.listErrorInstanceRaw) {
3267
3265
  if (this.blacklistInstancesNotify.includes(id)) continue;
3268
- list = `${list}\n${id}: ${id.Status}`;
3266
+ list = `${list}\n${id.Instance}: ${id.Status}`;
3269
3267
  }
3270
3268
  if (list.length === 0) return;
3271
3269
  message = `Tägliche Meldung über fehlerhafte Instanzen: ${list}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.device-watcher",
3
- "version": "2.9.1",
3
+ "version": "2.9.3",
4
4
  "description": "Watchdog for devices",
5
5
  "author": {
6
6
  "name": "Christian Behrends",
@@ -31,10 +31,10 @@
31
31
  "@alcalzone/release-script-plugin-manual-review": "^3.5.9",
32
32
  "@iobroker/adapter-dev": "^1.2.0",
33
33
  "@iobroker/testing": "^4.1.0",
34
- "@types/chai": "^4.3.4",
34
+ "@types/chai": "^4.3.5",
35
35
  "@types/chai-as-promised": "^7.1.5",
36
36
  "@types/mocha": "^10.0.1",
37
- "@types/node": "^18.15.11",
37
+ "@types/node": "^20.3.3",
38
38
  "@types/node-schedule": "^2.1.0",
39
39
  "@types/proxyquire": "^1.3.28",
40
40
  "@types/sinon": "^10.0.13",
@@ -42,16 +42,16 @@
42
42
  "chai": "^4.3.7",
43
43
  "chai-as-promised": "^7.1.1",
44
44
  "cron-parser": "^4.8.1",
45
- "eslint": "^8.37.0",
45
+ "eslint": "^8.44.0",
46
46
  "eslint-config-prettier": "^8.8.0",
47
47
  "eslint-plugin-prettier": "^4.2.1",
48
48
  "mocha": "^10.2.0",
49
49
  "node-schedule": "^2.1.1",
50
- "prettier": "^2.8.7",
50
+ "prettier": "^2.8.8",
51
51
  "proxyquire": "^2.1.3",
52
- "sinon": "^15.0.3",
52
+ "sinon": "^15.2.0",
53
53
  "sinon-chai": "^3.7.0",
54
- "typescript": "~5.0.3"
54
+ "typescript": "~5.1.6"
55
55
  },
56
56
  "main": "main.js",
57
57
  "files": [