iobroker.zigbee2mqtt 2.7.2 → 2.7.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
@@ -32,6 +32,10 @@ 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.3 (2023-02-18)
36
+
37
+ - (o0shojo0o) hotfix for Aqara presence detector FP1
38
+
35
39
  ### 2.7.2 (2023-02-01)
36
40
 
37
41
  - (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,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee2mqtt",
4
- "version": "2.7.2",
4
+ "version": "2.7.3",
5
5
  "news": {
6
+ "2.7.3": {
7
+ "en": "hotfix for Aqara presence detector FP1",
8
+ "de": "hotfix für Aqara Präsenzmelder FP1",
9
+ "ru": "hotfix для детектора присутствия Aqara FP1",
10
+ "pt": "hotfix para detector de presença Aqara FP1",
11
+ "nl": "quality over Quanteur FP1",
12
+ "fr": "hotfix pour détecteur de présence Aqara FP1",
13
+ "it": "hotfix per rilevatore di presenza Aqara FP1",
14
+ "es": "hotfix para detector de presencia Aqara FP1",
15
+ "pl": "hotfix",
16
+ "uk": "hotfix для датчика присутності Aqara FP1",
17
+ "zh-cn": "aqara存在侦查员FP1"
18
+ },
6
19
  "2.7.2": {
7
20
  "en": "rework of the detection of removed devices",
8
21
  "de": "nacharbeiten der erkennung von entfernten geräten",
@@ -80,19 +93,6 @@
80
93
  "pl": "tekst do akcji #84 (https:/github.com/o0shojo0o/ioBroker.zigbee2mqtt/issues/84)",
81
94
  "uk": "javaScript licenses API Веб-сайт Go1.13.8",
82
95
  "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
@@ -966,11 +966,24 @@ function createDeviceFromExposes(devicesMessag, config) {
966
966
 
967
967
  case 'composite':
968
968
  for (const prop of expose.features) {
969
- const st = genState(prop);
970
- st.prop = expose.property;
971
- st.inOptions = true;
969
+ // let state;
970
+ // if (prop.type == 'list' && prop.features) {
971
+ // const listName = prop.name;
972
+
973
+ // for (const feature of prop.features) {
974
+ // genState(feature, 'state', `${listName}_${feature.name}`, prop.description);
975
+ // }
976
+ // }
977
+
978
+ const state = genState(prop);
979
+ // Workaround for FP1 new state (region_upsert)
980
+ if (!state) {
981
+ break;
982
+ }
983
+ state.prop = expose.property;
984
+ state.inOptions = true;
972
985
  // I'm not fully sure, as it really needed, but
973
- st.setterOpt = (value, options) => {
986
+ state.setterOpt = (value, options) => {
974
987
  const result = {};
975
988
  options[prop.property] = value;
976
989
  result[expose.property] = options;
@@ -978,17 +991,17 @@ function createDeviceFromExposes(devicesMessag, config) {
978
991
  };
979
992
  // if we have a composite expose, the value have to be an object {expose.property : {prop.property: value}}
980
993
  if (prop.access & z2mAccess.SET) {
981
- st.setter = (value, options) => {
994
+ state.setter = (value, options) => {
982
995
  const result = {};
983
996
  options[prop.property] = value;
984
997
  result[expose.property] = options;
985
998
  return result;
986
999
  };
987
- st.setattr = expose.property;
1000
+ state.setattr = expose.property;
988
1001
  }
989
1002
  // if we have a composite expose, the payload will be an object {expose.property : {prop.property: value}}
990
1003
  if (prop.access & z2mAccess.STATE) {
991
- st.getter = payload => {
1004
+ state.getter = payload => {
992
1005
  if ((payload.hasOwnProperty(expose.property)) && (payload[expose.property] !== null) && payload[expose.property].hasOwnProperty(prop.property)) {
993
1006
  return !isNaN(payload[expose.property][prop.property]) ? payload[expose.property][prop.property] : undefined;
994
1007
  } else {
@@ -996,9 +1009,9 @@ function createDeviceFromExposes(devicesMessag, config) {
996
1009
  }
997
1010
  };
998
1011
  } else {
999
- st.getter = _payload => { return undefined; };
1012
+ state.getter = _payload => { return undefined; };
1000
1013
  }
1001
- pushToStates(st, prop.access);
1014
+ pushToStates(state, prop.access);
1002
1015
  }
1003
1016
  break;
1004
1017
  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.3",
4
4
  "description": "Zigbee2MQTT adapter for ioBroker",
5
5
  "author": {
6
6
  "name": "Dennis Rathjen",
@@ -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.13.0",
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.34.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": [