iobroker.zigbee 1.7.1 → 1.7.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 +4 -1
- package/io-package.json +14 -2
- package/lib/statescontroller.js +31 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -126,11 +126,14 @@ You can thank the authors by these links:
|
|
|
126
126
|
npm run release patch -- --all 0.9.8 -> 0.9.9
|
|
127
127
|
npm run release prerelease beta -- --all v0.2.1 -> v0.2.2-beta.0
|
|
128
128
|
Placeholder for the next version (at the beginning of the line):
|
|
129
|
-
|
|
129
|
+
## **WORK IN PROGRESS**
|
|
130
130
|
-->
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
## Changelog
|
|
134
|
+
### 1.7.2 (2022-05-28)
|
|
135
|
+
* (arteck) download missing icons corr
|
|
136
|
+
|
|
134
137
|
### 1.7.1 (2022-05-28)
|
|
135
138
|
* (arteck) available status in admin is colored
|
|
136
139
|
* (arteck) disable Backups checkbox in settings
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "zigbee",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.2",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.7.2": {
|
|
7
|
+
"en": "corr download missing icon",
|
|
8
|
+
"de": "korrektur download fehlendes Icon",
|
|
9
|
+
"ru": "Корр скачать отсутствует значок",
|
|
10
|
+
"pt": "corr baixar ícone ausente",
|
|
11
|
+
"nl": "corr download ontbreekt icoon",
|
|
12
|
+
"fr": "corr télécharger l'icône manquante",
|
|
13
|
+
"it": "corr download icona mancante",
|
|
14
|
+
"es": "falta el icono de descarga corr",
|
|
15
|
+
"pl": "brak ikony pobierania corr",
|
|
16
|
+
"zh-cn": "更正下载丢失的图标"
|
|
17
|
+
},
|
|
6
18
|
"1.7.1": {
|
|
7
19
|
"en": "Device status is displayed in admin interface with color and icon.\nInternal adapter backups can be disabled (for backups with BackItUp Adapter).\nOnly last 10 backups are kept (currently they accumulate and need to be deleted manually).\nNew function for missing icons in Admin Object tree.",
|
|
8
20
|
"de": "Der Gerätestatus wird in der Admin-Oberfläche mit Farbe und Symbol angezeigt.\nInterne Adapter-Backups können deaktiviert werden (für Backups mit BackItUp Adapter).\nNur die letzten 10 Backups werden aufbewahrt (derzeit sammeln sie sich an und müssen manuell gelöscht werden).\nNeue Funktion für fehlende Symbole im Admin-Objektbaum.",
|
|
@@ -160,7 +172,7 @@
|
|
|
160
172
|
"condition": {
|
|
161
173
|
"operand": "and",
|
|
162
174
|
"rules": [
|
|
163
|
-
"oldVersion
|
|
175
|
+
"oldVersion<=1.6.18",
|
|
164
176
|
"newVersion>=1.7.0"
|
|
165
177
|
]
|
|
166
178
|
},
|
package/lib/statescontroller.js
CHANGED
|
@@ -492,11 +492,17 @@ class StatesController extends EventEmitter {
|
|
|
492
492
|
const modelDesc = statesMapping.findModel(model);
|
|
493
493
|
let icon = (modelDesc && modelDesc.icon) ? modelDesc.icon : 'img/unknown.png';
|
|
494
494
|
// clear icon if it external
|
|
495
|
-
const
|
|
495
|
+
const model_modif = model.replace('/','-');
|
|
496
|
+
const pathToIcon = this.adapter.adapterDir + '/admin/img/' + model_modif + '.png';
|
|
496
497
|
|
|
497
498
|
if (icon.startsWith('http')) {
|
|
498
|
-
this.
|
|
499
|
-
|
|
499
|
+
this.warn(`download icon from ${icon} saved into ${pathToIcon}`);
|
|
500
|
+
try {
|
|
501
|
+
this.downloadIcon(icon, pathToIcon);
|
|
502
|
+
icon = 'img/' + model_modif + '.png';
|
|
503
|
+
} catch (e) {
|
|
504
|
+
this.debug(`ERROR : icon not found from ${icon} saved into ${pathToIcon}`);
|
|
505
|
+
}
|
|
500
506
|
}
|
|
501
507
|
|
|
502
508
|
this.adapter.setObjectNotExists(id, {
|
|
@@ -511,28 +517,29 @@ class StatesController extends EventEmitter {
|
|
|
511
517
|
}
|
|
512
518
|
|
|
513
519
|
async downloadIcon(url, image_path) {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
}
|
|
520
|
+
if (!fs.existsSync(image_path)) {
|
|
521
|
+
return new Promise((resolve, reject) => {
|
|
522
|
+
request.head(url, function (err, res, body) {
|
|
523
|
+
if (err) {
|
|
524
|
+
return reject(err);
|
|
525
|
+
}
|
|
526
|
+
let stream = request(url);
|
|
527
|
+
stream.pipe(
|
|
528
|
+
fs.createWriteStream(image_path)
|
|
529
|
+
.on('error', err => {
|
|
530
|
+
reject(err);
|
|
531
|
+
})
|
|
532
|
+
)
|
|
533
|
+
.on('close', function () {
|
|
534
|
+
// here admin upload and then
|
|
535
|
+
resolve();
|
|
536
|
+
});
|
|
537
|
+
});
|
|
538
|
+
});
|
|
539
|
+
}
|
|
535
540
|
}
|
|
541
|
+
|
|
542
|
+
|
|
536
543
|
async syncDevStates(dev, model) {
|
|
537
544
|
const devId = dev.ieeeAddr.substr(2);
|
|
538
545
|
// devId - iobroker device id
|