iobroker.zigbee2mqtt 2.4.0 → 2.4.2
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 +12 -1
- package/io-package.json +27 -27
- package/lib/deviceController.js +1 -1
- package/lib/exposes.js +81 -2
- package/lib/mqttServerController.js +9 -3
- package/lib/statesController.js +3 -3
- package/lib/websocketController.js +6 -0
- package/main.js +10 -5
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
[](https://nodei.co/npm/iobroker.zigbee2mqtt/)
|
|
11
11
|
|
|
12
|
-
**Tests:**
|
|
12
|
+
**Tests:**
|
|
13
|
+

|
|
14
|
+

|
|
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.2 (2022-11-20)
|
|
36
|
+
|
|
37
|
+
- (o0shojo0o) added correct handling of `move_to_saturation`, `hue_move` and `brightness_move_to_level` ([#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68))
|
|
38
|
+
- (o0shojo0o) fix when `friendly_name` `/` contains
|
|
39
|
+
|
|
40
|
+
### 2.4.1 (2022-11-16)
|
|
41
|
+
|
|
42
|
+
- (o0shojo0o) fix based on [review](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)
|
|
43
|
+
|
|
33
44
|
### 2.4.0 (2022-11-08)
|
|
34
45
|
|
|
35
46
|
- (o0shojo0o) fix for devices with multiple endpoints ([#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/57)).
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "zigbee2mqtt",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.2",
|
|
5
5
|
"news": {
|
|
6
|
+
"2.4.2": {
|
|
7
|
+
"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",
|
|
8
|
+
"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",
|
|
9
|
+
"ru": "добавлена правильная обработка move_to_saturation, hue_move и brightness_move_to_level [#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68)\nисправить, когда friendly_name `/` содержит",
|
|
10
|
+
"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",
|
|
11
|
+
"nl": "voegde de juiste behandeling van verplaatsing, huemove and brightnessmovetolevel 68) (httub /0shojoo-0-Bio-Broctrotqusts)\nvertaling: _",
|
|
12
|
+
"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",
|
|
13
|
+
"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",
|
|
14
|
+
"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",
|
|
15
|
+
"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ć",
|
|
16
|
+
"uk": "додано правильну обробку рухом_to_saturation, hue_move_move_to_level [#68](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/68)\nфіксація при дружній_ім`я `/` в наявності",
|
|
17
|
+
"zh-cn": "进一步正确地处理搬迁问题:流向、障碍和光明_move_to_级[#68](http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/68)\nfix 友好时的名称:“/” 内载"
|
|
18
|
+
},
|
|
19
|
+
"2.4.1": {
|
|
20
|
+
"en": "fix based on [review](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)",
|
|
21
|
+
"de": "(https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)",
|
|
22
|
+
"ru": "исправить на [review](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)",
|
|
23
|
+
"pt": "correção com base em [review](https://github.com/ioBroker/ioBroker.repositories/pull/1976#comment-1316656378)",
|
|
24
|
+
"nl": "quality over Quantity Releases Vertaling:",
|
|
25
|
+
"fr": "fix based on [review](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)",
|
|
26
|
+
"it": "fix based on [review](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)",
|
|
27
|
+
"es": "fijado basado en [review](https://github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656378)",
|
|
28
|
+
"pl": "recenzent oparty na przeglądzie (https:/github.com/ioBroker/ioBroker.repositories/pull/1976#issuecomment-1316656363636378)",
|
|
29
|
+
"uk": "javaScript licenses API Веб-сайт Go1.13.8",
|
|
30
|
+
"zh-cn": "fix 基于[审查](http://github.com/ioBroker/ioBroker.reories/pull/1976#issuement-1316656378)"
|
|
31
|
+
},
|
|
6
32
|
"2.4.0": {
|
|
7
33
|
"en": "fix for devices with multiple endpoints ([#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/57)).\nadded option `Brightness move should also turn the light on or off`\nadded state toggle for groups \nmore dynamic during data point creation ([#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/48)).",
|
|
8
34
|
"de": "fix für Geräte mit mehreren Endpunkten [#57](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/57).\nzusätzliche Option `Brightness move sollte auch das Licht ein- oder ausschalten `\nzusatzzustandswinkel für gruppen\nmehr Dynamik bei der Erstellung von Datenpunkten [#48](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/48).",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "wykrywanie zaawansowane, jeśli urządzenie zostało usunięte\numożliwia to błędy projektowe w łączu internetowym",
|
|
68
94
|
"uk": "розширене виявлення, якщо пристрій було видалено\nвиправлено помилку дизайну в підключенні websocket",
|
|
69
95
|
"zh-cn": "如果一个装置被拆除,则预先发现\nf 确定网站的设计错误"
|
|
70
|
-
},
|
|
71
|
-
"2.1.0": {
|
|
72
|
-
"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",
|
|
73
|
-
"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",
|
|
74
|
-
"ru": "добавлена опция для синхронизации цветовой температуры с цветом\nисправить logfilter и debugDevices\nмного багфиксов\nтеперь установите правильный мин/макс на цветной темп\nлучшая обработка ошибок для подключений",
|
|
75
|
-
"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",
|
|
76
|
-
"nl": "vertaling:\nvertaling:\nveel insectenfixen\nzet nu de juiste min/max op kleurtemperatuur\nbeter fout gaan voor de connecties",
|
|
77
|
-
"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",
|
|
78
|
-
"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",
|
|
79
|
-
"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",
|
|
80
|
-
"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ń",
|
|
81
|
-
"uk": "додано варіант синхронізації кольору з кольором\nвиправити logfilter і debugDevices\nбагато помилок\nтепер встановлюємо правильний хв/макс за кольором\nкраща обробка помилок для підключення",
|
|
82
|
-
"zh-cn": "添加了用颜色的气温合办法\nfix 木图和溶剂\n批发\n现将正确的分钟/升值确定为色色彩。\na. 处理联系的错误"
|
|
83
|
-
},
|
|
84
|
-
"2.0.0": {
|
|
85
|
-
"en": "*!!!BREAKING CHANGE!!!**\n\nadded configurable connection to Zigbee2MQTT (Settings must be renewed)\nWebsocket\nExternal MQTT-Server\nInternal MQTT-Server\noptimized state writing performance in ioBroker\nfixed the correct set of the connection status",
|
|
86
|
-
"de": "*! BREAKING CHANGE*\n\nzusätzliche konfigurierbare Verbindung zu Zigbee2MQTT (Einstellungen müssen erneuert werden)\nWebsocket\nExterner MQTT-Server\nInterner MQTT-Server\noptimierte Zustandsschreibleistung in ioBroker\nden korrekten satz des verbindungsstatus festlegt",
|
|
87
|
-
"ru": "*! ИЗМЕНЕНИЕ ЗАВТРА*\n\nдобавлена настраиваемая связь с Zigbee2MQTT (Настройки должны быть обновлены)\nWebsocket\nВнешний MQTT-Server\nВнутренний MQTT-Server\nоптимизированное представление государственной записи в ioBroker\nисправил правильный набор состояния соединения",
|
|
88
|
-
"pt": "*! QUE GRANDE MUDANÇA\n\nconexão configurável adicionada ao Zigbee2MQTT (As inscrições devem ser renovadas)\nWebsocket\nMQTT externo-Server\nMQTT interno-Server\ndesempenho de escrita de estado otimizado no ioBroker\nfixou o conjunto correto do status da conexão",
|
|
89
|
-
"nl": "♪ \n\nvoegde connectie toe aan Zigbee2MQT (Settings moet vernieuwd)\nWebsocket\nExterne MQTT-Server\nInterne MQTT-Server\noptimaal staatsschrijving in ioBroker\nde correcte set van de connectie status",
|
|
90
|
-
"fr": "*! CHANGE DE BREAKING*\n\nconnexion configurable ajoutée à Zigbee2MQTT (Les paramètres doivent être renouvelés)\nWebsocket\nMQTT-Serveur externe\nInterne MQTT-Serveur\nperformance d'écriture d'état optimisée en ioBroker\nfixe l'ensemble correct du statut de connexion",
|
|
91
|
-
"it": "# CAMBIAMENTO\n\naggiunta di connessione configurabile a Zigbee2MQTT (I posti devono essere rinnovati)\nWebsocket\nMQTT-Server esterno\nInterno MQTT-Server\nprestazioni di scrittura dello stato ottimizzate in ioBroker\nfisso l'insieme corretto dello stato di connessione",
|
|
92
|
-
"es": "*! ¡CAMBIANDO\n\nconexión configurable agregada a Zigbee2MQTT (Se debe renovar la configuración)\nWebsocket\nMQTT externo-Server\nInterno MQTT-Server\nrendimiento de escritura de estado optimizado en ioBroker\nfija el conjunto correcto del estado de conexión",
|
|
93
|
-
"pl": "! BREAKING CHANGE! (ANG.)\n\nzigbee2MQTT dodano połączenie konfigurowalne. (Odrodzenie się)\nStrona internetowa\nOficjalna strona MQTT-Server\nOficjalna strona MQTT\nzoptymalizowany stan pisania w ioBrokerze\nustalono poprawny zbiór statusu związku",
|
|
94
|
-
"uk": "* БРЕАКІНГ ЧАНГ*\n\nдодано налаштування підключення до Zigbee2MQTT (Налаштування повинні бути відновлені)\nВеб-сайт\nЗовнішній MQTT-Server\nВнутрішній MQTT-Server\nоптимізоване державне письмо продуктивність в ioBroker\nвиправлено правильний набір статусу підключення",
|
|
95
|
-
"zh-cn": "页:1 BREAKREANGE*\n\n兹格贝雷2 MQTT的可图联系 (必须重启)\n网站\n外贸总协定\n内贸总协定\n最佳国家书面表现\na. 固定的联络点地位"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/lib/deviceController.js
CHANGED
|
@@ -235,7 +235,7 @@ class DeviceController {
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
if (ieee_address != undefined) {
|
|
238
|
-
this.adapter.
|
|
238
|
+
this.adapter.setState(`${ieee_address}.available`, false, true);
|
|
239
239
|
this.adapter.extendObject(`${ieee_address}`, { common: { name: 'Device removed!', } });
|
|
240
240
|
delete this.createCache[ieee_address];
|
|
241
241
|
}
|
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
|
|
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
|
|
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, ''),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const core = require('@iobroker/adapter-core');
|
|
2
2
|
const Aedes = require('aedes');
|
|
3
3
|
const net = require('net');
|
|
4
|
-
|
|
4
|
+
let mqttServer;
|
|
5
5
|
|
|
6
6
|
class MqttServerController {
|
|
7
7
|
constructor(adapter) {
|
|
@@ -14,7 +14,7 @@ class MqttServerController {
|
|
|
14
14
|
const db = new NedbPersistence({ path: `${core.getAbsoluteInstanceDataDir(this.adapter)}/mqttData`, prefix: '' });
|
|
15
15
|
// @ts-ignore
|
|
16
16
|
const aedes = Aedes({ persistence: db });
|
|
17
|
-
|
|
17
|
+
mqttServer = net.createServer(aedes.handle);
|
|
18
18
|
mqttServer.listen(this.adapter.config.mqttServerPort, this.adapter.config.mqttServerIPBind, () => {
|
|
19
19
|
this.adapter.log.info(`Statring MQTT-Server on IP ${this.adapter.config.mqttServerIPBind} and Port ${this.adapter.config.mqttServerPort}`);
|
|
20
20
|
});
|
|
@@ -27,7 +27,7 @@ class MqttServerController {
|
|
|
27
27
|
try {
|
|
28
28
|
// @ts-ignore
|
|
29
29
|
const aedes = Aedes();
|
|
30
|
-
|
|
30
|
+
mqttServer = net.createServer(aedes.handle);
|
|
31
31
|
mqttServer.listen(this.adapter.config.mqttServerPort, this.adapter.config.mqttServerIPBind, () => {
|
|
32
32
|
this.adapter.log.info(`Statring DummyMQTT-Server on IP ${this.adapter.config.mqttServerIPBind} and Port ${this.adapter.config.mqttServerPort}`);
|
|
33
33
|
});
|
|
@@ -35,6 +35,12 @@ class MqttServerController {
|
|
|
35
35
|
this.adapter.log.error(err);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
closeServer() {
|
|
40
|
+
if (mqttServer && !mqttServer.closed()) {
|
|
41
|
+
mqttServer.close();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
module.exports = {
|
package/lib/statesController.js
CHANGED
|
@@ -140,12 +140,12 @@ class StatesController {
|
|
|
140
140
|
for (const device of this.groupCache.concat(this.deviceCache)) {
|
|
141
141
|
for (const state of device.states) {
|
|
142
142
|
if (state.write == true) {
|
|
143
|
-
this.adapter.
|
|
143
|
+
this.adapter.subscribeStates(`${device.ieee_address}.${state.id}`);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
this.adapter.
|
|
148
|
-
this.adapter.
|
|
147
|
+
this.adapter.subscribeStates('info.debugmessages');
|
|
148
|
+
this.adapter.subscribeStates('info.logfilter');
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
async setAllAvailableToFalse() {
|
|
@@ -72,6 +72,12 @@ class WebsocketController {
|
|
|
72
72
|
}, restartTimeout);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
closeConnection() {
|
|
76
|
+
if (wsClient && wsClient.readyState !== WebSocket.CLOSED) {
|
|
77
|
+
wsClient.close();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
75
81
|
async allTimerClear() {
|
|
76
82
|
clearTimeout(pingTimeout);
|
|
77
83
|
clearTimeout(ping);
|
package/main.js
CHANGED
|
@@ -52,7 +52,7 @@ class Zigbee2mqtt extends core.Adapter {
|
|
|
52
52
|
// Initialize your adapter here
|
|
53
53
|
adapterInfo(this.config, this.log);
|
|
54
54
|
|
|
55
|
-
this.
|
|
55
|
+
this.setState('info.connection', false, true);
|
|
56
56
|
|
|
57
57
|
const debugDevicesState = await this.getStateAsync('info.debugmessages');
|
|
58
58
|
if (debugDevicesState && debugDevicesState.val) {
|
|
@@ -126,7 +126,7 @@ class Zigbee2mqtt extends core.Adapter {
|
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
wsClient.on('close', async () => {
|
|
129
|
-
this.
|
|
129
|
+
this.setStateChanged('info.connection', false, true);
|
|
130
130
|
await statesController.setAllAvailableToFalse();
|
|
131
131
|
this.log.warn('Websocket disconnected');
|
|
132
132
|
});
|
|
@@ -149,7 +149,7 @@ class Zigbee2mqtt extends core.Adapter {
|
|
|
149
149
|
if (messageObj.payload.state != 'online') {
|
|
150
150
|
statesController.setAllAvailableToFalse();
|
|
151
151
|
}
|
|
152
|
-
this.
|
|
152
|
+
this.setStateChanged('info.connection', messageObj.payload.state == 'online', true);
|
|
153
153
|
break;
|
|
154
154
|
case 'bridge/devices':
|
|
155
155
|
await deviceController.createDeviceDefinitions(messageObj.payload);
|
|
@@ -209,9 +209,9 @@ class Zigbee2mqtt extends core.Adapter {
|
|
|
209
209
|
statesController.processDeviceMessage(newMessage);
|
|
210
210
|
}
|
|
211
211
|
// States
|
|
212
|
-
} else
|
|
213
|
-
statesController.processDeviceMessage(messageObj);
|
|
212
|
+
} else {
|
|
214
213
|
//console.log(JSON.stringify(messageObj));
|
|
214
|
+
statesController.processDeviceMessage(messageObj);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
break;
|
|
@@ -220,6 +220,11 @@ class Zigbee2mqtt extends core.Adapter {
|
|
|
220
220
|
|
|
221
221
|
async onUnload(callback) {
|
|
222
222
|
try {
|
|
223
|
+
if (mqttClient && !mqttClient.closed) {
|
|
224
|
+
mqttClient.close();
|
|
225
|
+
}
|
|
226
|
+
mqttServerController.closeServer();
|
|
227
|
+
websocketController.closeConnection();
|
|
223
228
|
await statesController.setAllAvailableToFalse();
|
|
224
229
|
await websocketController.allTimerClear();
|
|
225
230
|
await statesController.allTimerClear();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.zigbee2mqtt",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Zigbee2MQTT adapter for ioBroker",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Dennis Rathjen",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"aedes-persistence-nedb": "^2.0.3",
|
|
25
25
|
"mqtt": "^4.3.7",
|
|
26
26
|
"net": "^1.0.2",
|
|
27
|
-
"ws": "^8.
|
|
27
|
+
"ws": "^8.11.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@alcalzone/release-script-plugin-iobroker": "^3.5.9",
|
|
@@ -33,24 +33,24 @@
|
|
|
33
33
|
"@iobroker/adapter-dev": "^1.2.0",
|
|
34
34
|
"@iobroker/testing": "^4.1.0",
|
|
35
35
|
"@tsconfig/node14": "^1.0.3",
|
|
36
|
-
"@types/chai": "^4.3.
|
|
36
|
+
"@types/chai": "^4.3.4",
|
|
37
37
|
"@types/chai-as-promised": "^7.1.5",
|
|
38
38
|
"@types/mocha": "^10.0.0",
|
|
39
39
|
"@types/node": "^18.11.9",
|
|
40
40
|
"@types/proxyquire": "^1.3.28",
|
|
41
41
|
"@types/sinon": "^10.0.13",
|
|
42
|
-
"@types/sinon-chai": "^3.2.
|
|
43
|
-
"chai": "^4.3.
|
|
42
|
+
"@types/sinon-chai": "^3.2.9",
|
|
43
|
+
"chai": "^4.3.7",
|
|
44
44
|
"chai-as-promised": "^7.1.1",
|
|
45
|
-
"eslint": "^8.
|
|
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",
|
|
49
49
|
"prettier": "^2.7.1",
|
|
50
50
|
"proxyquire": "^2.1.3",
|
|
51
|
-
"sinon": "^14.0.
|
|
51
|
+
"sinon": "^14.0.2",
|
|
52
52
|
"sinon-chai": "^3.7.0",
|
|
53
|
-
"typescript": "~4.
|
|
53
|
+
"typescript": "~4.9.3"
|
|
54
54
|
},
|
|
55
55
|
"main": "main.js",
|
|
56
56
|
"files": [
|