iobroker.zigbee2mqtt 2.7.2 → 2.7.4

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,14 @@ 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.4 (2023-03-05)
36
+
37
+ - (o0shojo0o) fix for Aqara presence detector FP1 `reset_nopresence_status`
38
+
39
+ ### 2.7.3 (2023-02-18)
40
+
41
+ - (o0shojo0o) hotfix for Aqara presence detector FP1
42
+
35
43
  ### 2.7.2 (2023-02-01)
36
44
 
37
45
  - (o0shojo0o) rework of the detection of removed devices
@@ -25,5 +25,6 @@
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
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
+ "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.",
29
+ "Scheme": "Scheme"
29
30
  }
@@ -108,6 +108,7 @@
108
108
  },
109
109
  "webUIScheme": {
110
110
  "type": "select",
111
+ "label": "Scheme",
111
112
  "options": [
112
113
  {
113
114
  "label": "HTTP",
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee2mqtt",
4
- "version": "2.7.2",
4
+ "version": "2.7.4",
5
5
  "news": {
6
+ "2.7.4": {
7
+ "en": "fix for Aqara presence detector FP1 `reset_nopresence_status`",
8
+ "de": "fix für Aqara Präsenzmelder FP1 reset_nopresence_status",
9
+ "ru": "фикс для Aqara детектор присутствия FP1 reset_nopresence_status",
10
+ "pt": "correção para o detector de presença de Aqara FP1 reset_nopresence_status",
11
+ "nl": "vertaling:",
12
+ "fr": "fix pour détecteur de présence Aqara FP1 reset_nopresence_status",
13
+ "it": "correzione per rilevatore di presenza Aqara FP1 reset_nopresence_status",
14
+ "es": "fijado para el detector de presencia Aqara FP1 reset_nopresence_status",
15
+ "pl": "reset_nopresence_status (ang.)",
16
+ "uk": "фіксація для датчика присутності Aqara FP1 скидання_nopresence_status",
17
+ "zh-cn": "fix Aqara存在探测器FP1 重新定位_nopreence_status"
18
+ },
19
+ "2.7.3": {
20
+ "en": "hotfix for Aqara presence detector FP1",
21
+ "de": "hotfix für Aqara Präsenzmelder FP1",
22
+ "ru": "hotfix для детектора присутствия Aqara FP1",
23
+ "pt": "hotfix para detector de presença Aqara FP1",
24
+ "nl": "quality over Quanteur FP1",
25
+ "fr": "hotfix pour détecteur de présence Aqara FP1",
26
+ "it": "hotfix per rilevatore di presenza Aqara FP1",
27
+ "es": "hotfix para detector de presencia Aqara FP1",
28
+ "pl": "hotfix",
29
+ "uk": "hotfix для датчика присутності Aqara FP1",
30
+ "zh-cn": "aqara存在侦查员FP1"
31
+ },
6
32
  "2.7.2": {
7
33
  "en": "rework of the detection of removed devices",
8
34
  "de": "nacharbeiten der erkennung von entfernten geräten",
@@ -67,32 +93,6 @@
67
93
  "pl": "dodał również krok opcji 'Brightness'\ndodano obsługę jasności (stop #96) (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96)\nprzetwarzają bardziej elastyczne przetwory #94 (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94)",
68
94
  "uk": "доданий варіант `Бритальність кроку також повинен перетворювати світло або вимкнути`\nдодано обробка яскравості_кроку #[96](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/96)\n[94] (https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/94)",
69
95
  "zh-cn": "增加“权利步骤”的选择,也应该改变“或”的提法。\n增加光明处理:第[96]号(http://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/96)\n国家处理较为灵活的第[94]号(http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/94)"
70
- },
71
- "2.4.5": {
72
- "en": "extend 'text' for 'action' ([#84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84))",
73
- "de": "text für die Aktion #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/84)",
74
- "ru": "расширить текст для действия #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84)",
75
- "pt": "extensão do texto para a ação #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84)",
76
- "nl": "quality over Quantity (QoQ) Releases Vertaling:",
77
- "fr": "extension text for action #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/84)",
78
- "it": "estendere il testo all'azione #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/84)",
79
- "es": "extensión text for action #[84](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84)",
80
- "pl": "tekst do akcji #84 (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84)",
81
- "uk": "javaScript licenses API Веб-сайт Go1.13.8",
82
- "zh-cn": "行动案文[84](http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/84)"
83
- },
84
- "2.4.4": {
85
- "en": "better state identification ([#79](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/79))",
86
- "de": "bessere Zustandserkennung #[79](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/79)",
87
- "ru": "лучшая государственная идентификация #[79](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/79)",
88
- "pt": "melhor identificação do estado #[79](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/79)",
89
- "nl": "identificatie van de staat is beter",
90
- "fr": "meilleure identification de l ' État #[79](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/79)",
91
- "it": "migliore identificazione dello stato #[79](https://github.com/o0shojo0o/ioBroker.zigbee2mqt/issues/79)",
92
- "es": "mejor identificación estatal #[79](https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/79)",
93
- "pl": "zobacz też: #79 (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/79)",
94
- "uk": "[79] (https://github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/79)",
95
- "zh-cn": "更好的国家辨认(http://github.com/oshojo0o/ioBroker.zigbee2mqt/issues/79)"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -3,7 +3,6 @@ const createDeviceFromExposes = require('./exposes').createDeviceFromExposes;
3
3
  const utils = require('./utils');
4
4
  const colors = require('./colors.js');
5
5
  const rgb = require('./rgb.js');
6
- //const createCache = {};
7
6
 
8
7
  class DeviceController {
9
8
  constructor(adapter, deviceCache, groupCache, config, logCustomizations, createCache) {
@@ -15,7 +14,7 @@ class DeviceController {
15
14
  this.createCache = createCache;
16
15
  }
17
16
 
18
- async createDeviceDefinitions(devicesMessage) {
17
+ createDeviceDefinitions(devicesMessage) {
19
18
  utils.clearArray(this.deviceCache);
20
19
  for (const devicesMessag of devicesMessage) {
21
20
  if (this.logCustomizations.debugDevices.includes(devicesMessag.ieee_address)) {
@@ -27,8 +26,15 @@ class DeviceController {
27
26
  this.removeDeviceByIeee(this.deviceCache, devicesMessag.ieee_address);
28
27
 
29
28
  if (devicesMessag.definition.exposes) {
30
- const newDevice = createDeviceFromExposes(devicesMessag, this.config);
31
- this.deviceCache.push(newDevice);
29
+ try {
30
+ const newDevice = createDeviceFromExposes(devicesMessag, this.config);
31
+ this.deviceCache.push(newDevice);
32
+ } catch (err) {
33
+ this.adapter.log.warn(`Cannot ${devicesMessag.friendly_name} create Device from Exposes!`);
34
+ this.adapter.log.debug(JSON.stringify(devicesMessag));
35
+ this.adapter.log.debug(err);
36
+ }
37
+
32
38
  }
33
39
  }
34
40
  }
package/lib/exposes.js CHANGED
@@ -113,7 +113,12 @@ function genState(expose, role, name, desc) {
113
113
  };
114
114
 
115
115
  for (const val of expose.values) {
116
- state.states[val] = val;
116
+ // if a definition of a button (eg. Aqara presence detector FP1)
117
+ if (val == '') {
118
+ state.states[propName] = propName;
119
+ } else {
120
+ state.states[val] = val;
121
+ }
117
122
  state.type = typeof (val);
118
123
  }
119
124
 
@@ -966,11 +971,24 @@ function createDeviceFromExposes(devicesMessag, config) {
966
971
 
967
972
  case 'composite':
968
973
  for (const prop of expose.features) {
969
- const st = genState(prop);
970
- st.prop = expose.property;
971
- st.inOptions = true;
974
+ // let state;
975
+ // if (prop.type == 'list' && prop.features) {
976
+ // const listName = prop.name;
977
+
978
+ // for (const feature of prop.features) {
979
+ // genState(feature, 'state', `${listName}_${feature.name}`, prop.description);
980
+ // }
981
+ // }
982
+
983
+ const state = genState(prop);
984
+ // Workaround for FP1 new state (region_upsert)
985
+ if (!state) {
986
+ break;
987
+ }
988
+ state.prop = expose.property;
989
+ state.inOptions = true;
972
990
  // I'm not fully sure, as it really needed, but
973
- st.setterOpt = (value, options) => {
991
+ state.setterOpt = (value, options) => {
974
992
  const result = {};
975
993
  options[prop.property] = value;
976
994
  result[expose.property] = options;
@@ -978,17 +996,17 @@ function createDeviceFromExposes(devicesMessag, config) {
978
996
  };
979
997
  // if we have a composite expose, the value have to be an object {expose.property : {prop.property: value}}
980
998
  if (prop.access & z2mAccess.SET) {
981
- st.setter = (value, options) => {
999
+ state.setter = (value, options) => {
982
1000
  const result = {};
983
1001
  options[prop.property] = value;
984
1002
  result[expose.property] = options;
985
1003
  return result;
986
1004
  };
987
- st.setattr = expose.property;
1005
+ state.setattr = expose.property;
988
1006
  }
989
1007
  // if we have a composite expose, the payload will be an object {expose.property : {prop.property: value}}
990
1008
  if (prop.access & z2mAccess.STATE) {
991
- st.getter = payload => {
1009
+ state.getter = payload => {
992
1010
  if ((payload.hasOwnProperty(expose.property)) && (payload[expose.property] !== null) && payload[expose.property].hasOwnProperty(prop.property)) {
993
1011
  return !isNaN(payload[expose.property][prop.property]) ? payload[expose.property][prop.property] : undefined;
994
1012
  } else {
@@ -996,9 +1014,9 @@ function createDeviceFromExposes(devicesMessag, config) {
996
1014
  }
997
1015
  };
998
1016
  } else {
999
- st.getter = _payload => { return undefined; };
1017
+ state.getter = _payload => { return undefined; };
1000
1018
  }
1001
- pushToStates(st, prop.access);
1019
+ pushToStates(state, prop.access);
1002
1020
  }
1003
1021
  break;
1004
1022
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zigbee2mqtt",
3
- "version": "2.7.2",
3
+ "version": "2.7.4",
4
4
  "description": "Zigbee2MQTT adapter for ioBroker",
5
5
  "author": {
6
6
  "name": "Dennis Rathjen",
@@ -20,11 +20,11 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@iobroker/adapter-core": "^2.6.7",
23
- "aedes": "^0.48.1",
23
+ "aedes": "^0.49.0",
24
24
  "aedes-persistence-nedb": "^2.0.3",
25
25
  "mqtt": "^4.3.7",
26
26
  "net": "^1.0.2",
27
- "ws": "^8.12.0"
27
+ "ws": "^8.12.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@alcalzone/release-script-plugin-iobroker": "^3.5.9",
@@ -36,21 +36,21 @@
36
36
  "@types/chai": "^4.3.4",
37
37
  "@types/chai-as-promised": "^7.1.5",
38
38
  "@types/mocha": "^10.0.1",
39
- "@types/node": "^18.11.18",
39
+ "@types/node": "^18.14.6",
40
40
  "@types/proxyquire": "^1.3.28",
41
41
  "@types/sinon": "^10.0.13",
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.33.0",
45
+ "eslint": "^8.35.0",
46
46
  "eslint-config-prettier": "^8.6.0",
47
47
  "eslint-plugin-prettier": "^4.2.1",
48
48
  "mocha": "^10.2.0",
49
- "prettier": "^2.8.3",
49
+ "prettier": "^2.8.4",
50
50
  "proxyquire": "^2.1.3",
51
51
  "sinon": "^15.0.1",
52
52
  "sinon-chai": "^3.7.0",
53
- "typescript": "~4.9.4"
53
+ "typescript": "~4.9.5"
54
54
  },
55
55
  "main": "main.js",
56
56
  "files": [