iobroker.device-watcher 2.9.6 → 2.9.7

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/lib/arrApart.js CHANGED
@@ -576,6 +576,18 @@ const arrApart = {
576
576
  id: 'none',
577
577
  upgrade: 'none',
578
578
  },
579
+ wifilight: {
580
+ Selektor: 'wifilight.*.reachable',
581
+ timeSelector: '.reachable',
582
+ adapterID: 'wifilight',
583
+ adapter: 'Wifilight',
584
+ rssiState: 'none',
585
+ battery: 'none',
586
+ reach: '.reachable',
587
+ isLowBat: 'none',
588
+ id: 'none',
589
+ upgrade: 'none',
590
+ },
579
591
  wled: {
580
592
  Selektor: 'wled.*._online',
581
593
  timeSelector: '._online',
package/main.js CHANGED
@@ -150,6 +150,7 @@ class DeviceWatcher extends utils.Adapter {
150
150
  tuya: this.config.tuyaDevices,
151
151
  unifi: this.config.unifiDevices,
152
152
  viessmann: this.config.viessmannDevices,
153
+ wifilight: this.config.wifilightDevices,
153
154
  wled: this.config.wledDevices,
154
155
  yeelight: this.config.yeelightDevices,
155
156
  zigbee: this.config.zigbeeDevices,
@@ -210,6 +211,7 @@ class DeviceWatcher extends utils.Adapter {
210
211
  tuya: this.config.tuyaMaxMinutes,
211
212
  unifi: this.config.unifiMaxMinutes,
212
213
  viessmann: this.config.viessmannMaxMinutes,
214
+ wifilight: this.config.wifilightMaxMinutes,
213
215
  wled: this.config.wledMaxMinutes,
214
216
  yeelight: this.config.yeelightMaxMinutes,
215
217
  zigbee: this.config.zigbeeMaxMinutes,
@@ -370,7 +372,6 @@ class DeviceWatcher extends utils.Adapter {
370
372
  * @param {ioBroker.State | null | undefined} state
371
373
  */
372
374
  async onStateChange(id, state) {
373
- // Admin JSON for Adapter updates
374
375
  if (state) {
375
376
  // this.log.debug(`State changed: ${id} changed ${state.val}`);
376
377
  let batteryData;
@@ -526,30 +527,32 @@ class DeviceWatcher extends utils.Adapter {
526
527
 
527
528
  // device unreach
528
529
  case deviceData.UnreachDP:
529
- oldStatus = deviceData.Status;
530
- deviceData.UnreachState = await this.getInitValue(deviceData.UnreachDP);
531
- contactData = await this.getOnlineState(
532
- deviceData.timeSelector,
533
- deviceData.adapterID,
534
- deviceData.UnreachDP,
535
- deviceData.SignalStrength,
536
- deviceData.UnreachState,
537
- deviceData.DeviceStateSelectorDP,
538
- deviceData.rssiPeerSelectorDP,
539
- );
540
- if (contactData !== undefined) {
541
- deviceData.LastContact = contactData[0];
542
- deviceData.Status = contactData[1];
543
- deviceData.SignalStrength = contactData[2];
544
- }
545
- if (this.config.checkSendOfflineMsg && oldStatus !== deviceData.Status && !this.blacklistNotify.includes(deviceData.Path)) {
546
- if (deviceData.instanceDeviceConnectionDP.val !== undefined) {
547
- // check if the generally deviceData connected state is for a while true
548
- if (await this.getTimestampConnectionDP(deviceData.instanceDeviceConnectionDP, 20000)) {
530
+ if (deviceData.UnreachState !== state.val) {
531
+ oldStatus = deviceData.Status;
532
+ deviceData.UnreachState = state.val;
533
+ contactData = await this.getOnlineState(
534
+ deviceData.timeSelector,
535
+ deviceData.adapterID,
536
+ deviceData.UnreachDP,
537
+ deviceData.SignalStrength,
538
+ deviceData.UnreachState,
539
+ deviceData.DeviceStateSelectorDP,
540
+ deviceData.rssiPeerSelectorDP,
541
+ );
542
+ if (contactData !== undefined) {
543
+ deviceData.LastContact = contactData[0];
544
+ deviceData.Status = contactData[1];
545
+ deviceData.SignalStrength = contactData[2];
546
+ }
547
+ if (this.config.checkSendOfflineMsg && oldStatus !== deviceData.Status && !this.blacklistNotify.includes(deviceData.Path)) {
548
+ if (deviceData.instanceDeviceConnectionDP.val !== undefined) {
549
+ // check if the generally deviceData connected state is for a while true
550
+ if (await this.getTimestampConnectionDP(deviceData.instanceDeviceConnectionDP, 20000)) {
551
+ await this.sendStateNotifications('onlineStateDevice', device);
552
+ }
553
+ } else {
549
554
  await this.sendStateNotifications('onlineStateDevice', device);
550
555
  }
551
- } else {
552
- await this.sendStateNotifications('onlineStateDevice', device);
553
556
  }
554
557
  }
555
558
  break;
@@ -1141,6 +1144,7 @@ class DeviceWatcher extends utils.Adapter {
1141
1144
 
1142
1145
  //Get ID of foldername
1143
1146
  case 'tado':
1147
+ case 'wifilight':
1144
1148
  deviceName = currDeviceString.slice(currDeviceString.lastIndexOf('.') + 1);
1145
1149
  break;
1146
1150
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.device-watcher",
3
- "version": "2.9.6",
3
+ "version": "2.9.7",
4
4
  "description": "Watchdog for devices",
5
5
  "author": {
6
6
  "name": "Christian Behrends",