iobroker.lovelace 4.0.1 → 4.0.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
@@ -471,6 +471,12 @@ After that checkout modified version in `./build` folder. Then.
471
471
  PLACEHOLDER for next version:
472
472
  ### **WORK IN PROGRESS**
473
473
  -->
474
+ ### 4.0.3 (2023-12-09)
475
+ * (Garfonso) fix: tests.
476
+
477
+ ### 4.0.2 (2023-12-09)
478
+ * (Garfonso) fix: crash
479
+
474
480
  ### 4.0.1 (2023-12-08)
475
481
  * (Garfonso) fix: hideHeader object is writable
476
482
 
@@ -490,33 +496,6 @@ After that checkout modified version in `./build` folder. Then.
490
496
  * (Garfonso) notifications working again.
491
497
  * (Garfonso) repaired color temperature handling.
492
498
 
493
- ### 3.0.0 (2022-10-28)
494
- * (agross) added: per instance language support
495
- * (Garfonso) entity_id for devices with only one non english name should be ok again.
496
- * (Garfonso) changed: updated frontend to 20221027.0. Needs theme adjustment (add code-editor-background-color) and probably card updates
497
- * (Garfonso) added: browser_mod (2.1.3) is now integrated. Please remove manual installed versions of custom browser_mod card.
498
- * (Garfonso) added: 'instances.refresh' can be used to reload page in connected browsers.
499
- * (Garfonso) removed: lovelace_reload and window_reload states
500
- * (Garfonso) removed: name state, not supported by browser_mod anymore
501
- * (Garfonso) added: Support for toasts with action button (either json or ;-string)
502
- * (Garfonso) added: activity state will show if user is currently using a certain browser
503
- * (Garfonso) added: Support for subfolders in /cards/ for images and stuff custom cards load (please keep cards in root folder).
504
- * (Garfonso) crash if notification was malformed json.
505
- * (Garfonso) some translation stuff
506
- * (Garfonso) crash case when states were updated before websocket was ready
507
- * (Apollon77) Prepare for future js-controller versions
508
- * (bluefox) tried to make html requests relative
509
-
510
- ### 2.2.0 (2022-06-05)
511
- * (Garfonso) fixed: incorrect warning about duplicate entities on update of manual entity.
512
- * (Garfonso) fixed: input_datetime did not work if time was enabled and did vanish if date and time were enabled.
513
- * (Garfonso) fixed: RGB hex string got broken on not rounded numbers (problem with mushroom ligth card).
514
- * (Garfonso) fixed: state of cover entity if not 0 or 100% (fixes problem with sliter-button-card).
515
- * (Garfonso) fixed: light did not read brightness ACTUAL in dimmer devices.
516
- * (Garfonso) added: support auto entities card and subscription.
517
- * (Garfonso) added: improve support for input_datetime & string states.
518
- * (Garfonso) added: support for browser_mod (i.e. crontrol frontend from iobroker).
519
-
520
499
  ## License
521
500
 
522
501
  Copyright 2019-2023, 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.0.1",
