iobroker.lovelace 4.1.13 → 4.1.15
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 +6 -9
- package/io-package.json +27 -27
- package/lib/server.js +21 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -473,6 +473,12 @@ After that checkout modified version in `./build` folder. Then.
|
|
|
473
473
|
PLACEHOLDER for the next version:
|
|
474
474
|
### **WORK IN PROGRESS**
|
|
475
475
|
-->
|
|
476
|
+
### 4.1.15 (2025-03-10)
|
|
477
|
+
* (Garfonso) repaired image loading, again.
|
|
478
|
+
|
|
479
|
+
### 4.1.14 (2025-03-10)
|
|
480
|
+
* (Garfonso) repaired image loading. Fixes #577
|
|
481
|
+
|
|
476
482
|
### 4.1.13 (2025-03-06)
|
|
477
483
|
* (Garfonso) reworked image sending. Now weather icons work for normal users, too. Also weather images are transfered from our server, so no access to admin is needed anymore.
|
|
478
484
|
|
|
@@ -483,15 +489,6 @@ After that checkout modified version in `./build` folder. Then.
|
|
|
483
489
|
* (Garfonso) device icons work again.
|
|
484
490
|
* (Garfonso) default user sometimes was not found in system.
|
|
485
491
|
|
|
486
|
-
### 4.1.9 (2024-04-26)
|
|
487
|
-
* (Garfonso) add support for new service call structure.
|
|
488
|
-
* (Garfonso) add support for delivering files from other adapters, for example, local cover images.
|
|
489
|
-
* (Garfonso) cleaned up service descriptions.
|
|
490
|
-
|
|
491
|
-
### 4.1.8 (2024-03-11)
|
|
492
|
-
* (Garfonso) prevent even more possible crashes
|
|
493
|
-
* (smarthomejoey) fixed: tilt level and inversion
|
|
494
|
-
|
|
495
492
|
## License
|
|
496
493
|
|
|
497
494
|
Copyright 2019-2025, bluefox <dogafox@gmail.com>
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lovelace",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.15",
|
|
5
5
|
"news": {
|
|
6
|
+
"4.1.15": {
|
|
7
|
+
"en": "repaired image loading, again.",
|
|
8
|
+
"de": "Bilder laden nochmal verändert. Jetzt geht hoffentlich alles.",
|
|
9
|
+
"ru": "восстановлена загрузка изображения, опять же.",
|
|
10
|
+
"pt": "carga de imagem reparada, novamente.",
|
|
11
|
+
"nl": "hersteld beeld laden, opnieuw.",
|
|
12
|
+
"fr": "réparation de chargement d'image, encore.",
|
|
13
|
+
"it": "caricamento immagine riparato, di nuovo.",
|
|
14
|
+
"es": "reparado carga de imagen, otra vez.",
|
|
15
|
+
"pl": "ponownie naprawiono ładowanie obrazu.",
|
|
16
|
+
"uk": "ремонтувати завантаження зображень, знову.",
|
|
17
|
+
"zh-cn": "再次修复图像加载 ."
|
|
18
|
+
},
|
|
19
|
+
"4.1.14": {
|
|
20
|
+
"en": "repaired image loading. Fixes #577",
|
|
21
|
+
"de": "Bilder laden repariert. Fixes #577",
|
|
22
|
+
"ru": "восстановленная загрузка изображения. Исправления #577",
|
|
23
|
+
"pt": "carga de imagem reparada. Correções #577",
|
|
24
|
+
"nl": "hersteld beeld laden. Fixes #577",
|
|
25
|
+
"fr": "chargement d'image réparé. Corrige #577",
|
|
26
|
+
"it": "caricamento dell'immagine riparato. Correzioni #577",
|
|
27
|
+
"es": "carga de imagen reparada. Arreglos #577",
|
|
28
|
+
"pl": "naprawiono ładowanie obrazu. Fixes # 577",
|
|
29
|
+
"uk": "відремонтовано завантаження зображень. Виправлення #577",
|
|
30
|
+
"zh-cn": "修复图像加载。 修复 #577"
|
|
31
|
+
},
|
|
6
32
|
"4.1.13": {
|
|
7
33
|
"en": "reworked image sending. Now weather icons work for normal users, too. Also weather images are transfered from our server, so no access to admin is needed anymore.",
|
|
8
34
|
"de": "reworked image send. Jetzt funktionieren auch Wettersymbole für normale Benutzer. Auch Wetterbilder werden von unserem Server übertragen, so dass kein Zugriff auf Admin mehr erforderlich ist.",
|
|
@@ -58,32 +84,6 @@
|
|
|
58
84
|
"4.1.8": {
|
|
59
85
|
"en": "prevent even more possible crashes\nfixed: tilt level and inversion",
|
|
60
86
|
"de": "noch mehr mögliche abstürzen verhindern\nfixed: tilt level und inversion"
|
|
61
|
-
},
|
|
62
|
-
"4.1.6": {
|
|
63
|
-
"en": "remove exessive logging\nimprove fix for crash again.",
|
|
64
|
-
"de": "exessive log ausgabe entfernen\nverbesserung der reparatur für crash.",
|
|
65
|
-
"ru": "удалить exessive logging\nулучшить исправление для аварии снова.",
|
|
66
|
-
"pt": "remover registro exessivo\nmelhorar a correção para acidente novamente.",
|
|
67
|
-
"nl": "exessieve logging verwijderen\nverbeteren fix voor crash opnieuw.",
|
|
68
|
-
"fr": "supprimer l'exploitation exessive\naméliorer la correction pour le crash à nouveau.",
|
|
69
|
-
"it": "rimuovere logging exessive\nmigliorare la correzione per crash di nuovo.",
|
|
70
|
-
"es": "remove exessive logging\nmejorar la solución para el accidente de nuevo.",
|
|
71
|
-
"pl": "usunięcie nadmiernego logowania\npoprawić naprawić ponownie awarii.",
|
|
72
|
-
"uk": "видалити есенціальний журнал\nзнову поліпшуйте фіксацію.",
|
|
73
|
-
"zh-cn": "删除 exessive 日志\n改善再次崩溃的修复."
|
|
74
|
-
},
|
|
75
|
-
"4.1.5": {
|
|
76
|
-
"en": "fixed: possible crashes during startup",
|
|
77
|
-
"de": "behoben: mögliche abstürzen beim start",
|
|
78
|
-
"ru": "фиксированный: возможные аварии во время запуска",
|
|
79
|
-
"pt": "corrigido: possíveis falhas durante a inicialização",
|
|
80
|
-
"nl": "vast: mogelijke crashes tijdens opstarten",
|
|
81
|
-
"fr": "corrigé: crashs possibles pendant le démarrage",
|
|
82
|
-
"it": "fisso: possibili crash durante l'avvio",
|
|
83
|
-
"es": "fijo: posibles fallos durante la puesta en marcha",
|
|
84
|
-
"pl": "stałe: możliwe awarie podczas uruchamiania",
|
|
85
|
-
"uk": "виправлено: можливі аварії під час запуску",
|
|
86
|
-
"zh-cn": "固定: 启动时可能发生的崩溃"
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
"titleLang": {
|
package/lib/server.js
CHANGED
|
@@ -2487,16 +2487,24 @@ class WebServer {
|
|
|
2487
2487
|
* @returns {Promise<void>} resolves when done.
|
|
2488
2488
|
*/
|
|
2489
2489
|
async _replyWithImage(req, res) {
|
|
2490
|
-
this.log.debug(
|
|
2490
|
+
this.log.debug(
|
|
2491
|
+
`Get image for ${req.url} and entity ${req.params?.entity_id} with token=${req.query?.token} and signed=${req.query?.signed}`,
|
|
2492
|
+
);
|
|
2491
2493
|
try {
|
|
2492
2494
|
const data = await this._getImage(
|
|
2493
2495
|
req.params?.entity_id,
|
|
2494
2496
|
req.query?.token || 'empty',
|
|
2495
|
-
req.query?.signed
|
|
2497
|
+
req.params?.entity_id ? req.query?.signed : req.query?.token,
|
|
2496
2498
|
req.url,
|
|
2499
|
+
req._user,
|
|
2497
2500
|
);
|
|
2498
2501
|
res.setHeader('content-type', data.content_type);
|
|
2499
|
-
|
|
2502
|
+
console.log(`Send image ${data.content_type} - ${data.content.length}`);
|
|
2503
|
+
let content = data.content;
|
|
2504
|
+
if (!data.content_type.includes('svg')) {
|
|
2505
|
+
content = Buffer.from(data.content, 'base64');
|
|
2506
|
+
}
|
|
2507
|
+
res.send(content);
|
|
2500
2508
|
} catch (err) {
|
|
2501
2509
|
this.log.warn(`Error in _getImage: ${err} - ${err.stack}`);
|
|
2502
2510
|
res.status(404).json({ error: err });
|
|
@@ -2512,11 +2520,16 @@ class WebServer {
|
|
|
2512
2520
|
* @param url optional url to the image, if no entity is used.
|
|
2513
2521
|
* @returns {Promise<{content_type: (*|string), content: string}>} image as base64 string
|
|
2514
2522
|
*/
|
|
2515
|
-
async _getImage(entity_id, token, access_token, url) {
|
|
2523
|
+
async _getImage(entity_id, token, access_token, url, reqUser) {
|
|
2516
2524
|
const entity = entityData.entityId2Entity[entity_id];
|
|
2517
2525
|
let id;
|
|
2518
2526
|
let userName; // will be ignored in case of no authentication enabled.
|
|
2519
|
-
if (
|
|
2527
|
+
if (
|
|
2528
|
+
this.config.auth !== false &&
|
|
2529
|
+
(token || access_token) &&
|
|
2530
|
+
!this._requestableFiles.includes(url) &&
|
|
2531
|
+
!entityData.entityIconUrls.includes(url)
|
|
2532
|
+
) {
|
|
2520
2533
|
if (access_token) {
|
|
2521
2534
|
const now = Date.now();
|
|
2522
2535
|
const flowId = Object.keys(this._auth_flows).find(
|
|
@@ -2533,6 +2546,8 @@ class WebServer {
|
|
|
2533
2546
|
} else if (token && entity?.attributes.access_token !== token) {
|
|
2534
2547
|
this.log.warn(`Invalid access token for ${entity_id} - ${token}`);
|
|
2535
2548
|
throw new Error(`Invalid access token for ${entity_id} - ${token}`);
|
|
2549
|
+
} else {
|
|
2550
|
+
userName = reqUser;
|
|
2536
2551
|
}
|
|
2537
2552
|
}
|
|
2538
2553
|
|
|
@@ -2607,7 +2622,7 @@ class WebServer {
|
|
|
2607
2622
|
throw new Error('File empty or not found');
|
|
2608
2623
|
} else {
|
|
2609
2624
|
image.mimeType =
|
|
2610
|
-
image.mimeType || (mime.getType || mime.lookup).call(image.mimeType, url) || '
|
|
2625
|
+
image.mimeType || (mime.getType || mime.lookup).call(image.mimeType, url) || 'image/jpeg';
|
|
2611
2626
|
result = { content_type: image.mimeType, content: image.file.toString('base64') };
|
|
2612
2627
|
return result;
|
|
2613
2628
|
}
|