iobroker.zigbee2mqtt 2.7.0 → 2.7.1

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/README.md CHANGED
@@ -32,6 +32,11 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
32
32
  Placeholder for the next version (at the beginning of the line):
33
33
  ### **WORK IN PROGRESS**
34
34
  -->
35
+ ### 2.7.1 (2023-01-24)
36
+
37
+ - (o0shojo0o) added option for use folder description
38
+ - (o0shojo0o) use the iobroker device folder description for device description or events
39
+
35
40
  ### 2.7.0 (2023-01-18)
36
41
 
37
42
  - (o0shojo0o) added support for wildcard actions (eg. *_single) ([#116](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/116))
@@ -24,5 +24,6 @@
24
24
  "Brightness move should also turn the light on or off": "Brightness move soll auch das Licht ein- oder ausschalten",
25
25
  "Brightness step should also turn the light on or off": "Brightness step soll auch das Licht ein- oder ausschalten",
26
26
  "Use Auth-Token": "Auth-Token verwenden",
27
- "Auth-Token (special characters are not supported)": "Auth-Token (Sonderzeichen werden nicht unterstützt)"
28
- }
27
+ "Auth-Token (special characters are not supported)": "Auth-Token (Sonderzeichen werden nicht unterstützt)",
28
+ "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.": "Die Ereignisse wie „Gerät entfernt“ oder „Deaktiviert“ werden in der Beschreibung statt im Namen angezeigt."
29
+ }
@@ -24,5 +24,6 @@
24
24
  "Other configurations": "Other configurations",
25
25
  "Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy Zigbee2MQTT logs to ioBroker logs",
26
26
  "Brightness move should also turn the light on or off": "Brightness move should also turn the light on or off",
27
- "Brightness step should also turn the light on or off": "Brightness step should also turn the light on or off"
27
+ "Brightness step should also turn the light on or off": "Brightness step should also turn the light on or off",
28
+ "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.": "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name."
28
29
  }
@@ -24,5 +24,6 @@
24
24
  "Other configurations": "Otras configuraciones",
25
25
  "Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy de registros Zigbee2MQTT a registros de ioBroker",
26
26
  "Brightness move should also turn the light on or off": "El movimiento de brillo también debe encender o apagar la luz",
27
- "Brightness step should also turn the light on or off": "El paso de brillo también debe encender o apagar la luz"
27
+ "Brightness step should also turn the light on or off": "El paso de brillo también debe encender o apagar la luz",
28
+ "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.": "Los eventos como 'Dispositivo eliminado' o 'Deshabilitado' se muestran en la descripción en lugar del nombre."
28
29
  }
@@ -24,5 +24,6 @@
24
24
  "Other configurations": "Autres configurations",
25
25
  "Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy Zigbee2MQTT se connecte aux journaux ioBroker",
26
26
  "Brightness move should also turn the light on or off": "Le mouvement de luminosité devrait également allumer ou éteindre la lumière",
27
- "Brightness step should also turn the light on or off": "L'étape de luminosité devrait également allumer ou éteindre la lumière"
27
+ "Brightness step should also turn the light on or off": "L'étape de luminosité devrait également allumer ou éteindre la lumière",
28
+ "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.": "Les événements tels que 'Appareil supprimé' ou 'Désactivé' sont affichés dans la description plutôt que dans le nom."
28
29
  }
@@ -24,5 +24,6 @@
24
24
  "Other configurations": "Altre configurazioni",
25
25
  "Proxy Zigbee2MQTT logs to ioBroker logs": "Il proxy Zigbee2MQTT registra nei registri ioBroker",
26
26
  "Brightness move should also turn the light on or off": "Lo spostamento della luminosità dovrebbe anche accendere o spegnere la luce",
27
- "Brightness step should also turn the light on or off": "Il passo di luminosità dovrebbe anche accendere o spegnere la luce"
27
+ "Brightness step should also turn the light on or off": "Il passo di luminosità dovrebbe anche accendere o spegnere la luce",
28
+ "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.": "Gli eventi come \"Dispositivo rimosso\" o \"Disabilitato\" vengono visualizzati nella descrizione anziché nel nome."
28
29
  }
@@ -24,5 +24,6 @@
24
24
  "Other configurations": "Andere configuraties",
25
25
  "Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy Zigbee2MQTT logt naar ioBroker-logboeken",
26
26
  "Brightness move should also turn the light on or off": "Helderheidsbeweging zou ook het licht aan of uit moeten zetten",
27
- "Brightness step should also turn the light on or off": "De helderheidsstap moet het licht ook in- of uitschakelen"
27
+ "Brightness step should also turn the light on or off": "De helderheidsstap moet het licht ook in- of uitschakelen",
28
+ "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.": "De gebeurtenissen zoals 'Apparaat verwijderd' of 'Uitgeschakeld' worden weergegeven in de beschrijving in plaats van in de naam."
28
29
  }