4
+ "version": "4.0.3",
5
5
  "news": {
6
+ "4.0.3": {
7
+ "en": "fix: tests.",
8
+ "de": "fix: tests.",
9
+ "ru": "исправить: тесты.",
10
+ "pt": "correção: testes.",
11
+ "nl": "testen.",
12
+ "fr": "correction: essais.",
13
+ "it": "correzione: test.",
14
+ "es": "reparación: pruebas.",
15
+ "pl": "uwaga: testy.",
16
+ "uk": "виправити: тести.",
17
+ "zh-cn": "fix:试验。."
18
+ },
19
+ "4.0.2": {
20
+ "en": "fix: crash",
21
+ "de": "fix: absturz",
22
+ "ru": "исправить: аварии",
23
+ "pt": "correção: acidente",
24
+ "nl": "vertaling:",
25
+ "fr": "correction :",
26
+ "it": "correzione: crash",
27
+ "es": "arranca:",
28
+ "pl": "naprawa",
29
+ "uk": "виправити: аварійний",
30
+ "zh-cn": "fix:坠落"
31
+ },
6
32
  "4.0.1": {
7
33
  "en": "fix: hideHeader object is writable",
8
34
  "de": "fix: hideHeader-Objekt ist schreibbar"
@@ -58,32 +84,6 @@
58
84
  "pl": "naprawiono: nieprawidłowe ostrzeżenie o zduplikowanych encjach przy aktualizacji encji ręcznej.\nnaprawiono: input_datetime nie działał, jeśli czas był włączony i znikał, jeśli data i godzina były włączone.\nnaprawiono: ciąg szesnastkowy RGB pękał na niezaokrąglonych liczbach (problem z kartą grzybkową).\nnaprawiono: stan jednostki okładki, jeśli nie 0 lub 100% (rozwiązuje problem z kartą z przyciskami sliterowymi).\nnaprawiono: światło nie odczytywało jasności AKTUALNEJ w urządzeniach ze ściemniaczem.\ndodano: obsługa karty i subskrypcji podmiotów automatycznych.\ndodano: poprawiono obsługę input_datetime i stanów stringów.\ndodano: wsparcie dla browser_mod (czyli crontrol frontend z iobroker).",
59
85
  "zh-cn": "修复:手动实体更新时有关重复实体的错误警告。\n已修复:如果启用了时间,则 input_datetime 不起作用,如果启用了日期和时间,则会消失。\n修复:RGB 十六进制字符串在非四舍五入的数字上被破坏(蘑菇灯卡问题)。\n已修复:如果不是 0 或 100%,则覆盖实体的状态(修复了 sliter-button-card 的问题)。\n已修复:调光器设备中的灯光未读取实际亮度。\n补充:支持自动实体卡和订阅。\n添加:改进对 input_datetime 和字符串状态的支持。\n添加:对 browser_mod 的支持(即来自 iobroker 的 crontrol 前端)。",
60
86
  "uk": "виправлено: некоректне попередження про дублікати сутностей під час оновлення ручної сутності.\nвиправлено: input_datetime не працював, якщо час було ввімкнено, і зникав, якщо дата й час були ввімкнені.\nвиправлено: шістнадцятковий рядок RGB порушувався на незаокруглених числах (проблема з грибоподібною карткою).\nвиправлено: стан об’єкта покриття, якщо не 0 або 100% (вирішено проблему з картою кнопки-розрізу).\nвиправлено: світло не зчитує АКТУАЛЬНУ яскравість у димерах.\nдодано: підтримка автоматичної картки та підписки.\nдодано: покращено підтримку станів input_datetime та рядків.\nдодано: підтримка browser_mod (тобто інтерфейс crontrol від iobroker)."
61
- },
62
- "2.1.4": {
63
- "en": "Dependency update",
64
- "de": "Abhängigkeits-Update",
65
- "ru": "Обновление зависимости",
66
- "pt": "Atualização de dependência",
67
- "nl": "Afhankelijkheidsupdate",
68
- "fr": "Mise à jour des dépendances",
69
- "it": "Aggiornamento delle dipendenze",
70
- "es": "Actualización de dependencia",
71
- "pl": "Aktualizacja zależności",
72
- "zh-cn": "依赖更新",
73
- "uk": "Оновлення залежності"
74
- },
75
- "2.1.3": {
76
- "en": "Fixed: remove backup of old frontend (sorry)",
77
- "de": "Behoben: Backup des alten Frontends entfernen (sorry)",
78
- "ru": "Исправлено: удалить резервную копию старого интерфейса (извините)",
79
- "pt": "Corrigido: remover backup de front-end antigo (desculpe)",
80
- "nl": "Opgelost: verwijder back-up van oude frontend (sorry)",
81
- "fr": "Corrigé : supprimer la sauvegarde de l'ancienne interface (désolé)",
82
- "it": "Risolto: rimuovere il backup del vecchio frontend (scusate)",
83
- "es": "Corregido: eliminar la copia de seguridad de la interfaz anterior (lo siento)",
84
- "pl": "Naprawiono: usuń kopię zapasową starego frontendu (przepraszam)",
85
- "zh-cn": "修正:删除旧前端的备份(抱歉)",
86
- "uk": "Виправлено: видалення резервної копії старого інтерфейсу (вибачте)"
87
87
  }
88
88
  },
