iobroker.zigbee2mqtt 3.0.4 → 3.0.6

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/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "zigbee2mqtt",
4
- "version": "3.0.4",
4
+ "version": "3.0.6",
5
5
  "news": {
6
+ "3.0.6": {
7
+ "en": "settings restructure\nfix icon not found message",
8
+ "de": "einstellungen restrukturieren\nsymbol nicht gefunden",
9
+ "ru": "реструктуризация настроек\nисправить иконку не найдено сообщение",
10
+ "pt": "reestruturação de configurações\ncorrigir ícone não encontrado mensagem",
11
+ "nl": "instellingen herstructureren\npictogram niet gevonden bericht herstellen",
12
+ "fr": "restructuration des paramètres\ncorrection icône non trouvée message",
13
+ "it": "installazione\nfix icona non trovato messaggio",
14
+ "es": "configuración de reestructuración\nfijar icono no encontrado mensaje",
15
+ "pl": "restrukturyzacja ustawień\nnie znaleziono ikony",
16
+ "uk": "реструктуризація параметрів\nне знайдено повідомлення",
17
+ "zh-cn": "设置调整\n未找到消息的修复图标"
18
+ },
19
+ "3.0.5": {
20
+ "en": "add additional folder for some devices (like smoke detector)\nstate.js cleanup\nset available State to true if device message include last_seen status",
21
+ "de": "zusätzliche ordner für einige geräte hinzufügen (wie rauchmelder)\nstate.js cleanup\neingestellt verfügbar Zustand, um wahr zu sein, wenn die Gerätenachricht last_seen status enthält",
22
+ "ru": "добавьте дополнительную папку для некоторых устройств (например, детектор дыма)\nочистка state.js\nустановленное состояние истинно, если сообщение устройства включает в себя статус last_seen",
23
+ "pt": "adicionar pasta adicional para alguns dispositivos (como detector de fumaça)\nlimpeza state.js\nset available Estado para true se a mensagem do dispositivo incluir status last_seen",
24
+ "nl": "extra map toevoegen voor sommige apparaten (zoals rookmelder)\nstate.js opruimen\nbeschikbare status instellen op true als apparaatbericht laatste_geziene status bevat",
25
+ "fr": "ajouter un dossier supplémentaire pour certains appareils (comme le détecteur de fumée)\nétat.js nettoyage\ndéfinir l'État disponible à true si le message de périphérique inclut le statut last_seen",
26
+ "it": "aggiungere cartella aggiuntiva per alcuni dispositivi (come rilevatore di fumo)\nstato.js pulizia\nse il messaggio del dispositivo include lo stato di last_seen",
27
+ "es": "añadir carpeta adicional para algunos dispositivos (como detector de humos)\nestado.js limpieza\nestado disponible para ver si el mensaje del dispositivo incluye el estado de último visto",
28
+ "pl": "dodaj dodatkowy folder dla niektórych urządzeń (np. czujnik dymu)\nstan. js cleanup\nustaw dostępny stan na true jeśli wiadomość urządzenia zawiera status last _ seen",
29
+ "uk": "додати додаткову папку для деяких пристроїв (наприклад, детектор диму)\nстан.js cleanup\nвстановити доступну державу, якщо повідомлення про пристрій включають статус останнього_seen",
30
+ "zh-cn": "为一些设备添加额外的文件夹( 如烟雾探测器)\n状态.js 清理\n如果设备消息包含最后的_ Seenn 状态, 将可用状态设定为 true"
31
+ },
6
32
  "3.0.4": {
7
33
  "en": "update admin",
8
34
  "de": "admin",
@@ -67,32 +93,6 @@
67
93
  "pl": "adaptacja z2m 2.x",
68
94
  "uk": "адаптація z2m 2.x",
69
95
  "zh-cn": "适应z2m 2.x"
70
- },
71
- "2.13.11": {
72
- "en": "corr package.json",
73
- "de": "korr paket.json",
74
- "ru": "коррек-пакет.json",
75
- "pt": "corr pacote.json",
76
- "nl": "corr package.json",
77
- "fr": "c'est ce qu'il a dit",
78
- "it": "pacchetto corr.json",
79
- "es": "corr package.json",
80
- "pl": "corr package.json",
81
- "uk": "english, українська, français..",
82
- "zh-cn": "corr 软件包.json"
83
- },
84
- "2.13.10": {
85
- "en": "update dependecy\nadd available object for groups",
86
- "de": "aktualisierung abhängigkeit\nobjekt für gruppen hinzufügen",
87
- "ru": "обновление\nдобавить доступный объект для групп",
88
- "pt": "atualização\nadicionar objeto disponível para grupos",
89
- "nl": "afhankelijkheid bijwerken\nbeschikbaar object voor groepen toevoegen",
90
- "fr": "mettre à jour la dépendance\najouter un objet disponible pour les groupes",
91
- "it": "aggiornamento dipendenza\naggiungere oggetto disponibile per gruppi",
92
- "es": "dependencia de actualización\nañadir objeto disponible para grupos",
93
- "pl": "aktualizacja zależności\ndodaj dostępny obiekt dla grup",
94
- "uk": "оновлення залежності\nдодати доступний об'єкт для груп",
95
- "zh-cn": "更新依赖性\n为组添加可用对象"
96
96
  }
97
97
  },