@@ -24,5 +24,6 @@
24
24
  "Other configurations": "Inne konfiguracje",
25
25
  "Proxy Zigbee2MQTT logs to ioBroker logs": "Proxy Zigbee2MQTT loguje się do logów ioBroker",
26
26
  "Brightness move should also turn the light on or off": "Ruch jasności powinien również włączać lub wyłączać światło",
27
- "Brightness step should also turn the light on or off": "Krok jasności powinien również włączać lub wyłączać światło"
27
+ "Brightness step should also turn the light on or off": "Krok jasności powinien również włączać lub wyłączać światło",
28
+ "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.": "Zdarzenia takie jak „Urządzenie usunięte” lub „Wyłączone” są wyświetlane w opisie zamiast w nazwie."
28
29
  }
@@ -24,5 +24,6 @@
24
24
  "Other configurations": "Outras configurações",
25
25
  "Proxy Zigbee2MQTT logs to ioBroker logs": "Logs proxy Zigbee2MQTT para logs ioBroker",
26
26
  "Brightness move should also turn the light on or off": "O movimento de brilho também deve ligar ou desligar a luz",
27
- "Brightness step should also turn the light on or off": "A etapa de brilho também deve ligar ou desligar a luz"
27
+ "Brightness step should also turn the light on or off": "A etapa de brilho também deve ligar ou desligar a luz",
28
+ "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.": "Os eventos como 'Dispositivo removido' ou 'Desativado' são exibidos na descrição em vez de no nome."
28
29
  }
@@ -24,5 +24,6 @@
24
24
  "Other configurations": "Другие конфигурации",
25
25
  "Proxy Zigbee2MQTT logs to ioBroker logs": "Проксировать журналы Zigbee2MQTT в журналы ioBroker",
26
26
  "Brightness move should also turn the light on or off": "Изменение яркости также должно включать или выключать свет.",
27
- "Brightness step should also turn the light on or off": "Шаг яркости также должен включать или выключать свет."
27
+ "Brightness step should also turn the light on or off": "Шаг яркости также должен включать или выключать свет.",
28
+ "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.": "Такие события, как «Устройство удалено» или «Отключено», отображаются в описании, а не в названии."
28
29
  }
@@ -24,5 +24,6 @@
24
24
  "Other configurations": "Інші конфігурації",
25
25
  "Proxy Zigbee2MQTT logs to ioBroker logs": "Журнали проксі Zigbee2MQTT до журналів ioBroker",
26
26
  "Brightness move should also turn the light on or off": "Переміщення яскравості також повинно вмикати або вимикати світло",
27
- "Brightness step should also turn the light on or off": "Крок яскравості також повинен вмикати або вимикати світло"
27
+ "Brightness step should also turn the light on or off": "Крок яскравості також повинен вмикати або вимикати світло",
28
+ "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.": "Такі події, як «Пристрій видалено» або «Вимкнено», відображаються в описі, а не в назві."
28
29
  }
@@ -24,5 +24,6 @@
24
24
  "Other configurations": "其他配置",
25
25
  "Proxy Zigbee2MQTT logs to ioBroker logs": "代理 Zigbee2MQTT 日志到 ioBroker 日志",
26
26
  "Brightness move should also turn the light on or off": "亮度移动也应该打开或关闭灯",
