iobroker.zigbee2mqtt 2.4.1 → 2.4.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/README.md CHANGED
@@ -9,7 +9,9 @@
9
9
 
10
10
  [![NPM](https://nodei.co/npm/iobroker.zigbee2mqtt.png?downloads=true)](https://nodei.co/npm/iobroker.zigbee2mqtt/)
11
11
 
12
- **Tests:** ![Test and Release](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/workflows/Test%20and%20Release/badge.svg)
12
+ **Tests:**
13
+ ![Test and Release](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/workflows/Test%20and%20Release/badge.svg)
14
+ ![CodeQL](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/actions/workflows/codeql.yml/badge.svg?branch=main)
13
15
 
14
16
  ## zigbee2mqtt adapter for ioBroker
15
17
 
@@ -30,6 +32,15 @@ This adapter allows to control the data points of the devices of a Zigbee2MQTT i
30
32
  Placeholder for the next version (at the beginning of the line):
31
33
  ### **WORK IN PROGRESS**
32
34
  -->
35
+ ### 2.4.3 (2022-11-23)
36
+
37
+ - (o0shojo0o) fix availability when `friendly_name` `/` contains
38
+
39
+ ### 2.4.2 (2022-11-20)
40
+
41
+ - (o0shojo0o) added correct handling of `move_to_saturation`, `hue_move` and `brightness_move_to_level` ([#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68))
42
+ - (o0shojo0o) fix when `friendly_name` `/` contains
43
+
33
44
  ### 2.4.1 (2022-11-16)
34
45
 
35
46
  - (o0shojo0o) fix based on [review](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee2mqtt",
4
- "version": "2.4.1",
4
+ "version": "2.4.3",
5
5
  "news": {
6
+ "2.4.3": {
7
+ "en": "fix availability when `friendly_name` `/` contains",
8
+ "de": "verfügbarkeit korrigieren bei friendly_name `/` enthält",
9
+ "ru": "исправить доступность когда friendly_name `/` содержит",
10
+ "pt": "corrigir disponibilidade quando friendly_name `/` contém",
11
+ "nl": "_ _",
12
+ "fr": "fixer la disponibilité lorsque friendly_name `/` contient",
13
+ "it": "fissare la disponibilità quando amichevole_name `/` contiene",
14
+ "es": "fijar disponibilidad cuando friendly_name `/` contiene",
15
+ "pl": "ustanowić dostęp do przyjaznej nazwy. zawierać",
16
+ "uk": "застосувати доступність при дружній_ім`я `/` в наявності",
17
+ "zh-cn": "f 在友好的情况下,可提供“/”一词 内载"
18
+ },
19
+ "2.4.2": {
20
+ "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",
21
+ "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",
22
+ "ru": "добавлена правильная обработка move_to_saturation, hue_move и brightness_move_to_level [#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68)\nисправить, когда friendly_name `/` содержит",
23
+ "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",
24
+ "nl": "voegde de juiste behandeling van verplaatsing, huemove and brightnessmovetolevel 68) (httub /0shojoo-0-Bio-Broctrotqusts)\nvertaling: _",
25
+ "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",
26
+ "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",
27
+ "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",
28
+ "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ć",
29
+ "uk": "додано правильну обробку рухом_to_saturation, hue_move_move_to_level [#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68)\nфіксація при дружній_ім`я `/` в наявності",
30
+ "zh-cn": "进一步正确地处理搬迁问题:流向、障碍和光明_move_to_级[#68](http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/68)\nfix 友好时的名称:“/” 内载"
31
+ },
6
32
  "2.4.1": {
7
33
  "en": "fix based on [review](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)",
8
34
  "de": "(https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)",
@@ -67,32 +93,6 @@
67
93
  "pl": "dodano wsparcie dla Lidla HG06467 efektów (https:/wwww.zigbee2mqtt.io/devices/HG06467.html#trigger)\ndodano obsługę koloru hs\nsymulacja danych _brighta jest dodana tylko dla obsługi urządzeń",
68
94
  "uk": "додано підтримку [Lidl HG06467 ефектів](https://www.zigbee2mqtt.io/devices/HG06467.html#trigger-effects)\nдодана підтримка кольору hs\nсимулятор_brightness дата додано тільки для підтримуваних пристроїв",
69
95
  "zh-cn": "进一步支持[Lidl HG06467效应](http://www.zigbee2mqt.io/devices/HG06467.html#er-effects)\nb. 对地壳的增援\n仅为支助装置增添了简历数据点。"
70
- },
71
- "2.1.1": {
72
- "en": "advanced detection if a device has been removed\nfixes the design error in the websocket connection",
73
- "de": "fortgeschrittene erkennung, wenn ein gerät entfernt wurde\nkorrigiert den designfehler in der websocket-verbindung",
74
- "ru": "предварительное обнаружение, если устройство было удалено\nисправляет ошибку дизайна в подключении к сети",
75
- "pt": "detecção avançada se um dispositivo foi removido\ncorrige o erro de projeto na conexão websocket",
76
- "nl": "als er een apparaat verwijderd is\nde ontwerpfout in de websocket verbinding",
77
- "fr": "détection avancée si un dispositif a été enlevé\ncorrige l'erreur de conception dans la connexion websocket",
78
- "it": "rilevamento avanzato se un dispositivo è stato rimosso\ncorregge l'errore di progettazione nella connessione websocket",
79
- "es": "detección avanzada si se ha eliminado un dispositivo\nfija el error de diseño en la conexión websocket",
80
- "pl": "wykrywanie zaawansowane, jeśli urządzenie zostało usunięte\numożliwia to błędy projektowe w łączu internetowym",
81
- "uk": "розширене виявлення, якщо пристрій було видалено\nвиправлено помилку дизайну в підключенні websocket",
82
- "zh-cn": "如果一个装置被拆除,则预先发现\nf 确定网站的设计错误"
83
- },
84
- "2.1.0": {
85
- "en": "added option for color temperature sync with color\nfix logfilter and debugDevices\nlots of bugfixes\nnow set the correct min/max at color temp\nbetter error handling for the connections",
86
- "de": "zusatzoption für farbtemperatur-sync mit farbe\nlogfilter und DebugDevices fixieren\nviele bugfixes\njetzt die richtige min/max in der farbe tempo einstellen\nbessere fehlerbehandlung für die verbindungen",
87
- "ru": "добавлена опция для синхронизации цветовой температуры с цветом\nисправить logfilter и debugDevices\nмного багфиксов\nтеперь установите правильный мин/макс на цветной темп\nлучшая обработка ошибок для подключений",
88
- "pt": "opção adicionada para sincronização de temperatura de cor com cor\ncorrigir logfilter e debugDevices\nlotes de correções de bugs\nagora definir o min/max correto na temperatura de cor\nmelhor manipulação de erros para as conexões",
89
- "nl": "vertaling:\nvertaling:\nveel insectenfixen\nzet nu de juiste min/max op kleurtemperatuur\nbeter fout gaan voor de connecties",
90
- "fr": "option ajoutée pour synchronisation de température couleur avec couleur\nfixer logfilter et debugDevices\nbeaucoup de bugfixes\nmaintenant définir le min/max correct à la température de couleur\nmeilleure manipulation des erreurs pour les connexions",
91
- "it": "opzione aggiunta per la sincronizzazione della temperatura del colore con il colore\ncorreggere logfilter e debugDevices\nmolti bugfix\nora impostare il min/max corretto a temperatura di colore\nmigliore gestione degli errori per le connessioni",
92
- "es": "opción agregada para sincronización de temperatura de color con color\nfijación de logfilter y debugDispositivos\nmuchos bugfixes\nahora establece el min/max correcto a color temp\nmejor manejo de errores para las conexiones",
93
- "pl": "dodano możliwość synchronizacji kolorowej synchronizacji z kolorami\nnaprawić filtry i debugDevices\nwiele błędów\nteraz ustalono odpowiednie min/max w kolorowym tempie\nlepsza obsługa błędów dla połączeń powiązań",
94
- "uk": "додано варіант синхронізації кольору з кольором\nвиправити logfilter і debugDevices\nбагато помилок\nтепер встановлюємо правильний хв/макс за кольором\nкраща обробка помилок для підключення",
95
- "zh-cn": "添加了用颜色的气温合办法\nfix 木图和溶剂\n批发\n现将正确的分钟/升值确定为色色彩。\na. 处理联系的错误"
96
96
  }
97
97
  },
98
98
  "titleLang": {
package/lib/exposes.js CHANGED
@@ -629,7 +629,7 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
629
629
  },
630
630
  }, expose.access);
631
631
  }
632
- else if (actionName.includes('color_temperature_move')) {
632
+ else if (actionName == 'color_temperature_move') {
633
633
  pushToStates({
634
634
  id: 'color_temperature_move',
635
635
  prop: 'action',
@@ -661,7 +661,7 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
661
661
  }, expose.access);
662
662
 
663
663
  }
664
- else if (actionName.includes('color_move')) {
664
+ else if (actionName == 'color_move') {
665
665
  pushToStates({
666
666
  id: 'color_move',
667
667
  prop: 'action',
@@ -688,6 +688,85 @@ function createFromExposes(deviceID, ieee_address, definitions, power_source, sc
688
688
  }
689
689
  }, expose.access);
690
690
  }
691
+ else if (actionName == 'brightness_move_to_level') {
692
+ pushToStates({
693
+ id: 'brightness_move_to_level',
694
+ name: 'Brightness move to level',
695
+ icon: undefined,
696
+ role: 'level.dimmer',
697
+ write: false,
698
+ read: true,
699
+ type: 'number',
700
+ min: 0,
701
+ max: 100,
702
+ def: 100,
703
+ unit: '%',
704
+ isEvent: true,
705
+ getter: (payload) => {
706
+ if (payload.action != 'brightness_move_to_level') {
707
+ return undefined;
708
+ }
709
+
710
+ if (payload.action_level) {
711
+ return utils.bulbLevelToAdapterLevel(payload.action_level);
712
+ } else {
713
+ return undefined;
714
+ }
715
+ }
716
+ }, expose.access);
717
+ }
718
+ else if (actionName == 'move_to_saturation') {
719
+ pushToStates({
720
+ id: 'move_to_saturation',
721
+ name: 'Move to level saturation',
722
+ icon: undefined,
723
+ role: 'level.color.saturation',
724
+ write: false,
725
+ read: true,
726
+ type: 'number',
727
+ // min: 0,
728
+ // max: 100,
729
+ def: 0,
730
+ isEvent: true,
731
+ getter: (payload) => {
732
+ if (payload.action != 'move_to_saturation') {
733
+ return undefined;
734
+ }
735
+
736
+ if (payload.action_level) {
737
+ return payload.action_saturation;
738
+ } else {
739
+ return undefined;
740
+ }
741
+ }
742
+ }, expose.access);
743
+ }
744
+ else if (actionName == 'hue_move') {
745
+ pushToStates({
746
+ id: 'hue_move',
747
+ name: 'Hue move rate',
748
+ icon: undefined,
749
+ role: 'level.color.hue',
750
+ write: false,
751
+ read: true,
752
+ type: 'number',
753
+ min: 0,
754
+ max: 360,
755
+ def: 0,
756
+ isEvent: true,
757
+ getter: (payload) => {
758
+ if (payload.action != 'hue_move') {
759
+ return undefined;
760
+ }
761
+
762
+ if (payload.action_level) {
763
+ return payload.action_rate;
764
+ } else {
765
+ return undefined;
766
+ }
767
+ }
768
+ }, expose.access);
769
+ }
691
770
  else {
692
771
  pushToStates({
693
772
  id: actionName.replace(/\*/g, ''),
package/main.js CHANGED
@@ -193,7 +193,6 @@ class Zigbee2mqtt extends core.Adapter {
193
193
  {
194
194
  // {"payload":{"state":"online"},"topic":"FL.Licht.Links/availability"} ----> {"payload":{"available":true},"topic":"FL.Licht.Links"}
195
195
  if (messageObj.topic.endsWith('/availability')) {
196
- const topicSplit = messageObj.topic.split('/');
197
196
 
198
197
  // If an availability message for an old device ID comes with a payload of NULL, this is the indicator that a device has been unnamed.
199
198
  // If this is then still available in the cache, the messages must first be cached.
@@ -201,17 +200,17 @@ class Zigbee2mqtt extends core.Adapter {
201
200
  break;
202
201
  }
203
202
 
204
- if (topicSplit.length == 2 && messageObj.payload && messageObj.payload.state) {
203
+ if (messageObj.payload && messageObj.payload.state) {
205
204
  const newMessage = {
206
205
  payload: { available: messageObj.payload.state == 'online' },
207
- topic: topicSplit[0]
206
+ topic: messageObj.topic.replace('/availability', '')
208
207
  };
209
208
  statesController.processDeviceMessage(newMessage);
210
209
  }
211
210
  // States
212
- } else if (!messageObj.topic.includes('/')) {
213
- statesController.processDeviceMessage(messageObj);
211
+ } else {
214
212
  //console.log(JSON.stringify(messageObj));
213
+ statesController.processDeviceMessage(messageObj);
215
214
  }
216
215
  }
217
216
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zigbee2mqtt",
3
- "version": "2.4.1",
3
+ "version": "2.4.3",
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.27.0",
45
+ "eslint": "^8.28.0",
46
46
  "eslint-config-prettier": "^8.5.0",
47
47
  "eslint-plugin-prettier": "^4.2.1",
48
48
  "mocha": "^10.1.0",
@@ -50,7 +50,7 @@
50
50
  "proxyquire": "^2.1.3",
51
51
  "sinon": "^14.0.2",
52
52
  "sinon-chai": "^3.7.0",
53
- "typescript": "~4.8.4"
53
+ "typescript": "~4.9.3"
54
54
  },
55
55
  "main": "main.js",
56
56
  "files": [