89
89
  "title": "Visualization with Lovelace-UI",
@@ -250,11 +250,13 @@ class BrowserModModule {
250
250
  } else {
251
251
  //read hideHeader setting from object:
252
252
  const hideHeader = await this.adapter.getStateAsync(ioBrokerDeviceId + '.hideHeader');
253
- if (browserId) {
254
- this.initialiseBrowserSettings(browserId);
255
- this.browserModStorage.browsers[browserId].settings.hideHeader = hideHeader.val;
256
- } else {
257
- this.browserModStorage.settings.hideHeader = hideHeader.val;
253
+ if (hideHeader) {
254
+ if (browserId) {
255
+ this.initialiseBrowserSettings(browserId);
256
+ this.browserModStorage.browsers[browserId].settings.hideHeader = hideHeader.val;
257
+ } else {
258
+ this.browserModStorage.settings.hideHeader = hideHeader.val;
259
+ }
258
260
  }
259
261
  }
260
262
  }
@@ -566,13 +568,15 @@ class BrowserModModule {
566
568
  await this.adapter.setState(id, false, true);
567
569
  } else if (id.endsWith('hideHeader')) {
568
570
  const hideHeader = await this.adapter.getStateAsync(id);
569
- if (id === this.adapter.namespace + '.' + instancesPath + 'hideHeader') {
570
- this.browserModStorage.settings.hideHeader = hideHeader.val;
571
- } else {
572
- //read hideHeader states from ioBroker objects.
573
- const browserId = id.split('.')[3];
574
- this.initialiseBrowserSettings(browserId);
575
- this.browserModStorage.browsers[id.split('.')[3]].settings.hideHeader = hideHeader.val;
571
+ if (hideHeader) {
572
+ if (id === this.adapter.namespace + '.' + instancesPath + 'hideHeader') {
573
+ this.browserModStorage.settings.hideHeader = hideHeader.val;
574
+ } else {
575
+ //read hideHeader states from ioBroker objects.
576
+ const browserId = id.split('.')[3];
577
+ this.initialiseBrowserSettings(browserId);
578
+ this.browserModStorage.browsers[id.split('.')[3]].settings.hideHeader = hideHeader.val;
579
+ }
576
580
  }
577
581
  }
578
582
  }
package/lib/server.js CHANGED
@@ -920,6 +920,27 @@ class WebServer {
920
920
  entityHome.attributes.longitude = parseFloat(this.systemConfig.longitude);
921
921
  entityHome.last_changed = this.systemConfig.ts;
922
922
  entityHome.last_updated = this.systemConfig.ts;
923
+
924
+ //shoppindlist:
925
+ let entityShoppingList = entityData.entityId2Entity['todo.shoppinglist'];
926
+ if (!entityShoppingList) {
927
+ entityShoppingList = {
928
+ 'entity_id': 'todo.shoppinglist',
929
+ 'state': 'unknown',
930
+ 'attributes': {
931
+ 'hidden': true,
932
+ 'friendly_name': 'Shopping List',
933
+ 'icon': 'mdi:cart'
934
+ },
935
+ 'context': {
936
+ 'id': 'system.config', //not sure this makes a lot of sense. But prevents crash in UI.
937
+ 'STATE': {}, //prevent warning on getting history.
938
+ 'type': 'shopping_list'
939
+ }
940
+ };
941
+ entityData.entities.push(entityShoppingList);
942
+ entityData.entityId2Entity[entityShoppingList.entity_id] = entityShoppingList;
943
+ }
923
944
  }
924
945
 
925
946
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lovelace",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI",
5
5
  "author": {
6
6
  "name": "bluefox",