iobroker.zigbee2mqtt 3.0.5 → 3.0.7

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.5",
4
+ "version": "3.0.7",
5
5
  "news": {
6
+ "3.0.7": {
7
+ "en": "fix jsconconf",
8
+ "de": "fix jsconf",
9
+ "ru": "исправить jsconconf",
10
+ "pt": "corrigir jsconconf",
11
+ "nl": "jsconconf repareren",
12
+ "fr": "corriger jsconconf",
13
+ "it": "correzione jsconconf",
14
+ "es": "jsconf",
15
+ "pl": "fix jsconconf",
16
+ "uk": "закріпити jsconconf",
17
+ "zh-cn": "修复 jsconconconf"
18
+ },
19
+ "3.0.6": {
20
+ "en": "settings restructure\nfix icon not found message",
21
+ "de": "einstellungen restrukturieren\nsymbol nicht gefunden",
22
+ "ru": "реструктуризация настроек\nисправить иконку не найдено сообщение",
23
+ "pt": "reestruturação de configurações\ncorrigir ícone não encontrado mensagem",
24
+ "nl": "instellingen herstructureren\npictogram niet gevonden bericht herstellen",
25
+ "fr": "restructuration des paramètres\ncorrection icône non trouvée message",
26
+ "it": "installazione\nfix icona non trovato messaggio",
27
+ "es": "configuración de reestructuración\nfijar icono no encontrado mensaje",
28
+ "pl": "restrukturyzacja ustawień\nnie znaleziono ikony",
29
+ "uk": "реструктуризація параметрів\nне знайдено повідомлення",
30
+ "zh-cn": "设置调整\n未找到消息的修复图标"
31
+ },
6
32
  "3.0.5": {
7
33
  "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",
8
34
  "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",
@@ -67,32 +93,6 @@
67
93
  "pl": "pobierz ikonę corr",
68
94
  "uk": "cкачати ігру corr",
69
95
  "zh-cn": "corr 图标下载"
70
- },
71
- "3.0.0": {
72
- "en": "adaptation z2m 2.x",
73
- "de": "anpassung z2m 2.x",
74
- "ru": "адаптация z2m 2.x",
75
- "pt": "adaptação z2m 2.x",
76
- "nl": "aanpassing z2m 2.x",
77
- "fr": "adaptation z2m 2.x",
78
- "it": "adattamento z2m 2.x",
79
- "es": "adaptación z2m 2.x",
80
- "pl": "adaptacja z2m 2.x",
81
- "uk": "адаптація z2m 2.x",
82
- "zh-cn": "适应z2m 2.x"
83
- },
84
- "2.13.11": {
85
- "en": "corr package.json",
86
- "de": "korr paket.json",
87
- "ru": "коррек-пакет.json",
88
- "pt": "corr pacote.json",
89
- "nl": "corr package.json",
90
- "fr": "c'est ce qu'il a dit",
91
- "it": "pacchetto corr.json",
92
- "es": "corr package.json",
93
- "pl": "corr package.json",
94
- "uk": "english, українська, français..",
95
- "zh-cn": "corr 软件包.json"
96
96
  }
97
97
  },
98
98
  "messages": [
@@ -226,10 +226,9 @@
226
226
  ],
227
227
  "globalDependencies": [
228
228
  {
229
- "admin": ">=6.6.14"
229
+ "admin": ">=7.4.10"
230
230
  }
231
- ],
232
- "installedFrom": "iobroker.zigbee2mqtt@3.0.4"
231
+ ]
233
232
  },
234
233
  "native": {
235
234
  "connectionType": "ws",
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.zigbee2mqtt",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "description": "Zigbee2MQTT adapter for ioBroker",
5
5
  "author": {
6
6
  "name": "Dennis Rathjen and Arthur Rupp",
@@ -25,14 +25,14 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@iobroker/adapter-core": "^3.2.3",
28
- "@iobroker/dm-utils": "^1.0.9",
28
+ "@iobroker/dm-utils": "^1.0.10",
29
29
  "aedes": "^0.51.3",
30
30
  "aedes-persistence-nedb": "^2.0.3",
31
31
  "mqtt": "^5.10.4",
32
32
  "net": "^1.0.2",
33
33
  "node-schedule": "^2.1.1",
34
34
  "sharp": "^0.33.5",
35
- "ws": "^8.16.0"
35
+ "ws": "^8.18.2"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@alcalzone/release-script": "^3.8.0",
@@ -42,10 +42,10 @@
42
42
  "@iobroker/adapter-dev": "^1.4.0",
43
43
  "@iobroker/testing": "^5.0.4",
44
44
  "@tsconfig/node14": "^14.1.3",
45
- "@types/chai": "^5.2.1",
45
+ "@types/chai": "^5.2.2",
46
46
  "@types/chai-as-promised": "^8.0.2",
47
47
  "@types/mocha": "^10.0.10",
48
- "@types/node": "^22.15.3",
48
+ "@types/node": "^22.15.29",
49
49
  "@types/node-schedule": "^2.1.7",
50
50
  "@types/proxyquire": "^1.3.31",
51
51
  "@types/sinon": "^17.0.3",
@@ -53,7 +53,7 @@
53
53
  "chai": "^5.2.0",
54
54
  "chai-as-promised": "^8.0.1",
55
55
  "eslint": "^9.25.1",
56
- "eslint-config-prettier": "^10.1.1",
56
+ "eslint-config-prettier": "^10.1.5",
57
57
  "eslint-plugin-prettier": "^5.2.3",
58
58
  "mocha": "^11.0.1",
59
59
  "prettier": "^3.5.3",