iobroker.device-watcher 2.9.8 → 2.9.9

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.
Files changed (4) hide show
  1. package/README.md +4 -0
  2. package/io-package.json +859 -837
  3. package/main.js +24 -13
  4. package/package.json +17 -17
package/main.js CHANGED
@@ -220,6 +220,7 @@ class DeviceWatcher extends utils.Adapter {
220
220
  };
221
221
 
222
222
  try {
223
+ // create list with selected adapters for monitor devices
223
224
  for (const [id] of Object.entries(arrApart)) {
224
225
  if (this.configSetAdapter[id]) {
225
226
  this.selAdapter.push(arrApart[id]);
@@ -227,7 +228,17 @@ class DeviceWatcher extends utils.Adapter {
227
228
  }
228
229
  }
229
230
 
230
- //create Blacklist
231
+ // Check if an adapter to monitor devices is selected.
232
+ if (this.adapterSelected.length >= 1) {
233
+ // show list in debug log
234
+ this.log.debug(JSON.stringify(this.selAdapter));
235
+
236
+ this.log.info(`Number of selected adapters to monitor devices: ${this.adapterSelected.length}. Loading data from: ${this.adapterSelected.join(', ')} ...`);
237
+ } else {
238
+ this.log.info(`No adapters selected to monitor devices.`);
239
+ }
240
+
241
+ // create Blacklist
231
242
  await this.createBlacklist();
232
243
 
233
244
  // create user defined list with time of error for instances
@@ -373,7 +384,9 @@ class DeviceWatcher extends utils.Adapter {
373
384
  let oldAdapterUpdatesCounts;
374
385
 
375
386
  try {
376
- // adapter updates
387
+ /*=============================================
388
+ = Adapter Updates =
389
+ =============================================*/
377
390
  if (id.endsWith('updatesJson')) {
378
391
  oldAdapterUpdatesCounts = this.countAdapterUpdates;
379
392
  await this.getAdapterUpdateData(id);
@@ -392,7 +405,9 @@ class DeviceWatcher extends utils.Adapter {
392
405
  }
393
406
  }
394
407
 
395
- // instances
408
+ /*=============================================
409
+ = Instances =
410
+ =============================================*/
396
411
  for (const [instanceID, instanceData] of this.listInstanceRaw) {
397
412
  const checkInstance = async (instanceID, instanceData) => {
398
413
  if (!instanceData.checkIsRunning) {
@@ -405,6 +420,7 @@ class DeviceWatcher extends utils.Adapter {
405
420
  return;
406
421
  }
407
422
  };
423
+
408
424
  switch (id) {
409
425
  case `system.adapter.${instanceID}.alive`:
410
426
  if (state.val !== instanceData.isAlive) {
@@ -441,6 +457,9 @@ class DeviceWatcher extends utils.Adapter {
441
457
  }
442
458
  }
443
459
 
460
+ /*=============================================
461
+ = Devices =
462
+ =============================================*/
444
463
  for (const [device, deviceData] of this.listAllDevicesRaw) {
445
464
  // On statechange update available datapoint
446
465
  switch (id) {
@@ -668,16 +687,8 @@ class DeviceWatcher extends utils.Adapter {
668
687
  async main() {
669
688
  this.log.debug(`Function started: ${this.main.name}`);
670
689
 
671
- //Check if an Adapter is selected.
672
- if (this.adapterSelected.length >= 1) {
673
- // show list in debug log
674
- this.log.debug(JSON.stringify(this.selAdapter));
675
-
676
- this.log.info(`Number of selected adapters: ${this.adapterSelected.length}. Loading data from: ${this.adapterSelected.join(', ')} ...`);
677
- } else {
678
- this.log.info(`No adapter selected. Please check the instance configuration!`);
679
- return; // cancel run if no adapter is selected
680
- }
690
+ // cancel run if no adapter is selected
691
+ if (this.adapterSelected.length === 0) return;
681
692
 
682
693
  // fill counts and lists of all selected adapter
683
694
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.device-watcher",
3
- "version": "2.9.8",
3
+ "version": "2.9.9",
4
4
  "description": "Watchdog for devices",
5
5
  "author": {
6
6
  "name": "Christian Behrends",
@@ -28,33 +28,33 @@
28
28
  "@iobroker/adapter-core": "^3.0.4"
29
29
  },
30
30
  "devDependencies": {
31
- "@alcalzone/release-script": "^3.6.0",
32
- "@alcalzone/release-script-plugin-iobroker": "^3.6.0",
33
- "@alcalzone/release-script-plugin-license": "^3.5.9",
34
- "@alcalzone/release-script-plugin-manual-review": "^3.5.9",
31
+ "@alcalzone/release-script": "^3.7.0",
32
+ "@alcalzone/release-script-plugin-iobroker": "^3.7.0",
33
+ "@alcalzone/release-script-plugin-license": "^3.7.0",
34
+ "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
35
35
  "@iobroker/adapter-dev": "^1.2.0",
36
36
  "@iobroker/testing": "^4.1.0",
37
- "@types/chai": "^4.3.9",
38
- "@types/chai-as-promised": "^7.1.7",
39
- "@types/mocha": "^10.0.3",
40
- "@types/node": "^20.8.10",
41
- "@types/node-schedule": "^2.1.2",
42
- "@types/proxyquire": "^1.3.30",
43
- "@types/sinon": "^10.0.16",
44
- "@types/sinon-chai": "^3.2.11",
37
+ "@types/chai": "^4.3.11",
38
+ "@types/chai-as-promised": "^7.1.8",
39
+ "@types/mocha": "^10.0.6",
40
+ "@types/node": "^20.10.1",
41
+ "@types/node-schedule": "^2.1.4",
42
+ "@types/proxyquire": "^1.3.31",
43
+ "@types/sinon": "^17.0.2",
44
+ "@types/sinon-chai": "^3.2.12",
45
45
  "chai": "^4.3.10",
46
46
  "chai-as-promised": "^7.1.1",
47
47
  "cron-parser": "^4.9.0",
48
- "eslint": "^8.52.0",
48
+ "eslint": "^8.54.0",
49
49
  "eslint-config-prettier": "^9.0.0",
50
50
  "eslint-plugin-prettier": "^5.0.1",
51
51
  "mocha": "^10.2.0",
52
52
  "node-schedule": "^2.1.1",
53
- "prettier": "^3.0.3",
53
+ "prettier": "^3.1.0",
54
54
  "proxyquire": "^2.1.3",
55
- "sinon": "^17.0.0",
55
+ "sinon": "^17.0.1",
56
56
  "sinon-chai": "^3.7.0",
57
- "typescript": "~5.2.2"
57
+ "typescript": "~5.3.2"
58
58
  },
59
59
  "main": "main.js",
60
60
  "files": [