27
- "Brightness step should also turn the light on or off": "亮度步骤也应该打开或关闭灯"
27
+ "Brightness step should also turn the light on or off": "亮度步骤也应该打开或关闭灯",
28
+ "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.": "“设备已移除”或“已禁用”等事件显示在描述中而不是名称中。"
28
29
  }
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "connectionType": {
12
12
  "label": "Select connection to Zigbee2MQTT",
13
- "sm": 4,
13
+ "sm": 5,
14
14
  "type": "select",
15
15
  "options": [
16
16
  {
@@ -60,7 +60,7 @@
60
60
  "type": "password",
61
61
  "label": "Auth-Token (special characters are not supported)",
62
62
  "newLine": true,
63
- "lg": 2,
63
+ "lg": 5,
64
64
  "hidden": "data.wsTokenEnabled != true || data.connectionType != 'ws'"
65
65
  },
66
66
  "dummyMqtt": {
@@ -171,6 +171,11 @@
171
171
  "type": "checkbox",
172
172
  "label": "Proxy Zigbee2MQTT logs to ioBroker logs",
173
173
  "newLine": true
174
+ },
175
+ "useEventInDesc": {
176
+ "type": "checkbox",
177
+ "label": "The events such as 'Device removed' or 'Disabled' are displayed in the description instead of in the name.",
178
+ "newLine": true
174
179
  }
175
180
  }
176
181
  }
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee2mqtt",
4
- "version": "2.7.0",
4
+ "version": "2.7.1",
5
5
  "news": {
6
+ "2.7.1": {
7
+ "en": "added option for use folder description\nuse the iobroker device folder description for device description or events",
8
+ "de": "zusatzoption für die ordnerbeschreibung\ndie beschreibung des iobroker geräteordners für gerätebeschreibung oder ereignisse",
9
+ "ru": "добавлена опция для использования описания папки\nиспользуйте описание папки iobroker для описания устройства или событий",
10
+ "pt": "opção adicionada para a descrição da pasta de uso\nuse a descrição da pasta do dispositivo iobroker para descrição do dispositivo ou eventos",
11
+ "nl": "voegde de optie toe voor gebruik van de beschrijving\ngebruik de beschrijving van het iobroker apparaat voor beschrijving of gebeurtenissen",
12
+ "fr": "option ajoutée pour la description du dossier d'utilisation\nutiliser la description du dossier de périphérique iobroker pour la description de périphérique ou les événements",
13
+ "it": "opzione aggiunta per l'uso descrizione della cartella\nutilizzare la descrizione della cartella del dispositivo iobroker per la descrizione o gli eventi del dispositivo",
14
+ "es": "opción adicional para la descripción de la carpeta de uso\nutilizar la descripción de la carpeta del dispositivo iobroker para la descripción del dispositivo o eventos",
15
+ "pl": "dodać opcję do opisu folder\nużywanie iobrokerowego opisu danych dla opisu urządzenia lub zdarzeń",
16
+ "uk": "доданий варіант для опису папок\nвикористовувати опис папки іоброкера для опису пристрою або подій",
17
+ "zh-cn": "增加使用时说明的选择\n对装置说明或事件使用零散器装置的描述"
18
+ },
6
19
  "2.7.0": {
7
20
  "en": "added support for wildcard actions (eg. *_single) ([#116](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/116))\nadded error handling optimizations ([more](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1382038679))\nadded option `auth_token` for websocket connection ([#112](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/112))\nwebsocket timeout increased",
8
21
  "de": "unterstützung für Wildcard-Aktionen (z.B. *_single) [#116](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/116)\nfehlerbehandlungsoptimierungen [mehr](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1382038679)\nzusatzoption auth_token für Websocket-Verbindung [#112](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/112)\nwebsocket timeout erhöht",
@@ -80,19 +93,6 @@
80
93
  "pl": "ustanowić dostęp do przyjaznej nazwy. zawierać",
81
94
  "uk": "застосувати доступність при дружній_ім`я `/` в наявності",
82
95
  "zh-cn": "f 在友好的情况下,可提供“/”一词 内载"
83
- },
84
- "2.4.2": {
85
- "en": "added correct handling of `move_to_saturation`, `hue_move` and `brightness_move_to_level` ([#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68))\nfix when `friendly_name` `/` contains",
86
- "de": "die korrekte Handhabung von move_to_saturation, hue_move und bright_move_to_level [#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/68)\nbei freundlich_name `/` enthält",
87
- "ru": "добавлена правильная обработка move_to_saturation, hue_move и brightness_move_to_level [#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68)\nисправить, когда friendly_name `/` содержит",
88
- "pt": "adicionado manuseio correto de move_to_saturation, hue_move e brilho_move_to_level [#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68)\ncorrigir quando friendly_name `/` contém",
89
- "nl": "voegde de juiste behandeling van verplaatsing, huemove and brightnessmovetolevel 68) (httub /0shojoo-0-Bio-Broctrotqusts)\nvertaling: _",
90
- "fr": "ajouté correct handling of move_to_saturation, hue_move and brightness_move_to_level [#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/68)\nfixer lorsque friendly_name `/` contient",
91
- "it": "aggiunto corretta gestione di move_to_saturation, hue_move e luminosità_move_to_level [#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/68)\nfissare quando amichevole_name `/` contiene",
92
- "es": "añadido correcto manejo de move_to_saturation, hue_move and brightness_move_to_level [#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/68)\narreglar cuando friendly_name `/ contiene",
93
- "pl": "(Prawdziwa obsługa ruchu_to_saturation, hue_move and brightness_move_to_level #68(https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68)\nustanowić się, gdy przyjaźnić nazwisko/'. zawierać",
94
- "uk": "додано правильну обробку рухом_to_saturation, hue_move_move_to_level [#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68)\nфіксація при дружній_ім`я `/` в наявності",
95
- "zh-cn": "进一步正确地处理搬迁问题:流向、障碍和光明_move_to_级[#68](http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/68)\nfix 友好时的名称:“/” 内载"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -199,7 +199,8 @@
199
199
  "useKelvin": false,
200
200
  "colorTempSyncColor": false,
201
201
  "brightnessMoveOnOff": false,
202
- "brightnessStepOnOff": false
202
+ "brightnessStepOnOff": false,
203
+ "useEventInDesc": true
203
204
  },
204
205
  "objects": [],
205
206
  "instanceObjects": [
@@ -207,22 +207,31 @@ class DeviceController {
207
207
 
208
208
  async createOrUpdateDevices() {
209
209
  for (const device of this.groupCache.concat(this.deviceCache)) {
210
- let deviceName = device.id == device.ieee_address ? '' : device.id;
210
+ let deviceName = await this.getDeviceName(device);
211
+ let description = await this.getDeviceDescription(device);
211
212
 
212
213
  if (deviceName == '' && device.description) {
213
214
  deviceName = device.description;
215
+ description = '';
214
216
  }
215
217
 
216
218
  // Manipulate deviceName if the device is disabled, so the update of the device is triggered as well
217
219
  if (device.disabled && device.disabled == true) {
218
- deviceName = `[Disabled] ${deviceName}`;
220
+ if (this.config.useEventInDesc == true) {
221
+ description = 'Device is disabled!';
222
+ }
223
+ else {
224
+ deviceName = `[Disabled] ${deviceName}`;
225
+ }
226
+
219
227
  }
220
228
 
221
- if (!this.createCache[device.ieee_address] || this.createCache[device.ieee_address].name != deviceName) {
229
+ if (!this.createCache[device.ieee_address] || this.createCache[device.ieee_address].name != deviceName || this.createCache[device.ieee_address].description != description) {
222
230
  const deviceObj = {
223
231
  type: 'device',
224
232
  common: {
225
233
  name: deviceName,
234
+ desc: description
226
235
  },
227
236
 
228
237
  native: {}
@@ -242,7 +251,7 @@ class DeviceController {
242
251
 
243
252
  //@ts-ignore
244
253
  await this.adapter.extendObjectAsync(device.ieee_address, deviceObj);
245
- this.createCache[device.ieee_address] = { name: deviceName };
254
+ this.createCache[device.ieee_address] = { name: deviceName, description: description };
246
255
  }
247
256
 
248
257
  // Here it is checked whether the scenes match the current data from z2m.
@@ -280,6 +289,8 @@ class DeviceController {
280
289
 
281
290
  processRemoveEvent(messageObj) {
282
291
  let ieee_address = undefined;
292
+ let description = '';
293
+ let deviceName = '';
283
294
  if (messageObj.payload && messageObj.payload.type == 'device_leave') {
284
295
  ieee_address = messageObj.payload.data.ieee_address;
285
296
  }
@@ -289,12 +300,26 @@ class DeviceController {
289
300
  const device = this.deviceCache.find(x => x.id == messageObj.payload.data.id);
290
301
  if (device) {
291
302
  ieee_address = device.ieee_address;
303
+ deviceName = this.getDeviceName(device);
292
304
  }
293
305
  }
294
306
 
295
307
  if (ieee_address != undefined) {
296
308
  this.adapter.setState(`${ieee_address}.available`, false, true);
297
- this.adapter.extendObject(`${ieee_address}`, { common: { name: 'Device removed!', } });
309
+ deviceName = this.createCache[ieee_address].name;
310
+
311
+ if (this.config.useEventInDesc == true) {
312
+ description = 'Device was removed!';
313
+ }
314
+ else {
315
+ deviceName = `[Removed] ${deviceName}`;
316
+ }
317
+ this.adapter.extendObject(`${ieee_address}`, {
318
+ common: {
319
+ name: deviceName,
320
+ desc: description
321
+ }
322
+ });
298
323
  delete this.createCache[ieee_address];
299
324
  }
300
325
  }
@@ -326,6 +351,14 @@ class DeviceController {
326
351
  }
327
352
  return iobState;
328
353
  }
354
+
355
+ getDeviceName(device) {
356
+ return device.id == device.ieee_address ? '' : device.id;
357
+ }
358
+
359
+ getDeviceDescription(device) {
360
+ return device.description ? device.description : '';
361
+ }
329
362
  }
330
363
 
331
364
  module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zigbee2mqtt",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "Zigbee2MQTT adapter for ioBroker",
5
5
  "author": {
6
6
  "name": "Dennis Rathjen",
@@ -42,7 +42,7 @@
42
42
  "@types/sinon-chai": "^3.2.9",
43
43
  "chai": "^4.3.7",
44
44
  "chai-as-promised": "^7.1.1",
45
- "eslint": "^8.31.0",
45
+ "eslint": "^8.32.0",
46
46
  "eslint-config-prettier": "^8.6.0",
47
47
  "eslint-plugin-prettier": "^4.2.1",
48
48
  "mocha": "^10.2.0",