98
98
  "messages": [
@@ -228,7 +228,8 @@
228
228
  {
229
229
  "admin": ">=6.6.14"
230
230
  }
231
- ]
231
+ ],
232
+ "installedFrom": "iobroker.zigbee2mqtt@3.0.4"
232
233
  },
233
234
  "native": {
234
235
  "connectionType": "ws",
@@ -263,7 +264,8 @@
263
264
  "coordinatorCheck": false,
264
265
  "coordinatorCheckLogLvl": "info",
265
266
  "coordinatorCheckCron": "0 3 * * *",
266
- "allwaysUpdateOccupancyState": false
267
+ "allwaysUpdateOccupancyState": false,
268
+ "allwaysUpdateAvailableState": false
267
269
  },
268
270
  "protectedNative": [
269
271
  "externalMqttServerPassword",
@@ -1,4 +1,4 @@
1
- const states = require('./states').states;
1
+ const statesDefs = require('./states').states;
2
2
  const createDeviceFromExposes = require('./exposes').createDeviceFromExposes;
3
3
  const utils = require('./utils');
4
4
  const colors = require('./colors.js');
@@ -55,10 +55,10 @@ class DeviceController {
55
55
  icon: undefined, // await imageController.getDeviceIcon(devicesMessag), device.definition.model
56
56
  optionsValues: {},
57
57
  states: [
58
- states.available,
59
- states.brightness,
60
- states.colortemp_move,
61
- states.transition,
58
+ statesDefs.available,
59
+ statesDefs.brightness,
60
+ statesDefs.colortemp_move,
61
+ statesDefs.transition,
62
62
  {
63
63
  id: 'state',
64
64
  prob: 'state',
package/lib/exposes.js CHANGED
@@ -1144,7 +1144,7 @@ async function createDeviceFromExposes(devicesMessag, adapter) {
1144
1144
  break;
1145
1145
 
1146
1146
  case 'battery_low':
1147
- state = statesDefs.heiman_batt_low;
1147
+ state = statesDefs.batt_low_t_f;
1148
1148
  break;
1149
1149
 
1150
1150
  case 'tamper':
@@ -1152,7 +1152,7 @@ async function createDeviceFromExposes(devicesMessag, adapter) {
1152
1152
  break;
1153
1153
 
1154
1154
  case 'water_leak':
1155
- state = statesDefs.water_detected;
1155
+ state = statesDefs.water_leak;
1156
1156
  break;
1157
1157
 
1158
1158
  case 'lock':
@@ -1220,10 +1220,10 @@ async function createDeviceFromExposes(devicesMessag, adapter) {
1220
1220
  pushToStates(statesDefs.climate_running_mode, prop.access);
1221
1221
  break;
1222
1222
  case 'local_temperature':
1223
- pushToStates(statesDefs.hvacThermostat_local_temp, prop.access);
1223
+ pushToStates(statesDefs.local_temperature, prop.access);
1224
1224
  break;
1225
1225
  case 'local_temperature_calibration':
1226
- pushToStates(statesDefs.hvacThermostat_local_temp_calibration, prop.access);
1226
+ pushToStates(statesDefs.local_temperature_calibration, prop.access);
1227
1227
  break;
1228
1228
  default:
1229
1229
  {
@@ -53,6 +53,7 @@ class ImageController {
53
53
  const slsIconFileName = `${this.sanitizeModelIDForImageUrl(device.model_id)}.png`;
54
54
 
55
55
  let iconFileName = await this.getExistingIconFileName(z2mIconFileNameJPG, z2mIconFileNamePNG, slsIconFileName);
56
+ let iconFound = true;
56
57
 
57
58
  if (!iconFileName) {
58
59
  const iconUrls = [
@@ -63,30 +64,29 @@ class ImageController {
63
64
 
64
65
  for (const iconUrl of iconUrls) {
65
66
  try {
66
- await this.downloadIcon(this.adapter, iconUrl, this.adapter.namespace);
67
- iconFileName = this.getFileNameWithExtension(iconUrl);
68
- break;
69
- } catch (err) {
70
- this.adapter.log.warn(`Failed to download image from ${iconUrl}`);
67
+ iconFound = await this.downloadIcon(this.adapter, iconUrl, this.adapter.namespace);
68
+ if (iconFound) {
69
+ iconFileName = this.getFileNameWithExtension(iconUrl);
70
+ break;
71
+ }
72
+ } catch (ex) {
73
+ // check next pic
71
74
  }
72
75
  }
73
76
  }
74
77
 
75
- if (!iconFileName) {
76
- this.adapter.log.warn(`No image for device model: ${device.definition.model} found!`);
78
+ if (!iconFound) {
79
+ this.adapter.log.warn(`Failed to download image for device model: ${device.definition.model} - ${device.definition.description}`);
77
80
  return '';
78
- }
79
-
80
- let icon;
81
- try {
81
+ } else {
82
82
  // Load image from the Meta-Store
83
- icon = await this.adapter.readFileAsync(this.adapter.namespace, iconFileName);
83
+ const icon = await this.adapter.readFileAsync(this.adapter.namespace, iconFileName);
84
84
  // Load Image Metadata
85
85
  const origIconMeta = await sharp(icon.file).metadata();
86
86
  // Check whether the image needs to be resized
87
87
  if (
88
88
  (origIconMeta.height && origIconMeta.height > imageSize) ||
89
- (origIconMeta.width && origIconMeta.width > imageSize)
89
+ (origIconMeta.width && origIconMeta.width > imageSize)
90
90
  ) {
91
91
  // Resize image to 28x28 pixel
92
92
  this.adapter.log.info(
@@ -103,12 +103,10 @@ class ImageController {
103
103
  // Replace the original image with the resize image.
104
104
  await this.adapter.writeFileAsync(this.adapter.namespace, iconFileName, icon.file);
105
105
  }
106
- } catch (error) {
107
- this.adapter.log.warn(error);
108
- return '';
106
+
107
+ // Create and output Base64
108
+ return `data:image/png;base64,${icon.file.toString('base64')}`;
109
109
  }
110
- // Create and output Base64
111
- return `data:image/png;base64,${icon.file.toString('base64')}`;
112
110
  }
113
111
  getFileNameWithExtension(url) {
114
112
  const path = new URL(url).pathname;
@@ -121,8 +119,10 @@ class ImageController {
121
119
  try {
122
120
  const res = await axios.get(url, { responseType: 'arraybuffer' });
123
121
  await adapter.writeFileAsync(namespace, this.getFileNameWithExtension(url), res.data);
122
+ return true;
124
123
  } catch (ex) {
125
- adapter.log.warn(ex);
124
+ //adapter.log.warn(ex);
125
+ return false;
126
126
  }
127
127
  }
128
128
  async getExistingIconFileName(z2mIconFileNameJPG, z2mIconFileNamePNG, slsIconFileName) {