hoffmation-base 3.0.0-alpha.6 → 3.0.0-alpha.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.
@@ -40,16 +40,18 @@ class ZigbeeDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
40
40
  }
41
41
  switch (idSplit[3]) {
42
42
  case 'available':
43
- this._available = state.val;
44
- if (!this._available) {
45
- this.log(models_1.LogLevel.Debug, `Das Zigbee Gerät ist nicht erreichbar.`);
43
+ const newAvailability = state.val;
44
+ if (this._available && !newAvailability) {
45
+ this.log(models_1.LogLevel.Debug, `Device became unavailable.`);
46
46
  }
47
+ this._available = newAvailability;
47
48
  break;
48
49
  case 'link_quality':
49
- this._linkQuality = state.val;
50
- if (this._linkQuality < 5) {
51
- this.log(models_1.LogLevel.Debug, `Das Zigbee Gerät hat eine schlechte Verbindung (${this._linkQuality}).`);
50
+ const newValue = state.val;
51
+ if (this._linkQuality > 5 && newValue <= 5) {
52
+ this.log(models_1.LogLevel.Debug, `The link-quality dropped to a critical level: ${newValue}`);
52
53
  }
54
+ this._linkQuality = state.val;
53
55
  break;
54
56
  }
55
57
  this.stateMap.set(idSplit[3], state);