From da85ee5d01d498fd2a168b720883ae8ca8245d11 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 5 May 2021 01:39:25 +0000 Subject: [PATCH 001/117] Translation update --- translations/frontend/bg.json | 2 +- translations/frontend/it.json | 9 +++++++++ translations/frontend/nb.json | 1 + translations/frontend/nl.json | 4 ++++ translations/frontend/zh-Hans.json | 1 + translations/frontend/zh-Hant.json | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/translations/frontend/bg.json b/translations/frontend/bg.json index abb6379f7a..9ab72d6059 100644 --- a/translations/frontend/bg.json +++ b/translations/frontend/bg.json @@ -2069,7 +2069,7 @@ "show": "Покажи", "show_disabled": "Показване на деактивираните интеграции" }, - "discovered": "Открит", + "discovered": "Открита", "home_assistant_website": "Уебсайт на Home Assistant", "ignore": { "confirm_ignore": "Наистина ли не искате да настроите тази интеграция? Можете да отмените това, като кликнете върху „Показване на игнорирани интеграции“ в менюто горе вдясно." diff --git a/translations/frontend/it.json b/translations/frontend/it.json index 58a2214037..9c989d2a90 100644 --- a/translations/frontend/it.json +++ b/translations/frontend/it.json @@ -1746,10 +1746,16 @@ "remote": { "access_is_being_prepared": "È in fase di preparazione l'accesso remoto. Ti avviseremo quando sarà pronto.", "certificate_info": "Informazioni sul certificato", + "connected": "Connesso", "info": "Home Assistant Cloud fornisce una connessione remota sicura alla tua istanza mentre sei fuori casa.", "instance_is_available": "La tua istanza è disponibile su", "instance_will_be_available": "La tua istanza sarà disponibile su", "link_learn_how_it_works": "Scopri come funziona", + "not_connected": "Non Connesso", + "remote_enabled": { + "caption": "Collegati automaticamente", + "description": "Abilita questa opzione per assicurarti che la tua istanza di Home Assistant sia sempre accessibile da remoto." + }, "title": "Telecomando" }, "sign_out": "Esci", @@ -2160,6 +2166,7 @@ "license": "Pubblicato sotto la licenza Apache 2.0", "path_configuration": "Percorso del file configuration.yaml: {path}", "server": "server", + "setup_time": "Tempo di preparazione", "source": "Sorgenti:", "system_health_error": "Il componente System Health non è caricato. Aggiungere 'system_health:' a configuration.yaml", "system_health": { @@ -2239,6 +2246,7 @@ }, "finish": "Finito", "loading_first_time": "Si prega di attendere durante l'installazione dell'integrazione", + "next": "Prossimo", "not_all_required_fields": "Non tutti i campi obbligatori sono compilati.", "not_loaded": "L'integrazione non può essere caricata, prova a riavviare Home Assistant.", "pick_flow_step": { @@ -2944,6 +2952,7 @@ }, "logs": { "log_level": "Livello di registro", + "subscribed_to_logs": "Sottoscrizione al registro dei messaggi di Z-Wave JS ...", "title": "Registri Z-Wave JS" }, "navigation": { diff --git a/translations/frontend/nb.json b/translations/frontend/nb.json index d915fffaba..f906d99bfc 100644 --- a/translations/frontend/nb.json +++ b/translations/frontend/nb.json @@ -2246,6 +2246,7 @@ }, "finish": "Fullfør", "loading_first_time": "Vennligst vent mens integrasjonen installeres", + "next": "Neste", "not_all_required_fields": "Ikke alle obligatoriske felt er fylt ut.", "not_loaded": "Integrasjonen kunne ikke lastes, prøv å starte Home Assistant på nytt.", "pick_flow_step": { diff --git a/translations/frontend/nl.json b/translations/frontend/nl.json index 42aa767972..008084c6a1 100644 --- a/translations/frontend/nl.json +++ b/translations/frontend/nl.json @@ -2983,6 +2983,10 @@ "dead": "Onbereikbaar", "unknown": "Onbekend" }, + "reinterview_node": { + "interview_complete": "Apparaat interview voltooid.", + "interview_failed": "Het apparaat interview is mislukt. Aanvullende informatie is mogelijk beschikbaar in de logboeken." + }, "remove_node": { "cancel_exclusion": "Uitsluiting annuleren", "controller_in_exclusion_mode": "Uw Z-Wave controller bevindt zich nu in de uitsluitingsmodus.", diff --git a/translations/frontend/zh-Hans.json b/translations/frontend/zh-Hans.json index f7ab7ec2fb..725df39ce1 100644 --- a/translations/frontend/zh-Hans.json +++ b/translations/frontend/zh-Hans.json @@ -2246,6 +2246,7 @@ }, "finish": "完成", "loading_first_time": "正在安装集成,请稍候", + "next": "下一步", "not_all_required_fields": "请填写所有必填字段", "not_loaded": "集成未能加载,请尝试重启 Home Assistant。", "pick_flow_step": { diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index d916ccf291..5785148cb3 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -2246,6 +2246,7 @@ }, "finish": "完成", "loading_first_time": "請稍候、正在安裝整合", + "next": "下一步", "not_all_required_fields": "所有所需欄位都需要填寫。", "not_loaded": "整合無法載入,請重啟 Home Assistant。", "pick_flow_step": { From 23c1c2f5ebe11874d017b54e8a43a7dd7c3a06bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 5 May 2021 08:19:58 +0200 Subject: [PATCH 002/117] Bump wheels to 3.8-alpine3.12 (#9098) --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8653bc9644..c753ac8479 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,8 +6,8 @@ on: - published env: - WHEELS_TAG: 3.7-alpine3.11 - PYTHON_VERSION: 3.7 + WHEELS_TAG: 3.8-alpine3.12 + PYTHON_VERSION: 3.8 NODE_VERSION: 12.1 jobs: From 6e5e2625d6b1b60ed326a7e5b2e9707fa4785359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 5 May 2021 10:26:11 +0200 Subject: [PATCH 003/117] Show supervisor addon configuration error (#8950) Co-authored-by: Bram Kragten --- .../src/addon-view/config/hassio-addon-config.ts | 15 ++++++++------- hassio/src/addon-view/hassio-addon-dashboard.ts | 4 ++++ src/data/hassio/addon.ts | 16 ++++++++++++---- src/data/hassio/common.ts | 3 ++- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/hassio/src/addon-view/config/hassio-addon-config.ts b/hassio/src/addon-view/config/hassio-addon-config.ts index 56ebbfa5f5..9bbc6ac782 100644 --- a/hassio/src/addon-view/config/hassio-addon-config.ts +++ b/hassio/src/addon-view/config/hassio-addon-config.ts @@ -262,6 +262,11 @@ class HassioAddonConfig extends LitElement { private async _saveTapped(ev: CustomEvent): Promise { const button = ev.currentTarget as any; + const eventdata = { + success: true, + response: undefined, + path: "options", + }; button.progress = true; this._error = undefined; @@ -272,23 +277,19 @@ class HassioAddonConfig extends LitElement { }); this._configHasChanged = false; - const eventdata = { - success: true, - response: undefined, - path: "options", - }; - fireEvent(this, "hass-api-called", eventdata); if (this.addon?.state === "started") { await suggestAddonRestart(this, this.hass, this.supervisor, this.addon); } } catch (err) { this._error = this.supervisor.localize( - "addon.configuration.options.failed_to_save", + "addon.failed_to_save", "error", extractApiErrorMessage(err) ); + eventdata.success = false; } button.progress = false; + fireEvent(this, "hass-api-called", eventdata); } static get styles(): CSSResult[] { diff --git a/hassio/src/addon-view/hassio-addon-dashboard.ts b/hassio/src/addon-view/hassio-addon-dashboard.ts index 6287c7907d..5113aa3bdb 100644 --- a/hassio/src/addon-view/hassio-addon-dashboard.ts +++ b/hassio/src/addon-view/hassio-addon-dashboard.ts @@ -191,6 +191,10 @@ class HassioAddonDashboard extends LitElement { } private async _apiCalled(ev): Promise { + if (!ev.detail.success) { + return; + } + const pathSplit: string[] = ev.detail.path?.split("/"); if (!pathSplit || pathSplit.length === 0) { diff --git a/src/data/hassio/addon.ts b/src/data/hassio/addon.ts index e403d28ba7..902bd88816 100644 --- a/src/data/hassio/addon.ts +++ b/src/data/hassio/addon.ts @@ -2,7 +2,11 @@ import { atLeastVersion } from "../../common/config/version"; import { HaFormSchema } from "../../components/ha-form/ha-form"; import { HomeAssistant } from "../../types"; import { SupervisorArch } from "../supervisor/supervisor"; -import { hassioApiResultExtractor, HassioResponse } from "./common"; +import { + extractApiErrorMessage, + hassioApiResultExtractor, + HassioResponse, +} from "./common"; export type AddonStage = "stable" | "experimental" | "deprecated"; export type AddonAppArmour = "disable" | "default" | "profile"; @@ -186,16 +190,20 @@ export const setHassioAddonOption = async ( data: HassioAddonSetOptionParams ) => { if (atLeastVersion(hass.config.version, 2021, 2, 4)) { - await hass.callWS({ + const response = await hass.callWS>({ type: "supervisor/api", endpoint: `/addons/${slug}/options`, method: "post", data, }); - return; + + if (response.result === "error") { + throw Error(extractApiErrorMessage(response)); + } + return response; } - await hass.callApi>( + return hass.callApi>( "POST", `hassio/addons/${slug}/options`, data diff --git a/src/data/hassio/common.ts b/src/data/hassio/common.ts index b6f7decb25..6c1c254a1c 100644 --- a/src/data/hassio/common.ts +++ b/src/data/hassio/common.ts @@ -3,7 +3,8 @@ import { HomeAssistant } from "../../types"; export interface HassioResponse { data: T; - result: "ok"; + message?: string; + result: "ok" | "error"; } export interface HassioStats { From 2af211b543831c1fc9e1643a6d272b7e73cf42c9 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 5 May 2021 10:32:24 +0200 Subject: [PATCH 004/117] Guard for undefined values in attribute filtering (#9089) --- src/panels/developer-tools/state/developer-tools-state.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/developer-tools/state/developer-tools-state.js b/src/panels/developer-tools/state/developer-tools-state.js index 64f85edfae..7bedfd8a42 100644 --- a/src/panels/developer-tools/state/developer-tools-state.js +++ b/src/panels/developer-tools/state/developer-tools-state.js @@ -410,7 +410,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { const attributeValue = value.attributes[key]; if ( - attributeValue !== null && + attributeValue !== undefined && JSON.stringify(attributeValue).toLowerCase().includes(valueFilter) ) { return true; From 72695631cddea5e805a22960b09fa3eec39c8860 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 6 May 2021 01:39:12 +0000 Subject: [PATCH 005/117] Translation update --- translations/frontend/bg.json | 26 ++++++++++++++++++++------ translations/frontend/et.json | 2 +- translations/frontend/fr.json | 9 ++++++++- translations/frontend/it.json | 2 +- translations/frontend/pl.json | 12 ++++++------ 5 files changed, 36 insertions(+), 15 deletions(-) diff --git a/translations/frontend/bg.json b/translations/frontend/bg.json index 9ab72d6059..ff7aec3c07 100644 --- a/translations/frontend/bg.json +++ b/translations/frontend/bg.json @@ -887,7 +887,7 @@ "enabled_description": "Изключените обекти няма да бъдат добавени в Home Assistant.", "enabled_label": "Активирай обекта", "enabled_restart_confirm": "Рестартирайте Home Assistant, за да завършите активирането на обектите", - "entity_id": "ID на обект", + "entity_id": "ID на обекта", "icon": "Икона", "icon_error": "Иконите трябва да са във формат „prefix: iconname“, напр. mdi:home", "name": "Име", @@ -1080,8 +1080,8 @@ "add": "Добавете устройства чрез това устройство", "clusters": "Управление на клъстери", "device_children": "Преглед на дъщерни", - "reconfigure": "Преконфигуриране на устройство", - "remove": "Премахване на устройство", + "reconfigure": "Преконфигуриране на устройството", + "remove": "Премахване на устройството", "zigbee_information": "Подпис на Zigbee устройството" }, "confirmations": { @@ -1116,6 +1116,7 @@ "in_progress": "Устройството се преконфигурира. Това може да отнеме известно време.", "min_max_change": "мин/макс/промяна", "reporting_header": "Отчитане", + "run_in_background": "Можете да затворите този диалогов прозорец и преконфигурирането ще продължи във фонов режим.", "start_reconfiguration": "Стартиране на преконфигуриране" } }, @@ -1611,7 +1612,7 @@ }, "integrations": "Интеграции", "integrations_introduction": "Интеграциите за Home Assistant Cloud ви позволяват свързването с услуги в облака, без да се налага да излагате публично своя Home Assistant в интернет.", - "integrations_introduction2": "Проверете уебсайта за", + "integrations_introduction2": "Проверете уебсайта за ", "integrations_link_all_features": "всички налични функции", "manage_account": "Управление на акаунта", "nabu_casa_account": "Акаунт в Nabu Casa", @@ -1619,10 +1620,15 @@ "remote": { "access_is_being_prepared": "Подготвя се отдалечен достъп. Ще ви уведомим, когато е готов.", "certificate_info": "Информация за сертификата", + "connected": "Свързан", "info": "Home Assistant Cloud осигурява сигурна отдалечена връзка с вашата инсталация, докато сте извън дома.", "instance_is_available": "Вашата инсталация е налична на", "instance_will_be_available": "Вашата инсталация ще е налична на", "link_learn_how_it_works": "Научете как работи", + "not_connected": "Не е свързан", + "remote_enabled": { + "caption": "Автоматично свързване" + }, "title": "Дистанционен контрол" }, "sign_out": "Отписване", @@ -1820,6 +1826,7 @@ } }, "devices": { + "add_prompt": "Все още не са добавени {name} с това устройство. Можете да добавите, като кликнете върху бутона + по-горе.", "automation": { "actions": { "caption": "Когато нещо се задейства...", @@ -2056,6 +2063,7 @@ "open_site": "Отваряне на уеб сайт" }, "loading_first_time": "Моля, изчакайте, докато се инсталира интеграцията", + "next": "Следващ", "not_all_required_fields": "Не всички задължителни полета са попълнени.", "not_loaded": "Интеграцията не можа да бъде заредена, опитайте да рестартирате Home Assistant." }, @@ -2070,9 +2078,15 @@ "show_disabled": "Показване на деактивираните интеграции" }, "discovered": "Открита", - "home_assistant_website": "Уебсайт на Home Assistant", + "home_assistant_website": "уебсайта на Home Assistant", "ignore": { - "confirm_ignore": "Наистина ли не искате да настроите тази интеграция? Можете да отмените това, като кликнете върху „Показване на игнорирани интеграции“ в менюто горе вдясно." + "confirm_delete_ignore_title": "Да се спре ли игнорирането на {name}?", + "confirm_ignore": "Наистина ли не искате да настроите тази интеграция? Можете да отмените това, като кликнете върху „Показване на игнорирани интеграции“ в менюто горе вдясно.", + "hide_ignored": "Скриване на игнорираните интеграции", + "ignore": "Игнорирайте", + "ignored": "Игнорирана", + "show_ignored": "Показване на игнорираните интеграции", + "stop_ignore": "Спрете да игнорирате" }, "integration": "интеграция", "integration_not_found": "Не е намерена интеграция.", diff --git a/translations/frontend/et.json b/translations/frontend/et.json index f7542f1c1f..7692516d72 100644 --- a/translations/frontend/et.json +++ b/translations/frontend/et.json @@ -2166,7 +2166,7 @@ "license": "Avaldatud Apache 2.0 litsentsi alusel", "path_configuration": "configuration.yaml asukoht: {path}", "server": "server", - "setup_time": "Kellaaja suvandid", + "setup_time": "Käivitusaeg", "source": "Allikas:", "system_health_error": "Süsteemi seisundi komponenti ei laadita. Lisage \"system_health:\" configuration.yaml", "system_health": { diff --git a/translations/frontend/fr.json b/translations/frontend/fr.json index 74a105406a..869189cb50 100644 --- a/translations/frontend/fr.json +++ b/translations/frontend/fr.json @@ -1263,7 +1263,7 @@ "started": "Home Assistant a démarré !", "starting": "Home Assistant est en cours de démarrage, tout ne sera pas disponible tant qu’il n’aura pas terminé.", "triggered": "{name} déclenché", - "wrapping_up_startup": "En terminant le démarrage, tout ne sera pas disponible tant qu'il ne sera pas terminé." + "wrapping_up_startup": "Finalisation du démarrage, tout ne sera pas disponible tant qu'il ne sera pas terminé." }, "panel": { "config": { @@ -1746,10 +1746,16 @@ "remote": { "access_is_being_prepared": "L'accès à distance est en préparation. Nous vous informerons quand ce sera prêt.", "certificate_info": "Informations sur le certificat", + "connected": "Connecté", "info": "Home Assistant Cloud fournit une connexion à distance sécurisée à votre instance lorsque vous n'êtes pas chez vous.", "instance_is_available": "Votre instance est disponible à l'adresse", "instance_will_be_available": "Votre instance sera disponible sur", "link_learn_how_it_works": "Apprenez comment ça marche", + "not_connected": "Non connecté", + "remote_enabled": { + "caption": "Se connecter automatiquement", + "description": "Activez cette option pour vous assurer que votre instance de Home Assistant est toujours accessible à distance." + }, "title": "Contrôle à distance" }, "sign_out": "Déconnexion", @@ -2240,6 +2246,7 @@ }, "finish": "Terminer", "loading_first_time": "Veuillez patienter pendant que l'intégration est en cours d'installation", + "next": "Suivant", "not_all_required_fields": "Tous les champs obligatoires ne sont pas renseignés.", "not_loaded": "Cette intégration ne peut être chargée, essayez de redémarrer Home Assistant", "pick_flow_step": { diff --git a/translations/frontend/it.json b/translations/frontend/it.json index 9c989d2a90..6d53d8b968 100644 --- a/translations/frontend/it.json +++ b/translations/frontend/it.json @@ -1744,7 +1744,7 @@ "nabu_casa_account": "Account Nabu Casa", "not_connected": "Non Connesso", "remote": { - "access_is_being_prepared": "È in fase di preparazione l'accesso remoto. Ti avviseremo quando sarà pronto.", + "access_is_being_prepared": "Il controllo remoto è in fase di preparazione. Ti avviseremo quando sarà pronto.", "certificate_info": "Informazioni sul certificato", "connected": "Connesso", "info": "Home Assistant Cloud fornisce una connessione remota sicura alla tua istanza mentre sei fuori casa.", diff --git a/translations/frontend/pl.json b/translations/frontend/pl.json index a365c7e119..73772a82f7 100644 --- a/translations/frontend/pl.json +++ b/translations/frontend/pl.json @@ -287,7 +287,7 @@ "reset_defaults": "Przywróć domyślne", "reset_options": "Resetuj opcje", "restart": "Uruchom ponownie", - "restart_name": "Uruchom ponownie {name}", + "restart_name": "Uruchom ponownie", "running_version": "Aktualnie używasz wersji {version}", "save": "Zapisz", "show_more": "Pokaż więcej informacji na ten temat", @@ -303,7 +303,7 @@ }, "restart": { "text": "Czy na pewno chcesz ponownie uruchomić {name}?", - "title": "Uruchom ponownie {name}" + "title": "Uruchom ponownie" }, "update": { "text": "Czy na pewno chcesz zaktualizować {name} do wersji {version}?", @@ -434,8 +434,8 @@ "ip_address": "Adres IP", "new_hostname": "Wprowadź nową nazwę hosta:", "operating_system": "System operacyjny", - "reboot_host": "Uruchom ponownie hosta", - "shutdown_host": "Zamknij hosta", + "reboot_host": "Uruchom ponownie", + "shutdown_host": "Wyłącz", "used_space": "Zajęte miejsce" }, "log": { @@ -457,7 +457,7 @@ "leave_beta_action": "Opuść kanał beta", "leave_beta_description": "Pobieraj stabilne aktualizacje dla Home Assistanta, Supervisora i hosta", "ram_usage": "Zużycie pamięci przez Supervisora", - "reload_supervisor": "Wczytaj ponownie Supervisor", + "reload_supervisor": "Wczytaj ponownie", "share_diagnostics": "Udostępnij dane diagnostyczne", "share_diagnostics_description": "Udostępniaj raporty o awariach i informacje diagnostyczne.", "share_diagonstics_description": "Czy chcesz automatycznie udostępniać raporty o awariach i informacje diagnostyczne, gdy Supervisor napotka nieoczekiwane błędy? {line_break} Pozwoli nam to rozwiązać problemy, informacje są dostępne tylko dla głównego zespołu Home Assistant Core i nie będą udostępniane innym. {line_break} Dane nie zawierają żadnych prywatnych/wrażliwych informacji i możesz to wyłączyć w ustawieniach w dowolnym momencie.", @@ -2166,7 +2166,7 @@ "license": "Opublikowany na licencji Apache 2.0", "path_configuration": "Ścieżka do pliku configuration.yaml: {path}", "server": "serwer", - "setup_time": "Ustawienia czasu", + "setup_time": "Czas konfiguracji", "source": "Źródło:", "system_health_error": "Komponent kondycji systemu nie jest wczytany. Dodaj 'system_health:' do pliku configuration.yaml", "system_health": { From a71ebcf47e784c5a9290041df95925785d0a7ccf Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Thu, 6 May 2021 19:51:08 +0200 Subject: [PATCH 006/117] Bump js-xss to 1.0.9 (#9121) --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 3a3708fa12..13524421fe 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "workbox-precaching": "^6.1.5", "workbox-routing": "^6.1.5", "workbox-strategies": "^6.1.5", - "xss": "^1.0.6" + "xss": "^1.0.9" }, "devDependencies": { "@babel/core": "^7.14.0", diff --git a/yarn.lock b/yarn.lock index 113e25d4c6..1e0ff5bb52 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5004,7 +5004,7 @@ commander@^2.14.1, commander@^2.19.0, commander@^2.9.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== -commander@^2.20.0, commander@~2.20.3: +commander@^2.20.0, commander@^2.20.3, commander@~2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -13699,12 +13699,12 @@ xmlbuilder@~11.0.0: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3" integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA== -xss@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/xss/-/xss-1.0.6.tgz#eaf11e9fc476e3ae289944a1009efddd8a124b51" - integrity sha512-6Q9TPBeNyoTRxgZFk5Ggaepk/4vUOYdOsIUYvLehcsIZTFjaavbVnsuAkLA5lIFuug5hw8zxcB9tm01gsjph2A== +xss@^1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/xss/-/xss-1.0.9.tgz#3ffd565571ff60d2e40db7f3b80b4677bec770d2" + integrity sha512-2t7FahYnGJys6DpHLhajusId7R0Pm2yTmuL0GV9+mV0ZlaLSnb2toBmppATfg5sWIhZQGlsTLoecSzya+l4EAQ== dependencies: - commander "^2.9.0" + commander "^2.20.3" cssfilter "0.0.10" "xtend@>=4.0.0 <4.1.0-0", xtend@~4.0.0, xtend@~4.0.1: From 9755bf723fff119d148594d3a82f69e6e143775f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 7 May 2021 01:42:34 +0000 Subject: [PATCH 007/117] Translation update --- translations/frontend/he.json | 2 +- translations/frontend/ko.json | 8 ++++++++ translations/frontend/nb.json | 8 ++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/translations/frontend/he.json b/translations/frontend/he.json index 2d29099358..9ec8d7e9d2 100644 --- a/translations/frontend/he.json +++ b/translations/frontend/he.json @@ -183,7 +183,7 @@ "text": "האם ברצונך לאתחל את התוסף עם השינויים שלך?" }, "update": { - "create_snapshot": "צור נקודת גיבוי עבור {name}", + "create_snapshot": "צור נקודת גיבוי עבור {name} לפני העדכון", "snapshot": "נקודת גיבוי", "snapshotting": "יוצר נקודת גיבוי עבור {name}", "updating": "מעדכן את {name} לגרסה {version}" diff --git a/translations/frontend/ko.json b/translations/frontend/ko.json index 8d6ef37bad..8656b787a0 100644 --- a/translations/frontend/ko.json +++ b/translations/frontend/ko.json @@ -1746,10 +1746,16 @@ "remote": { "access_is_being_prepared": "원격 접속이 준비 중입니다. 준비가 되면 알려드리겠습니다.", "certificate_info": "인증서 정보", + "connected": "연결됨", "info": "Home Assistant Cloud는 집 밖에서도 구성요소에 대한 안전한 원격 연결을 제공해드립니다.", "instance_is_available": "구성요소는 다음의 주소에서 사용할 수 있습니다.", "instance_will_be_available": "토글을 활성화하여 다음의 주소에서 구성요소를 사용해보세요.", "link_learn_how_it_works": "작동 방식에 대해 알아보기", + "not_connected": "연결되지 않음", + "remote_enabled": { + "caption": "자동 연결", + "description": "이 옵션을 활성화하면 Home Assistant 인스턴스에 항상 원격으로 액세스 할 수 있습니다." + }, "title": "원격 제어" }, "sign_out": "로그 아웃", @@ -2160,6 +2166,7 @@ "license": "Apache 2.0 License에 따라 게시", "path_configuration": "configuration.yaml의 위치: {path}", "server": "서버", + "setup_time": "설정 시간", "source": "소스:", "system_health_error": "시스템 상태보기 구성요소가 로드되지 않았습니다. configuration.yaml에 'system_health:'를 추가해주세요.", "system_health": { @@ -2237,6 +2244,7 @@ }, "finish": "완료", "loading_first_time": "통합 구성요소가 설치되는 동안 기다려주세요", + "next": "다음", "not_all_required_fields": "필수 입력란이 모두 채워지지 않았습니다.", "not_loaded": "통합 구성요소를 불러올 수 없습니다. Home Assistant를 다시 시작해주세요.", "pick_flow_step": { diff --git a/translations/frontend/nb.json b/translations/frontend/nb.json index f906d99bfc..1b1dd89408 100644 --- a/translations/frontend/nb.json +++ b/translations/frontend/nb.json @@ -1256,7 +1256,7 @@ "title": "Varsler" }, "notification_toast": { - "connection_lost": "Forbindelse mistet. Koble til igjen...", + "connection_lost": "Mistet forbindelsen. Kobler til på nytt...", "dismiss": "Avvis", "intergration_starting": "Starter {integration}. Ikke alt er tilgjengelig før lasting er ferdig.", "service_call_failed": "Kunne ikke tilkalle tjenesten: {service}", @@ -3130,7 +3130,7 @@ "column_description": "Beskrivelse", "column_example": "Eksempel", "column_parameter": "", - "description": "Service utviklingsverktøyet lar deg tilkalle alle tilgjengelige tjenester i Home Assistant.", + "description": "Tjenesteutviklingsverktøyet lar deg tilkalle alle tilgjengelige tjenester i Home Assistant.", "fill_example_data": "Fyll ut eksempeldata", "no_template_ui_support": "Brukergrensesnittet støtter ikke maler, du kan fortsatt bruke YAML-redigereren.", "title": "Tjenester", @@ -3143,8 +3143,8 @@ "attributes": "Attributter", "copy_id": "Kopier ID til utklippstavlen", "current_entities": "Gjeldende entiteter", - "description1": "Angi gjeldende tilstandsrepresentasjon for en enhet i Home Assistant.", - "description2": "Hvis enheten tilhører en enhet, vil det ikke være noen faktisk kommunikasjon med den enheten.", + "description1": "Angi gjeldende tilstandsrepresentasjon for en entitet i Home Assistant.", + "description2": "Hvis entiteten tilhører en enhet, vil det ikke være noen faktisk kommunikasjon med den enheten.", "entity": "Entitet", "filter_attributes": "Filtrere attributter", "filter_entities": "Filtrere entiteter", From a94f85a100f0172a31a6d7c6d5a450de14a8cc3e Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Fri, 7 May 2021 11:13:48 +0200 Subject: [PATCH 008/117] Fix alignment of Entities card header toggle (#9123) --- src/panels/lovelace/components/hui-entities-toggle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/lovelace/components/hui-entities-toggle.ts b/src/panels/lovelace/components/hui-entities-toggle.ts index b1d56f8626..6af1483d66 100644 --- a/src/panels/lovelace/components/hui-entities-toggle.ts +++ b/src/panels/lovelace/components/hui-entities-toggle.ts @@ -62,7 +62,7 @@ class HuiEntitiesToggle extends LitElement { } ha-switch { padding: 13px 5px; - margin: -4px -5px; + margin: -4px -8px; } `; } From abcdd60a214f4beb2bfa63049cc7f0a6feefe6ff Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Fri, 7 May 2021 11:14:03 +0200 Subject: [PATCH 009/117] Convert GPS to uppercase in attribute name (#9124) --- src/util/hass-attributes-util.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/hass-attributes-util.ts b/src/util/hass-attributes-util.ts index 0db6b5e0d5..8a44c00aa3 100644 --- a/src/util/hass-attributes-util.ts +++ b/src/util/hass-attributes-util.ts @@ -126,6 +126,7 @@ export function formatAttributeName(value: string): string { .replace(/_/g, " ") .replace(/\bid\b/g, "ID") .replace(/\bip\b/g, "IP") - .replace(/\bmac\b/g, "MAC"); + .replace(/\bmac\b/g, "MAC") + .replace(/\bgps\b/g, "GPS"); return value.charAt(0).toUpperCase() + value.slice(1); } From a9c7a39a475719d3baa2b945a117f3e210d5e924 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 7 May 2021 11:16:25 +0200 Subject: [PATCH 010/117] Fix positioning of preload checkbox (#9115) --- src/dialogs/more-info/controls/more-info-camera.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dialogs/more-info/controls/more-info-camera.ts b/src/dialogs/more-info/controls/more-info-camera.ts index 64808f950f..d5ed6dfb5c 100644 --- a/src/dialogs/more-info/controls/more-info-camera.ts +++ b/src/dialogs/more-info/controls/more-info-camera.ts @@ -115,13 +115,17 @@ class MoreInfoCamera extends LitElement { static get styles(): CSSResult { return css` + :host { + display: block; + position: relative; + } paper-checkbox { position: absolute; top: 0; right: 0; background-color: var(--secondary-background-color); padding: 5px; - border-bottom-left-radius: 6px; + border-bottom-left-radius: 4px; } `; } From 9be4a001697abadc621d33b3cbc4c004f07c291f Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 7 May 2021 11:28:37 +0200 Subject: [PATCH 011/117] Update UI when service schema change (#9120) --- src/components/ha-service-control.ts | 78 ++++++++++++++++------------ 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/src/components/ha-service-control.ts b/src/components/ha-service-control.ts index 48fb03011e..8fab54997b 100644 --- a/src/components/ha-service-control.ts +++ b/src/components/ha-service-control.ts @@ -1,5 +1,9 @@ import { mdiHelpCircle } from "@mdi/js"; -import { HassService, HassServiceTarget } from "home-assistant-js-websocket"; +import { + HassService, + HassServices, + HassServiceTarget, +} from "home-assistant-js-websocket"; import { css, CSSResult, @@ -73,7 +77,10 @@ export class HaServiceControl extends LitElement { this._checkedKeys = new Set(); } - const serviceData = this._getServiceInfo(this.value?.service); + const serviceData = this._getServiceInfo( + this.value?.service, + this.hass.services + ); if ( serviceData && @@ -122,40 +129,45 @@ export class HaServiceControl extends LitElement { return ENTITY_COMPONENT_DOMAINS.includes(domain) ? [domain] : null; }); - private _getServiceInfo = memoizeOne((service?: string): - | ExtHassService - | undefined => { - if (!service) { - return undefined; - } - const domain = computeDomain(service); - const serviceName = computeObjectId(service); - const serviceDomains = this.hass.services; - if (!(domain in serviceDomains)) { - return undefined; - } - if (!(serviceName in serviceDomains[domain])) { - return undefined; - } + private _getServiceInfo = memoizeOne( + ( + service?: string, + serviceDomains?: HassServices + ): ExtHassService | undefined => { + if (!service || !serviceDomains) { + return undefined; + } + const domain = computeDomain(service); + const serviceName = computeObjectId(service); + if (!(domain in serviceDomains)) { + return undefined; + } + if (!(serviceName in serviceDomains[domain])) { + return undefined; + } - const fields = Object.entries( - serviceDomains[domain][serviceName].fields - ).map(([key, value]) => ({ - key, - ...value, - selector: value.selector as Selector | undefined, - })); - return { - ...serviceDomains[domain][serviceName], - fields, - hasSelector: fields.length - ? fields.filter((field) => field.selector).map((field) => field.key) - : [], - }; - }); + const fields = Object.entries( + serviceDomains[domain][serviceName].fields + ).map(([key, value]) => ({ + key, + ...value, + selector: value.selector as Selector | undefined, + })); + return { + ...serviceDomains[domain][serviceName], + fields, + hasSelector: fields.length + ? fields.filter((field) => field.selector).map((field) => field.key) + : [], + }; + } + ); protected render() { - const serviceData = this._getServiceInfo(this._value?.service); + const serviceData = this._getServiceInfo( + this._value?.service, + this.hass.services + ); const shouldRenderServiceDataYaml = (serviceData?.fields.length && !serviceData.hasSelector.length) || From cd3ffceeff4733eb6895789ee72cd828f8cd4061 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 7 May 2021 14:33:33 +0200 Subject: [PATCH 012/117] Fix for when the value doesnt get changed by the backend when we send it (#9105) --- src/data/light.ts | 4 +- .../more-info/controls/more-info-light.ts | 51 +++++++++++-------- src/dialogs/more-info/more-info-content.ts | 8 ++- 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/src/data/light.ts b/src/data/light.ts index df67709783..9ef41c284f 100644 --- a/src/data/light.ts +++ b/src/data/light.ts @@ -51,9 +51,7 @@ export const lightSupportsDimming = (entity: LightEntity) => modesSupportingDimming.includes(mode) ); -export const getLightCurrentModeRgbColor = ( - entity: LightEntity -): number[] | undefined => +export const getLightCurrentModeRgbColor = (entity: LightEntity): number[] => entity.attributes.color_mode === LightColorModes.RGBWW ? entity.attributes.rgbww_color : entity.attributes.color_mode === LightColorModes.RGBW diff --git a/src/dialogs/more-info/controls/more-info-light.ts b/src/dialogs/more-info/controls/more-info-light.ts index 63520d1947..18e355b81f 100644 --- a/src/dialogs/more-info/controls/more-info-light.ts +++ b/src/dialogs/more-info/controls/more-info-light.ts @@ -154,7 +154,7 @@ class MoreInfoLight extends LitElement { )} icon="hass:brightness-7" max="100" - .value=${this._colorBrightnessSliderValue ?? 100} + .value=${this._colorBrightnessSliderValue} @change=${this._colorBrightnessSliderChanged} pin >` @@ -282,23 +282,15 @@ class MoreInfoLight extends LitElement { stateObj.attributes.color_mode === LightColorModes.RGBWW ? Math.round((stateObj.attributes.rgbww_color[4] * 100) / 255) : undefined; - this._colorBrightnessSliderValue = - stateObj.attributes.color_mode === LightColorModes.RGBWW - ? Math.round( - (Math.max(...stateObj.attributes.rgbww_color.slice(0, 3)) * 100) / - 255 - ) - : stateObj.attributes.color_mode === LightColorModes.RGBW - ? Math.round( - (Math.max(...stateObj.attributes.rgbw_color.slice(0, 3)) * 100) / - 255 - ) - : undefined; + this._colorBrightnessSliderValue = Math.round( + (Math.max(...getLightCurrentModeRgbColor(stateObj).slice(0, 3)) * 100) / + 255 + ); - this._colorPickerColor = getLightCurrentModeRgbColor(stateObj)?.slice( + this._colorPickerColor = getLightCurrentModeRgbColor(stateObj).slice( 0, 3 - ) as [number, number, number] | undefined; + ) as [number, number, number]; } else { this._brightnessSliderValue = 0; } @@ -328,6 +320,8 @@ class MoreInfoLight extends LitElement { return; } + this._brightnessSliderValue = bri; + if (this._brightnessAdjusted) { const rgb = this.stateObj!.attributes.rgb_color || @@ -358,6 +352,8 @@ class MoreInfoLight extends LitElement { return; } + this._ctSliderValue = ct; + this.hass.callService("light", "turn_on", { entity_id: this.stateObj!.entity_id, color_temp: ct, @@ -373,6 +369,14 @@ class MoreInfoLight extends LitElement { return; } + if (name === "wv") { + this._wvSliderValue = wv; + } else if (name === "cw") { + this._cwSliderValue = wv; + } else if (name === "ww") { + this._wwSliderValue = wv; + } + wv = Math.min(255, Math.round((wv * 255) / 100)); const rgb = getLightCurrentModeRgbColor(this.stateObj!); @@ -406,6 +410,9 @@ class MoreInfoLight extends LitElement { return; } + const oldValue = this._colorBrightnessSliderValue; + this._colorBrightnessSliderValue = value; + value = (value * 255) / 100; const rgb = (getLightCurrentModeRgbColor(this.stateObj!)?.slice(0, 3) || [ @@ -417,12 +424,8 @@ class MoreInfoLight extends LitElement { this._setRgbWColor( this._adjustColorBrightness( // first normalize the value - this._colorBrightnessSliderValue - ? this._adjustColorBrightness( - rgb, - (this._colorBrightnessSliderValue * 255) / 100, - true - ) + oldValue + ? this._adjustColorBrightness(rgb, (oldValue * 255) / 100, true) : rgb, value ) @@ -488,6 +491,12 @@ class MoreInfoLight extends LitElement { rgb: { r: number; g: number; b: number }; }> ) { + this._colorPickerColor = [ + ev.detail.rgb.r, + ev.detail.rgb.g, + ev.detail.rgb.b, + ]; + if ( lightSupportsColorMode(this.stateObj!, LightColorModes.RGBWW) || lightSupportsColorMode(this.stateObj!, LightColorModes.RGBW) diff --git a/src/dialogs/more-info/more-info-content.ts b/src/dialogs/more-info/more-info-content.ts index d08ae9507a..4adae879ad 100644 --- a/src/dialogs/more-info/more-info-content.ts +++ b/src/dialogs/more-info/more-info-content.ts @@ -8,7 +8,7 @@ import { stateMoreInfoType } from "./state_more_info_control"; class MoreInfoContent extends UpdatingElement { @property({ attribute: false }) public hass?: HomeAssistant; - @property() public stateObj?: HassEntity; + @property({ attribute: false }) public stateObj?: HassEntity; private _detachedChild?: ChildNode; @@ -54,3 +54,9 @@ class MoreInfoContent extends UpdatingElement { } customElements.define("more-info-content", MoreInfoContent); + +declare global { + interface HTMLElementTagNameMap { + "more-info-content": MoreInfoContent; + } +} From c48a60cce6b9497269d0361582517fb513f20e7f Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 7 May 2021 22:10:35 +0200 Subject: [PATCH 013/117] Bump superstruct (#9119) Co-authored-by: Philip Allgaier --- package.json | 2 +- src/common/structs/handle-errors.ts | 16 ++++++++++- src/common/structs/is-entity-id.ts | 28 +++++++------------ src/common/structs/is-icon.ts | 15 +++------- .../types/ha-automation-action-service.ts | 4 +-- .../hui-entities-card-editor.ts | 2 ++ .../hui-history-graph-card-editor.ts | 6 ++-- yarn.lock | 8 +++--- 8 files changed, 41 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index 13524421fe..e281fc882d 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "resize-observer-polyfill": "^1.5.1", "roboto-fontface": "^0.10.0", "sortablejs": "^1.10.2", - "superstruct": "^0.10.13", + "superstruct": "^0.15.2", "tinykeys": "^1.1.1", "tsparticles": "^1.19.2", "unfetch": "^4.1.0", diff --git a/src/common/structs/handle-errors.ts b/src/common/structs/handle-errors.ts index 7aa8889045..96c82081c5 100644 --- a/src/common/structs/handle-errors.ts +++ b/src/common/structs/handle-errors.ts @@ -27,6 +27,20 @@ export const handleStructError = ( failure.path.join(".") ) ); + } else if (failure.type === "union") { + continue; + } else if (failure.type === "enums") { + warnings.push( + hass.localize( + "ui.errors.config.key_wrong_type", + "key", + failure.path.join("."), + "type_correct", + failure.message.replace("Expected ", "").split(", ")[0], + "type_wrong", + JSON.stringify(failure.value) + ) + ); } else { warnings.push( hass.localize( @@ -34,7 +48,7 @@ export const handleStructError = ( "key", failure.path.join("."), "type_correct", - failure.type, + failure.refinement || failure.type, "type_wrong", JSON.stringify(failure.value) ) diff --git a/src/common/structs/is-entity-id.ts b/src/common/structs/is-entity-id.ts index c408187e84..8d71f01694 100644 --- a/src/common/structs/is-entity-id.ts +++ b/src/common/structs/is-entity-id.ts @@ -1,30 +1,22 @@ -import { struct, StructContext, StructResult } from "superstruct"; +import { refine, string } from "superstruct"; -const isEntityId = (value: unknown, context: StructContext): StructResult => { - if (typeof value !== "string") { - return [context.fail({ type: "string" })]; - } +const isEntityId = (value: string): boolean => { if (!value.includes(".")) { - return [ - context.fail({ - type: "Entity ID should be in the format 'domain.entity'", - }), - ]; + return false; } return true; }; -export const EntityId = struct("entity-id", isEntityId); +export const entityId = () => + refine(string(), "entity ID (domain.entity)", isEntityId); -const isEntityIdOrAll = ( - value: unknown, - context: StructContext -): StructResult => { - if (typeof value === "string" && value === "all") { +const isEntityIdOrAll = (value: string): boolean => { + if (value === "all") { return true; } - return isEntityId(value, context); + return isEntityId(value); }; -export const EntityIdOrAll = struct("entity-id-all", isEntityIdOrAll); +export const entityIdOrAll = () => + refine(string(), "entity ID (domain.entity or all)", isEntityIdOrAll); diff --git a/src/common/structs/is-icon.ts b/src/common/structs/is-icon.ts index 7ca4ff9ed5..db97d69ec2 100644 --- a/src/common/structs/is-icon.ts +++ b/src/common/structs/is-icon.ts @@ -1,17 +1,10 @@ -import { struct, StructContext, StructResult } from "superstruct"; +import { refine, string } from "superstruct"; -const isIcon = (value: unknown, context: StructContext): StructResult => { - if (typeof value !== "string") { - return [context.fail({ type: "string" })]; - } +const isIcon = (value: string) => { if (!value.includes(":")) { - return [ - context.fail({ - type: "icon should be in the format 'mdi:icon'", - }), - ]; + return false; } return true; }; -export const Icon = struct("icon", isIcon); +export const icon = () => refine(string(), "icon (mdi:icon-name)", isIcon); diff --git a/src/panels/config/automation/action/types/ha-automation-action-service.ts b/src/panels/config/automation/action/types/ha-automation-action-service.ts index 4930c86b9b..175c11f9a5 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-service.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-service.ts @@ -13,14 +13,14 @@ import { any, assert, object, optional, string } from "superstruct"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { ServiceAction } from "../../../../../data/script"; import type { HomeAssistant } from "../../../../../types"; -import { EntityIdOrAll } from "../../../../../common/structs/is-entity-id"; +import { entityIdOrAll } from "../../../../../common/structs/is-entity-id"; import { ActionElement } from "../ha-automation-action-row"; import "../../../../../components/ha-service-control"; import { hasTemplate } from "../../../../../common/string/has-template"; const actionStruct = object({ service: optional(string()), - entity_id: optional(EntityIdOrAll), + entity_id: optional(entityIdOrAll()), target: optional(any()), data: optional(any()), }); diff --git a/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts index f85a1e4530..3beb16952a 100644 --- a/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts @@ -22,6 +22,7 @@ import { union, } from "superstruct"; import { fireEvent, HASSDomEvent } from "../../../../common/dom/fire_event"; +import { entityId } from "../../../../common/structs/is-entity-id"; import { computeRTLDirection } from "../../../../common/util/compute_rtl"; import "../../../../components/entity/state-badge"; import "../../../../components/ha-card"; @@ -49,6 +50,7 @@ import { configElementStyle } from "./config-elements-style"; const cardConfigStruct = object({ type: string(), title: optional(union([string(), boolean()])), + entity: optional(entityId()), theme: optional(string()), show_header_toggle: optional(boolean()), state_color: optional(boolean()), diff --git a/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts index 4f2ee981e1..96bd9a4d5f 100644 --- a/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-history-graph-card-editor.ts @@ -20,7 +20,7 @@ import { import { fireEvent } from "../../../../common/dom/fire_event"; import { HomeAssistant } from "../../../../types"; import { HistoryGraphCardConfig } from "../../cards/types"; -import { EntityId } from "../../../../common/structs/is-entity-id"; +import { entityId } from "../../../../common/structs/is-entity-id"; import "../../components/hui-entity-editor"; import { EntityConfig } from "../../entity-rows/types"; import { LovelaceCardEditor } from "../../types"; @@ -30,10 +30,10 @@ import { configElementStyle } from "./config-elements-style"; const entitiesConfigStruct = union([ object({ - entity: EntityId, + entity: entityId(), name: optional(string()), }), - EntityId, + entityId(), ]); const cardConfigStruct = object({ diff --git a/yarn.lock b/yarn.lock index 1e0ff5bb52..5591afd29b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12220,10 +12220,10 @@ subarg@^1.0.0: dependencies: minimist "^1.1.0" -superstruct@^0.10.13: - version "0.10.13" - resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.10.13.tgz#705535a5598ff231bd976601a7b6b534a71a821b" - integrity sha512-W4SitSZ9MOyMPbHreoZVEneSZyPEeNGbdfJo/7FkJyRs/M3wQRFzq+t3S/NBwlrFSWdx1ONLjLb9pB+UKe4IqQ== +superstruct@^0.15.2: + version "0.15.2" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.2.tgz#ab7fb84c455a9d7da84c11cfd82c85a4fee9dfff" + integrity sha512-OsJI8lv6/PsInwCf4ultejmsJYseYshKhkcbDendqNwj3MeGXENajl3ujMGMU4FDDSSeJTOwFn9T6pnfsS9DYA== supports-color@6.0.0: version "6.0.0" From 0f58214ba185f97f8492e2b2b7ab239374935662 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 7 May 2021 22:11:30 +0200 Subject: [PATCH 014/117] Bump leaflet + fix location editor (#9118) --- package.json | 6 ++--- src/components/map/ha-locations-editor.ts | 7 +++--- src/panels/config/core/ha-config-core-form.ts | 21 ++++++++++------ src/panels/config/tags/dialog-tag-detail.ts | 1 - src/panels/config/zone/dialog-zone-detail.ts | 7 +++--- yarn.lock | 24 +++++++++---------- 6 files changed, 35 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index e281fc882d..e320fc9ff2 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "idb-keyval": "^3.2.0", "intl-messageformat": "^8.3.9", "js-yaml": "^3.13.1", - "leaflet": "^1.4.0", + "leaflet": "^1.7.1", "leaflet-draw": "^1.0.4", "lit-element": "^2.5.0", "lit-html": "^1.4.0", @@ -169,8 +169,8 @@ "@types/chromecast-caf-receiver": "^5.0.11", "@types/chromecast-caf-sender": "^1.0.3", "@types/js-yaml": "^3.12.1", - "@types/leaflet": "^1.4.3", - "@types/leaflet-draw": "^1.0.1", + "@types/leaflet": "^1.7.0", + "@types/leaflet-draw": "^1.0.3", "@types/marked": "^1.2.2", "@types/memoize-one": "4.1.0", "@types/mocha": "^7.0.2", diff --git a/src/components/map/ha-locations-editor.ts b/src/components/map/ha-locations-editor.ts index 184813c32e..5991f36706 100644 --- a/src/components/map/ha-locations-editor.ts +++ b/src/components/map/ha-locations-editor.ts @@ -286,12 +286,11 @@ export class HaLocationsEditor extends LitElement { [location.latitude, location.longitude], options ) - .addEventListener( - "dragend", - // @ts-ignore - (ev: DragEndEvent) => this._updateLocation(ev) + .addEventListener("dragend", (ev: DragEndEvent) => + this._updateLocation(ev) ) .addEventListener( + // @ts-ignore "click", // @ts-ignore (ev: MouseEvent) => this._markerClicked(ev) diff --git a/src/panels/config/core/ha-config-core-form.ts b/src/panels/config/core/ha-config-core-form.ts index f14b1ca526..2d3bfff403 100644 --- a/src/panels/config/core/ha-config-core-form.ts +++ b/src/panels/config/core/ha-config-core-form.ts @@ -13,6 +13,7 @@ import { property, TemplateResult, } from "lit-element"; +import memoizeOne from "memoize-one"; import { UNIT_C } from "../../../common/const"; import "../../../components/ha-card"; import "../../../components/map/ha-location-editor"; @@ -62,7 +63,11 @@ class ConfigCoreForm extends LitElement { @@ -165,11 +170,9 @@ class ConfigCoreForm extends LitElement { input.inputElement.appendChild(createTimezoneListEl()); } - private get _locationValue() { - return this._location !== undefined - ? this._location - : [Number(this.hass.config.latitude), Number(this.hass.config.longitude)]; - } + private _locationValue = memoizeOne( + (location, lat, lng) => location || [Number(lat), Number(lng)] + ); private get _elevationValue() { return this._elevation !== undefined @@ -209,7 +212,11 @@ class ConfigCoreForm extends LitElement { private async _save() { this._working = true; try { - const location = this._locationValue; + const location = this._locationValue( + this._location, + this.hass.config.latitude, + this.hass.config.longitude + ); await saveCoreConfig(this.hass, { latitude: location[0], longitude: location[1], diff --git a/src/panels/config/tags/dialog-tag-detail.ts b/src/panels/config/tags/dialog-tag-detail.ts index 68e9f39b0e..3a8655fd6c 100644 --- a/src/panels/config/tags/dialog-tag-detail.ts +++ b/src/panels/config/tags/dialog-tag-detail.ts @@ -14,7 +14,6 @@ import { fireEvent } from "../../../common/dom/fire_event"; import { createCloseHeading } from "../../../components/ha-dialog"; import "../../../components/ha-formfield"; import "../../../components/ha-switch"; -import "../../../components/map/ha-location-editor"; import { Tag, UpdateTagParams } from "../../../data/tag"; import { HassDialog } from "../../../dialogs/make-dialog-manager"; import { haStyleDialog } from "../../../resources/styles"; diff --git a/src/panels/config/zone/dialog-zone-detail.ts b/src/panels/config/zone/dialog-zone-detail.ts index b2dd807734..d06e6bce0e 100644 --- a/src/panels/config/zone/dialog-zone-detail.ts +++ b/src/panels/config/zone/dialog-zone-detail.ts @@ -9,6 +9,7 @@ import { property, TemplateResult, } from "lit-element"; +import memoizeOne from "memoize-one"; import { fireEvent } from "../../../common/dom/fire_event"; import { addDistanceToCoord } from "../../../common/location/add_distance_to_coord"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; @@ -141,7 +142,7 @@ class DialogZoneDetail extends LitElement { [Number(lat), Number(lng)]); private _locationChanged(ev) { [this._latitude, this._longitude] = ev.currentTarget.location; diff --git a/yarn.lock b/yarn.lock index 5591afd29b..1b7f205fdf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2786,10 +2786,10 @@ "@types/koa-compose" "*" "@types/node" "*" -"@types/leaflet-draw@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/leaflet-draw/-/leaflet-draw-1.0.1.tgz#66e0c2c8b93b23487f836a8d65a769b98aa0bc5b" - integrity sha512-/urwtXkpvv7rtre5A6plvXHSUDmFvDrwqpQRKseBCC2bIhIhBtMDf+plqQmi0vhvSk0Pqgk8qH1rtC8EVxPdmg== +"@types/leaflet-draw@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@types/leaflet-draw/-/leaflet-draw-1.0.3.tgz#73a003bf1def575c7cfd3205fa48d26bd0dc4273" + integrity sha512-ayNnO40vafd1Do3h7v0++toEzcO1CEjtFBqPunF3695WU0OTPzJ82XUQcd4MlYTuPSP3OsZm5ni361tgmcjxNw== dependencies: "@types/leaflet" "*" @@ -2800,10 +2800,10 @@ dependencies: "@types/geojson" "*" -"@types/leaflet@^1.4.3": - version "1.4.3" - resolved "https://registry.yarnpkg.com/@types/leaflet/-/leaflet-1.4.3.tgz#62638cb73770eeaed40222042afbcc7b495f0cc4" - integrity sha512-jFRBSsPHi1EwQSwrN0cOJLdPhwOZsRl4IMxvm/2ShLh0YM5GfCtQXCzsrv8RE7DWL+AykXdYSAd9bFLWbZT4CQ== +"@types/leaflet@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@types/leaflet/-/leaflet-1.7.0.tgz#3700fb5d29a8214fbd496565b08ec28e40cee808" + integrity sha512-ltv5jR+VjKSMtoDkxH61Rsbo0zLU7iqyOXpVPkAX4F+79fg2eymC7t0msWsfNaEZO1FGTIQATCCCQe+ijWoicg== dependencies: "@types/geojson" "*" @@ -8598,10 +8598,10 @@ leaflet-draw@^1.0.4: resolved "https://registry.yarnpkg.com/leaflet-draw/-/leaflet-draw-1.0.4.tgz#45be92f378ed253e7202fdeda1fcc71885198d46" integrity sha512-rsQ6saQO5ST5Aj6XRFylr5zvarWgzWnrg46zQ1MEOEIHsppdC/8hnN8qMoFvACsPvTioAuysya/TVtog15tyAQ== -leaflet@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.4.0.tgz#d5f56eeb2aa32787c24011e8be4c77e362ae171b" - integrity sha512-x9j9tGY1+PDLN9pcWTx9/y6C5nezoTMB8BLK5jTakx+H7bPlnbCHfi9Hjg+Qt36sgDz/cb9lrSpNQXmk45Tvhw== +leaflet@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/leaflet/-/leaflet-1.7.1.tgz#10d684916edfe1bf41d688a3b97127c0322a2a19" + integrity sha512-/xwPEBidtg69Q3HlqPdU3DnrXQOvQU/CCHA1tcDQVzOwm91YMYaILjNp7L4Eaw5Z4sOYdbBz6koWyibppd8Zqw== leven@^3.1.0: version "3.1.0" From 9f032a61a9dd308a263dc5c990782aba50ded1d7 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 7 May 2021 22:16:14 +0200 Subject: [PATCH 015/117] Add compatibility for Lit 2.0 (#8878) --- cast/src/launcher/layout/hc-cast.ts | 10 +-- cast/src/launcher/layout/hc-connect.ts | 18 ++-- cast/src/launcher/layout/hc-layout.ts | 4 +- cast/src/receiver/layout/hc-demo.ts | 4 +- cast/src/receiver/layout/hc-launch-screen.ts | 4 +- cast/src/receiver/layout/hc-lovelace.ts | 4 +- cast/src/receiver/layout/hc-main.ts | 15 ++-- demo/src/custom-cards/cast-demo-row.ts | 8 +- demo/src/custom-cards/ha-demo-card.ts | 8 +- gallery/src/demos/demo-automation-trace.ts | 4 +- gallery/src/demos/demo-integration-card.ts | 6 +- .../addon-store/hassio-addon-repository.ts | 4 +- hassio/src/addon-store/hassio-addon-store.ts | 8 +- .../addon-view/config/hassio-addon-audio.ts | 16 ++-- .../config/hassio-addon-config-tab.ts | 4 +- .../addon-view/config/hassio-addon-config.ts | 16 ++-- .../addon-view/config/hassio-addon-network.ts | 10 +-- .../hassio-addon-documentation-tab.ts | 10 +-- .../src/addon-view/hassio-addon-dashboard.ts | 8 +- .../addon-view/info/hassio-addon-info-tab.ts | 4 +- .../src/addon-view/info/hassio-addon-info.ts | 10 +-- .../addon-view/log/hassio-addon-log-tab.ts | 4 +- .../src/addon-view/log/hassio-addon-logs.ts | 10 +-- hassio/src/components/hassio-ansi-to-html.ts | 4 +- hassio/src/components/hassio-card-content.ts | 4 +- .../src/components/hassio-upload-snapshot.ts | 6 +- hassio/src/components/supervisor-metric.ts | 4 +- hassio/src/dashboard/hassio-addons.ts | 4 +- hassio/src/dashboard/hassio-dashboard.ts | 4 +- hassio/src/dashboard/hassio-update.ts | 4 +- .../markdown/dialog-hassio-markdown.ts | 8 +- .../dialogs/network/dialog-hassio-network.ts | 24 ++--- .../registries/dialog-hassio-registries.ts | 16 ++-- .../dialog-hassio-repositories.ts | 16 ++-- .../snapshot/dialog-hassio-snapshot-upload.ts | 8 +- .../snapshot/dialog-hassio-snapshot.ts | 22 ++--- .../update/dialog-supervisor-update.ts | 16 ++-- hassio/src/hassio-my-redirect.ts | 4 +- hassio/src/hassio-panel.ts | 4 +- .../src/ingress-view/hassio-ingress-view.ts | 8 +- hassio/src/snapshots/hassio-snapshots.ts | 22 ++--- hassio/src/supervisor-base-element.ts | 16 +--- hassio/src/system/hassio-core-info.ts | 8 +- hassio/src/system/hassio-host-info.ts | 4 +- hassio/src/system/hassio-supervisor-info.ts | 8 +- hassio/src/system/hassio-supervisor-log.ts | 12 +-- hassio/src/system/hassio-system.ts | 4 +- package.json | 8 +- src/auth/ha-auth-flow.ts | 14 +-- src/auth/ha-authorize.ts | 12 +-- src/common/decorators/local-storage.ts | 10 +-- src/common/dom/dynamic-element-directive.ts | 53 +++++++---- src/common/search/search-input.ts | 4 +- src/components/buttons/ha-call-api-button.ts | 11 ++- src/components/buttons/ha-progress-button.ts | 4 +- src/components/data-table/ha-data-table.ts | 20 ++--- src/components/date-range-picker.ts | 1 - .../device/ha-area-devices-picker.ts | 14 +-- .../device/ha-device-automation-picker.ts | 10 +-- src/components/device/ha-device-picker.ts | 8 +- .../entity/ha-entity-attribute-picker.ts | 4 +- src/components/entity/ha-entity-picker.ts | 4 +- src/components/entity/ha-entity-toggle.ts | 8 +- src/components/entity/ha-state-label-badge.ts | 89 +++++++++++-------- src/components/entity/state-badge.ts | 8 +- src/components/entity/state-info.ts | 4 +- src/components/ha-addon-picker.ts | 4 +- src/components/ha-analytics.ts | 4 +- src/components/ha-area-picker.ts | 14 +-- src/components/ha-attributes.ts | 4 +- src/components/ha-bar.ts | 4 +- src/components/ha-blueprint-picker.ts | 4 +- src/components/ha-button-menu.ts | 4 +- .../ha-button-related-filter-menu.ts | 8 +- src/components/ha-button-toggle-group.ts | 4 +- src/components/ha-camera-stream.ts | 10 +-- src/components/ha-card.ts | 4 +- src/components/ha-chip-set.ts | 4 +- src/components/ha-chip.ts | 4 +- src/components/ha-climate-state.ts | 4 +- src/components/ha-code-editor.ts | 39 +++++--- src/components/ha-combo-box.ts | 8 +- src/components/ha-cover-controls.ts | 8 +- src/components/ha-cover-tilt-controls.ts | 8 +- src/components/ha-date-input.ts | 4 +- src/components/ha-date-range-picker.ts | 4 +- src/components/ha-dialog.ts | 4 +- src/components/ha-expansion-panel.ts | 4 +- src/components/ha-file-upload.ts | 4 +- src/components/ha-form/ha-form-boolean.ts | 4 +- src/components/ha-form/ha-form-constant.ts | 4 +- src/components/ha-form/ha-form-integer.ts | 4 +- .../ha-form/ha-form-multi_select.ts | 8 +- src/components/ha-form/ha-form-select.ts | 4 +- src/components/ha-form/ha-form-string.ts | 8 +- src/components/ha-form/ha-form.ts | 4 +- src/components/ha-formfield.ts | 4 +- src/components/ha-gauge.ts | 6 +- src/components/ha-hls-player.ts | 8 +- src/components/ha-icon-button-arrow-next.ts | 4 +- src/components/ha-icon-button-arrow-prev.ts | 4 +- src/components/ha-icon-button-next.ts | 4 +- src/components/ha-icon-button-prev.ts | 4 +- src/components/ha-icon-button.ts | 11 +-- src/components/ha-icon.ts | 12 +-- src/components/ha-label-badge.ts | 4 +- src/components/ha-markdown-element.ts | 19 ++-- src/components/ha-markdown.ts | 4 +- src/components/ha-menu-button.ts | 8 +- src/components/ha-picture-upload.ts | 4 +- src/components/ha-related-items.ts | 14 +-- src/components/ha-relative-time.ts | 8 +- .../ha-selector/ha-selector-action.ts | 4 +- .../ha-selector/ha-selector-area.ts | 10 +-- .../ha-selector/ha-selector-boolean.ts | 4 +- .../ha-selector/ha-selector-device.ts | 10 +-- .../ha-selector/ha-selector-entity.ts | 10 +-- .../ha-selector/ha-selector-number.ts | 4 +- .../ha-selector/ha-selector-select.ts | 4 +- .../ha-selector/ha-selector-target.ts | 10 +-- src/components/ha-service-control.ts | 10 +-- src/components/ha-service-picker.ts | 4 +- src/components/ha-settings-row.ts | 4 +- src/components/ha-sidebar.ts | 15 ++-- src/components/ha-svg-icon.ts | 4 +- src/components/ha-switch.ts | 4 +- src/components/ha-tab.ts | 8 +- src/components/ha-target-picker.ts | 14 +-- src/components/ha-yaml-editor.ts | 4 +- src/components/map/ha-location-editor.ts | 4 +- src/components/map/ha-locations-editor.ts | 4 +- src/components/map/ha-map.ts | 4 +- .../dialog-media-player-browse.ts | 16 ++-- .../media-player/ha-media-player-browse.ts | 12 +-- src/components/state-history-charts.ts | 4 +- src/components/trace/ha-timeline.ts | 4 +- src/components/trace/hat-trace-timeline.ts | 4 +- src/components/user/ha-person-badge.ts | 4 +- src/components/user/ha-user-badge.ts | 14 +-- src/components/user/ha-user-picker.ts | 4 +- src/components/user/ha-users-picker.ts | 4 +- .../dialog-config-entry-system-options.ts | 16 ++-- .../config-flow/dialog-data-entry-flow.ts | 22 ++--- src/dialogs/config-flow/step-flow-abort.ts | 4 +- .../config-flow/step-flow-create-entry.ts | 4 +- src/dialogs/config-flow/step-flow-external.ts | 4 +- src/dialogs/config-flow/step-flow-form.ts | 4 +- src/dialogs/config-flow/step-flow-loading.ts | 4 +- .../config-flow/step-flow-pick-flow.ts | 4 +- .../config-flow/step-flow-pick-handler.ts | 8 +- src/dialogs/config-flow/step-flow-progress.ts | 4 +- .../domain-toggler/dialog-domain-toggler.ts | 8 +- src/dialogs/generic/dialog-box.ts | 10 +-- .../image-cropper-dialog.ts | 10 +-- .../controls/more-info-automation.ts | 4 +- .../more-info/controls/more-info-camera.ts | 10 +-- .../more-info/controls/more-info-climate.ts | 4 +- .../more-info/controls/more-info-counter.ts | 4 +- .../more-info/controls/more-info-group.ts | 22 ++--- .../controls/more-info-humidifier.ts | 4 +- .../more-info/controls/more-info-light.ts | 28 +++--- .../controls/more-info-media_player.ts | 4 +- .../more-info/controls/more-info-person.ts | 4 +- .../more-info/controls/more-info-remote.ts | 4 +- .../more-info/controls/more-info-script.ts | 4 +- .../more-info/controls/more-info-sun.ts | 4 +- .../more-info/controls/more-info-timer.ts | 4 +- .../more-info/controls/more-info-vacuum.ts | 4 +- .../more-info/controls/more-info-weather.ts | 4 +- src/dialogs/more-info/ha-more-info-dialog.ts | 6 +- src/dialogs/more-info/ha-more-info-history.ts | 4 +- src/dialogs/more-info/ha-more-info-logbook.ts | 8 +- src/dialogs/more-info/more-info-content.ts | 8 +- .../notification-item-template.ts | 4 +- .../persistent-notification-item.ts | 4 +- src/dialogs/quick-bar/ha-quick-bar.ts | 16 ++-- .../ha-voice-command-dialog.ts | 12 +-- src/entrypoints/custom-panel.ts | 3 +- src/layouts/ha-init-page.ts | 4 +- src/layouts/hass-error-screen.ts | 4 +- src/layouts/hass-loading-screen.ts | 4 +- src/layouts/hass-router-page.ts | 8 +- src/layouts/hass-subpage.ts | 4 +- src/layouts/hass-tabs-subpage-data-table.ts | 4 +- src/layouts/hass-tabs-subpage.ts | 8 +- src/layouts/home-assistant-main.ts | 8 +- src/layouts/home-assistant.ts | 13 +-- src/layouts/supervisor-error-screen.ts | 4 +- src/managers/notification-manager.ts | 10 +-- src/mixins/provide-hass-lit-mixin.ts | 4 +- src/mixins/subscribe-mixin.ts | 4 +- src/onboarding/action-badge.ts | 4 +- src/onboarding/ha-onboarding.ts | 10 +-- src/onboarding/integration-badge.ts | 4 +- src/onboarding/onboarding-analytics.ts | 10 +-- src/onboarding/onboarding-core-config.ts | 18 ++-- src/onboarding/onboarding-create-user.ts | 18 ++-- src/onboarding/onboarding-integrations.ts | 10 +-- src/onboarding/onboarding-loading.ts | 4 +- src/onboarding/onboarding-restore-snapshot.ts | 4 +- src/panels/calendar/ha-full-calendar.ts | 10 +-- src/panels/calendar/ha-panel-calendar.ts | 10 +-- .../areas/dialog-area-registry-detail.ts | 14 +-- .../config/areas/ha-config-area-page.ts | 44 ++++----- .../config/areas/ha-config-areas-dashboard.ts | 4 +- src/panels/config/areas/ha-config-areas.ts | 15 ++-- .../action/ha-automation-action-row.ts | 12 +-- .../automation/action/ha-automation-action.ts | 4 +- .../types/ha-automation-action-choose.ts | 4 +- .../types/ha-automation-action-device_id.ts | 12 +-- .../types/ha-automation-action-repeat.ts | 9 +- .../types/ha-automation-action-service.ts | 8 +- .../automation/blueprint-automation-editor.ts | 8 +- .../ha-automation-condition-editor.ts | 4 +- .../condition/ha-automation-condition-row.ts | 8 +- .../condition/ha-automation-condition.ts | 4 +- .../types/ha-automation-condition-device.ts | 12 +-- .../types/ha-automation-condition-time.ts | 10 +-- .../automation/dialog-new-automation.ts | 8 +- .../config/automation/ha-automation-editor.ts | 16 ++-- .../config/automation/ha-automation-picker.ts | 10 +-- .../automation/manual-automation-editor.ts | 4 +- .../automation/thingtalk/dialog-thingtalk.ts | 16 ++-- .../thingtalk/ha-thingtalk-placeholders.ts | 16 ++-- .../trace/ha-automation-trace-config.ts | 4 +- .../trace/ha-automation-trace-logbook.ts | 4 +- .../trace/ha-automation-trace-path-details.ts | 11 +-- .../trace/ha-automation-trace-timeline.ts | 4 +- .../automation/trace/ha-automation-trace.ts | 20 ++--- .../trigger/ha-automation-trigger-row.ts | 8 +- .../trigger/ha-automation-trigger.ts | 4 +- .../types/ha-automation-trigger-device.ts | 12 +-- .../types/ha-automation-trigger-tag.ts | 4 +- .../types/ha-automation-trigger-time.ts | 10 +-- .../blueprint/dialog-import-blueprint.ts | 18 ++-- .../config/blueprint/ha-blueprint-overview.ts | 4 +- .../config/cloud/account/cloud-alexa-pref.ts | 8 +- .../config/cloud/account/cloud-google-pref.ts | 4 +- .../config/cloud/account/cloud-remote-pref.ts | 4 +- .../config/cloud/account/cloud-tts-pref.ts | 10 +-- .../config/cloud/account/cloud-webhooks.ts | 12 +-- .../cloud/account/dialog-cloud-tts-try.ts | 10 +-- src/panels/config/cloud/alexa/cloud-alexa.ts | 8 +- .../dialog-cloud-certificate.ts | 4 +- .../dialog-manage-cloudhook.ts | 12 +-- .../cloud-google-assistant.ts | 8 +- src/panels/config/cloud/ha-config-cloud.ts | 6 +- src/panels/config/core/ha-config-analytics.ts | 10 +-- src/panels/config/core/ha-config-core-form.ts | 16 ++-- src/panels/config/core/ha-config-name-form.ts | 6 +- src/panels/config/core/ha-config-url-form.ts | 14 +-- .../config/customize/ha-config-customize.ts | 4 +- .../config/dashboard/ha-config-dashboard.ts | 4 +- .../config/dashboard/ha-config-navigation.ts | 4 +- .../ha-device-automation-card.ts | 4 +- .../ha-device-automation-dialog.ts | 14 +-- .../device-detail/ha-device-entities-card.ts | 4 +- .../device-detail/ha-device-info-card.ts | 4 +- .../mqtt/dialog-mqtt-device-debug-info.ts | 14 +-- .../mqtt/ha-device-actions-mqtt.ts | 4 +- .../mqtt/mqtt-discovery-payload.ts | 8 +- .../mqtt/mqtt-messages.ts | 12 +-- .../ozw/ha-device-actions-ozw.ts | 4 +- .../ozw/ha-device-info-ozw.ts | 8 +- .../tasmota/ha-device-actions-tasmota.ts | 4 +- .../zha/ha-device-actions-zha.ts | 8 +- .../zha/ha-device-info-zha.ts | 8 +- .../zwave_js/ha-device-actions-zwave_js.ts | 10 +-- .../zwave_js/ha-device-info-zwave_js.ts | 14 +-- .../dialog-device-registry-detail.ts | 18 ++-- .../config/devices/ha-config-device-page.ts | 53 +++++------ .../devices/ha-config-devices-dashboard.ts | 16 ++-- .../config/devices/ha-config-devices.ts | 15 ++-- .../config/entities/dialog-entity-editor.ts | 19 ++-- .../settings/entity-settings-helper-tab.ts | 14 +-- .../entities/entity-registry-basic-editor.ts | 14 +-- .../entities/entity-registry-settings.ts | 22 ++--- .../config/entities/ha-config-entities.ts | 30 +++---- src/panels/config/ha-entity-config.ts | 4 +- src/panels/config/ha-panel-config.ts | 13 +-- .../config/helpers/dialog-helper-detail.ts | 16 ++-- .../config/helpers/forms/ha-counter-form.ts | 20 ++--- .../helpers/forms/ha-input_boolean-form.ts | 10 +-- .../helpers/forms/ha-input_datetime-form.ts | 12 +-- .../helpers/forms/ha-input_number-form.ts | 20 ++--- .../helpers/forms/ha-input_select-form.ts | 12 +-- .../helpers/forms/ha-input_text-form.ts | 18 ++-- .../config/helpers/forms/ha-timer-form.ts | 12 +-- .../config/helpers/ha-config-helpers.ts | 18 ++-- src/panels/config/info/ha-config-info.ts | 4 +- src/panels/config/info/integrations-card.ts | 10 +-- src/panels/config/info/system-health-card.ts | 8 +- .../integrations/ha-config-integrations.ts | 22 ++--- .../integrations/ha-integration-card.ts | 4 +- .../mqtt/mqtt-config-panel.ts | 10 +-- .../mqtt/mqtt-subscribe-card.ts | 12 +-- .../ozw/dialog-ozw-refresh-node.ts | 18 ++-- .../ozw/ozw-config-dashboard.ts | 8 +- .../ozw/ozw-network-dashboard.ts | 14 +-- .../ozw/ozw-network-nodes.ts | 8 +- .../integration-panels/ozw/ozw-node-config.ts | 14 +-- .../ozw/ozw-node-dashboard.ts | 12 +-- .../zha/dialog-zha-cluster.ts | 14 +-- .../zha/dialog-zha-device-children.ts | 10 +-- .../zha/dialog-zha-device-zigbee-info.ts | 8 +- .../zha/dialog-zha-reconfigure-device.ts | 18 ++-- .../zha/zha-add-devices-page.ts | 21 ++--- .../zha/zha-add-group-page.ts | 10 +-- .../zha/zha-cluster-attributes.ts | 16 ++-- .../zha/zha-cluster-commands.ts | 16 ++-- .../integration-panels/zha/zha-clusters.ts | 10 +-- .../zha/zha-config-dashboard.ts | 4 +- .../zha/zha-device-binding.ts | 14 +-- .../integration-panels/zha/zha-device-card.ts | 8 +- .../zha/zha-device-endpoint-data-table.ts | 4 +- .../zha/zha-device-pairing-status-card.ts | 8 +- .../zha/zha-group-binding.ts | 16 ++-- .../integration-panels/zha/zha-group-page.ts | 16 ++-- .../zha/zha-groups-dashboard.ts | 4 +- .../zha/zha-network-visualization-page.ts | 16 ++-- .../zwave/zwave-migration.ts | 20 ++--- .../integration-panels/zwave/zwave-network.ts | 12 +-- .../zwave/zwave-node-config.ts | 22 ++--- .../integration-panels/zwave/zwave-values.ts | 8 +- .../zwave_js/dialog-zwave_js-add-node.ts | 14 +-- .../dialog-zwave_js-reinterview-node.ts | 10 +-- .../zwave_js/dialog-zwave_js-remove-node.ts | 12 +-- .../zwave_js/zwave_js-config-dashboard.ts | 16 ++-- .../zwave_js/zwave_js-logs.ts | 4 +- .../zwave_js/zwave_js-node-config.ts | 19 ++-- .../config/logs/dialog-system-log-detail.ts | 10 +-- src/panels/config/logs/error-log-card.ts | 8 +- src/panels/config/logs/ha-config-logs.ts | 4 +- src/panels/config/logs/system-log-card.ts | 8 +- .../dialog-lovelace-dashboard-detail.ts | 22 ++--- .../ha-config-lovelace-dashboards.ts | 4 +- .../dialog-lovelace-resource-detail.ts | 16 ++-- .../resources/ha-config-lovelace-resources.ts | 4 +- .../config/person/dialog-person-detail.ts | 26 +++--- src/panels/config/person/ha-config-person.ts | 10 +-- src/panels/config/scene/ha-scene-dashboard.ts | 10 +-- src/panels/config/scene/ha-scene-editor.ts | 36 ++++---- src/panels/config/script/ha-script-editor.ts | 18 ++-- src/panels/config/script/ha-script-picker.ts | 10 +-- .../ha-config-server-control.ts | 10 +-- src/panels/config/tags/dialog-tag-detail.ts | 18 ++-- src/panels/config/tags/ha-config-tags.ts | 6 +- src/panels/config/tags/tag-image.ts | 4 +- src/panels/config/users/dialog-add-user.ts | 24 ++--- src/panels/config/users/dialog-user-detail.ts | 18 ++-- src/panels/config/zone/dialog-zone-detail.ts | 24 ++--- src/panels/config/zone/ha-config-zone.ts | 69 +++++++------- src/panels/custom/ha-panel-custom.ts | 8 +- .../event/event-subscribe-card.ts | 12 +-- .../ha-panel-developer-tools.ts | 4 +- .../service/developer-tools-service.ts | 8 +- .../template/developer-tools-template.ts | 14 +-- src/panels/history/ha-panel-history.ts | 10 +-- src/panels/logbook/ha-logbook.ts | 4 +- src/panels/logbook/ha-panel-logbook.ts | 8 +- .../badges/hui-entity-filter-badge.ts | 15 ++-- src/panels/lovelace/badges/hui-error-badge.ts | 8 +- .../lovelace/badges/hui-state-label-badge.ts | 4 +- .../lovelace/cards/hui-alarm-panel-card.ts | 28 +++--- src/panels/lovelace/cards/hui-button-card.ts | 10 +-- .../lovelace/cards/hui-calendar-card.ts | 14 +-- .../lovelace/cards/hui-empty-state-card.ts | 4 +- .../lovelace/cards/hui-entities-card.ts | 8 +- src/panels/lovelace/cards/hui-entity-card.ts | 8 +- .../lovelace/cards/hui-entity-filter-card.ts | 15 ++-- src/panels/lovelace/cards/hui-error-card.ts | 8 +- src/panels/lovelace/cards/hui-gauge-card.ts | 14 +-- src/panels/lovelace/cards/hui-glance-card.ts | 8 +- src/panels/lovelace/cards/hui-grid-card.ts | 4 +- .../lovelace/cards/hui-history-graph-card.ts | 10 +-- .../cards/hui-horizontal-stack-card.ts | 4 +- .../lovelace/cards/hui-humidifier-card.ts | 10 +-- src/panels/lovelace/cards/hui-iframe-card.ts | 4 +- src/panels/lovelace/cards/hui-light-card.ts | 8 +- src/panels/lovelace/cards/hui-logbook-card.ts | 14 +-- src/panels/lovelace/cards/hui-map-card.ts | 4 +- .../lovelace/cards/hui-markdown-card.ts | 12 +-- .../lovelace/cards/hui-media-control-card.ts | 33 +++---- src/panels/lovelace/cards/hui-picture-card.ts | 4 +- .../cards/hui-picture-elements-card.ts | 10 +-- .../lovelace/cards/hui-picture-entity-card.ts | 14 +-- .../lovelace/cards/hui-picture-glance-card.ts | 8 +- .../lovelace/cards/hui-plant-status-card.ts | 8 +- .../lovelace/cards/hui-safe-mode-card.ts | 4 +- .../lovelace/cards/hui-shopping-list-card.ts | 16 ++-- src/panels/lovelace/cards/hui-stack-card.ts | 8 +- .../lovelace/cards/hui-starting-card.ts | 4 +- .../lovelace/cards/hui-thermostat-card.ts | 10 +-- .../lovelace/cards/hui-vertical-stack-card.ts | 4 +- .../cards/hui-weather-forecast-card.ts | 8 +- .../directives/action-handler-directive.ts | 28 ++++-- .../lovelace/components/hui-action-editor.ts | 4 +- .../lovelace/components/hui-buttons-base.ts | 4 +- .../lovelace/components/hui-card-options.ts | 4 +- .../components/hui-conditional-base.ts | 8 +- .../components/hui-entities-toggle.ts | 8 +- .../lovelace/components/hui-entity-editor.ts | 10 +-- .../components/hui-generic-entity-row.ts | 4 +- .../lovelace/components/hui-graph-base.ts | 8 +- src/panels/lovelace/components/hui-image.ts | 20 ++--- .../components/hui-input-list-editor.ts | 4 +- src/panels/lovelace/components/hui-marquee.ts | 4 +- .../components/hui-theme-select-editor.ts | 4 +- .../components/hui-timestamp-display.ts | 4 +- .../lovelace/components/hui-views-list.ts | 10 +-- .../components/hui-warning-element.ts | 4 +- src/panels/lovelace/components/hui-warning.ts | 4 +- .../editor/card-editor/hui-card-picker.ts | 14 +-- .../editor/card-editor/hui-card-preview.ts | 8 +- .../card-editor/hui-dialog-create-card.ts | 14 +-- .../card-editor/hui-dialog-delete-card.ts | 10 +-- .../card-editor/hui-dialog-edit-card.ts | 24 ++--- .../card-editor/hui-dialog-suggest-card.ts | 12 +-- .../card-editor/hui-entity-picker-table.ts | 4 +- .../hui-alarm-panel-card-editor.ts | 16 ++-- .../config-elements/hui-button-card-editor.ts | 8 +- .../hui-calendar-card-editor.ts | 8 +- .../hui-conditional-card-editor.ts | 14 +-- .../hui-entities-card-editor.ts | 12 +-- .../config-elements/hui-entity-card-editor.ts | 8 +- .../config-elements/hui-gauge-card-editor.ts | 8 +- .../hui-generic-entity-row-editor.ts | 8 +- .../config-elements/hui-glance-card-editor.ts | 10 +-- .../hui-graph-footer-editor.ts | 8 +- .../hui-history-graph-card-editor.ts | 10 +-- .../hui-humidifier-card-editor.ts | 8 +- .../config-elements/hui-iframe-card-editor.ts | 8 +- .../config-elements/hui-light-card-editor.ts | 8 +- .../hui-logbook-card-editor.ts | 10 +-- .../config-elements/hui-map-card-editor.ts | 10 +-- .../hui-markdown-card-editor.ts | 8 +- .../hui-media-control-card-editor.ts | 4 +- .../hui-picture-card-editor.ts | 8 +- .../hui-picture-entity-card-editor.ts | 8 +- .../hui-picture-glance-card-editor.ts | 10 +-- .../hui-plant-status-card-editor.ts | 8 +- .../config-elements/hui-sensor-card-editor.ts | 8 +- .../hui-shopping-list-editor.ts | 8 +- .../config-elements/hui-stack-card-editor.ts | 14 +-- .../hui-thermostat-card-editor.ts | 8 +- .../hui-weather-forecast-card-editor.ts | 8 +- .../hui-dialog-create-headerfooter.ts | 8 +- .../hui-header-footer-editor.ts | 4 +- .../lovelace/editor/hui-dialog-save-config.ts | 12 +-- .../lovelace/editor/hui-element-editor.ts | 24 ++--- .../editor/hui-entities-card-row-editor.ts | 10 +-- .../lovelace/editor/hui-sub-element-editor.ts | 10 +-- .../hui-dialog-edit-lovelace.ts | 8 +- .../lovelace-editor/hui-lovelace-editor.ts | 4 +- .../select-view/hui-dialog-select-view.ts | 14 +-- .../unused-entities/hui-unused-entities.ts | 10 +-- .../view-editor/hui-dialog-edit-view.ts | 18 ++-- .../editor/view-editor/hui-view-editor.ts | 8 +- .../view-editor/hui-view-visibility-editor.ts | 10 +-- .../lovelace/elements/hui-icon-element.ts | 8 +- .../lovelace/elements/hui-image-element.ts | 8 +- .../elements/hui-service-button-element.ts | 8 +- .../elements/hui-state-badge-element.ts | 4 +- .../elements/hui-state-icon-element.ts | 8 +- .../elements/hui-state-label-element.ts | 8 +- .../entity-rows/hui-climate-entity-row.ts | 8 +- .../entity-rows/hui-cover-entity-row.ts | 8 +- .../entity-rows/hui-group-entity-row.ts | 4 +- .../hui-input-datetime-entity-row.ts | 4 +- .../hui-input-number-entity-row.ts | 8 +- .../hui-input-select-entity-row.ts | 8 +- .../entity-rows/hui-input-text-entity-row.ts | 8 +- .../entity-rows/hui-lock-entity-row.ts | 8 +- .../hui-media-player-entity-row.ts | 35 ++++---- .../entity-rows/hui-number-entity-row.ts | 8 +- .../entity-rows/hui-scene-entity-row.ts | 8 +- .../entity-rows/hui-script-entity-row.ts | 8 +- .../entity-rows/hui-sensor-entity-row.ts | 8 +- .../entity-rows/hui-text-entity-row.ts | 8 +- .../entity-rows/hui-timer-entity-row.ts | 6 +- .../entity-rows/hui-toggle-entity-row.ts | 4 +- .../entity-rows/hui-weather-entity-row.ts | 8 +- src/panels/lovelace/ha-panel-lovelace.ts | 36 ++++---- .../hui-buttons-header-footer.ts | 4 +- .../header-footer/hui-graph-header-footer.ts | 8 +- .../hui-picture-header-footer.ts | 4 +- src/panels/lovelace/hui-editor.ts | 10 +-- src/panels/lovelace/hui-root.ts | 8 +- .../special-rows/hui-attribute-row.ts | 8 +- .../lovelace/special-rows/hui-button-row.ts | 8 +- .../lovelace/special-rows/hui-buttons-row.ts | 4 +- .../lovelace/special-rows/hui-cast-row.ts | 12 +-- .../lovelace/special-rows/hui-divider-row.ts | 8 +- .../lovelace/special-rows/hui-section-row.ts | 8 +- .../lovelace/special-rows/hui-text-row.ts | 8 +- .../lovelace/special-rows/hui-weblink-row.ts | 8 +- src/panels/lovelace/views/hui-masonry-view.ts | 8 +- src/panels/lovelace/views/hui-panel-view.ts | 11 +-- src/panels/lovelace/views/hui-view.ts | 14 +-- .../media-browser/ha-panel-media-browser.ts | 4 +- .../hui-dialog-select-media-player.ts | 4 +- .../hui-dialog-web-browser-play-media.ts | 4 +- src/panels/my/ha-panel-my.ts | 10 +-- .../dialog-ha-mfa-module-setup-flow.ts | 20 ++--- src/panels/profile/ha-advanced-mode-row.ts | 4 +- src/panels/profile/ha-change-password-card.ts | 18 ++-- .../ha-long-lived-access-tokens-card.ts | 4 +- src/panels/profile/ha-mfa-modules-card.ts | 4 +- src/panels/profile/ha-panel-profile.ts | 10 +-- src/panels/profile/ha-pick-dashboard-row.ts | 4 +- src/panels/profile/ha-pick-theme-row.ts | 10 +-- src/panels/profile/ha-refresh-tokens-card.ts | 4 +- .../shopping-list/ha-panel-shopping-list.ts | 8 +- src/state-summary/state-card-display.ts | 4 +- src/state-summary/state-card-input_select.ts | 4 +- src/state-summary/state-card-script.ts | 6 +- src/state/quick-bar-mixin.ts | 4 +- src/state/url-sync-mixin.ts | 4 +- src/styles/polymer-ha-style-dialog.ts | 3 +- src/styles/polymer-ha-style.ts | 3 +- yarn.lock | 16 ++-- 521 files changed, 2512 insertions(+), 2510 deletions(-) diff --git a/cast/src/launcher/layout/hc-cast.ts b/cast/src/launcher/layout/hc-cast.ts index c91e38f2af..fdb2b64432 100644 --- a/cast/src/launcher/layout/hc-cast.ts +++ b/cast/src/launcher/layout/hc-cast.ts @@ -3,12 +3,12 @@ import "@polymer/paper-listbox/paper-listbox"; import { Auth, Connection } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, property, - internalProperty, + state, TemplateResult, } from "lit-element"; import { CastManager } from "../../../../src/cast/cast_manager"; @@ -42,9 +42,9 @@ class HcCast extends LitElement { @property() public castManager!: CastManager; - @internalProperty() private askWrite = false; + @state() private askWrite = false; - @internalProperty() private lovelaceConfig?: LovelaceConfig | null; + @state() private lovelaceConfig?: LovelaceConfig | null; protected render(): TemplateResult { if (this.lovelaceConfig === undefined) { @@ -204,7 +204,7 @@ class HcCast extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .center-item { display: flex; diff --git a/cast/src/launcher/layout/hc-connect.ts b/cast/src/launcher/layout/hc-connect.ts index 518c582f2c..c546e5bef5 100644 --- a/cast/src/launcher/layout/hc-connect.ts +++ b/cast/src/launcher/layout/hc-connect.ts @@ -13,12 +13,12 @@ import { } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, TemplateResult, - internalProperty, + state, } from "lit-element"; import { CastManager, getCastManager } from "../../../../src/cast/cast_manager"; import { castSendShowDemo } from "../../../../src/cast/receiver_messages"; @@ -60,19 +60,19 @@ const INTRO = html` @customElement("hc-connect") export class HcConnect extends LitElement { - @internalProperty() private loading = false; + @state() private loading = false; // If we had stored credentials but we cannot connect, // show a screen asking retry or logout. - @internalProperty() private cannotConnect = false; + @state() private cannotConnect = false; - @internalProperty() private error?: string | TemplateResult; + @state() private error?: string | TemplateResult; - @internalProperty() private auth?: Auth; + @state() private auth?: Auth; - @internalProperty() private connection?: Connection; + @state() private connection?: Connection; - @internalProperty() private castManager?: CastManager | null; + @state() private castManager?: CastManager | null; private openDemo = false; @@ -297,7 +297,7 @@ export class HcConnect extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .card-content a { color: var(--primary-color); diff --git a/cast/src/launcher/layout/hc-layout.ts b/cast/src/launcher/layout/hc-layout.ts index 76a3af25ef..a505d926a2 100644 --- a/cast/src/launcher/layout/hc-layout.ts +++ b/cast/src/launcher/layout/hc-layout.ts @@ -6,7 +6,7 @@ import { } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -69,7 +69,7 @@ class HcLayout extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/cast/src/receiver/layout/hc-demo.ts b/cast/src/receiver/layout/hc-demo.ts index b4ddc41a67..1929812157 100644 --- a/cast/src/receiver/layout/hc-demo.ts +++ b/cast/src/receiver/layout/hc-demo.ts @@ -1,7 +1,7 @@ import { customElement, html, - internalProperty, + state, property, TemplateResult, } from "lit-element"; @@ -21,7 +21,7 @@ import "./hc-lovelace"; class HcDemo extends HassElement { @property({ attribute: false }) public lovelacePath!: string; - @internalProperty() private _lovelaceConfig?: LovelaceConfig; + @state() private _lovelaceConfig?: LovelaceConfig; protected render(): TemplateResult { if (!this._lovelaceConfig) { diff --git a/cast/src/receiver/layout/hc-launch-screen.ts b/cast/src/receiver/layout/hc-launch-screen.ts index 603f70f655..53fe4476c2 100644 --- a/cast/src/receiver/layout/hc-launch-screen.ts +++ b/cast/src/receiver/layout/hc-launch-screen.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -29,7 +29,7 @@ class HcLaunchScreen extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/cast/src/receiver/layout/hc-lovelace.ts b/cast/src/receiver/layout/hc-lovelace.ts index ba94b42394..3115b474c6 100644 --- a/cast/src/receiver/layout/hc-lovelace.ts +++ b/cast/src/receiver/layout/hc-lovelace.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -91,7 +91,7 @@ class HcLovelace extends LitElement { return undefined; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { min-height: 100vh; diff --git a/cast/src/receiver/layout/hc-main.ts b/cast/src/receiver/layout/hc-main.ts index e8623dfa65..567d4de8b5 100644 --- a/cast/src/receiver/layout/hc-main.ts +++ b/cast/src/receiver/layout/hc-main.ts @@ -3,12 +3,7 @@ import { getAuth, UnsubscribeFunc, } from "home-assistant-js-websocket"; -import { - customElement, - html, - internalProperty, - TemplateResult, -} from "lit-element"; +import { customElement, html, state, TemplateResult } from "lit-element"; import { CAST_NS } from "../../../../src/cast/const"; import { ConnectMessage, @@ -36,13 +31,13 @@ let resourcesLoaded = false; @customElement("hc-main") export class HcMain extends HassElement { - @internalProperty() private _showDemo = false; + @state() private _showDemo = false; - @internalProperty() private _lovelaceConfig?: LovelaceConfig; + @state() private _lovelaceConfig?: LovelaceConfig; - @internalProperty() private _lovelacePath: string | number | null = null; + @state() private _lovelacePath: string | number | null = null; - @internalProperty() private _error?: string; + @state() private _error?: string; private _unsubLovelace?: UnsubscribeFunc; diff --git a/demo/src/custom-cards/cast-demo-row.ts b/demo/src/custom-cards/cast-demo-row.ts index ea0f3033a3..01f804a8af 100644 --- a/demo/src/custom-cards/cast-demo-row.ts +++ b/demo/src/custom-cards/cast-demo-row.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -20,7 +20,7 @@ import { HomeAssistant } from "../../../src/types"; class CastDemoRow extends LitElement implements LovelaceRow { public hass!: HomeAssistant; - @internalProperty() private _castManager?: CastManager | null; + @state() private _castManager?: CastManager | null; public setConfig(_config: CastConfig): void { // No config possible. @@ -73,7 +73,7 @@ class CastDemoRow extends LitElement implements LovelaceRow { this.style.display = this._castManager ? "" : "none"; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/demo/src/custom-cards/ha-demo-card.ts b/demo/src/custom-cards/ha-demo-card.ts index 8da813d7bd..0bb27206ca 100644 --- a/demo/src/custom-cards/ha-demo-card.ts +++ b/demo/src/custom-cards/ha-demo-card.ts @@ -1,9 +1,9 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -26,7 +26,7 @@ export class HADemoCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass!: MockHomeAssistant; - @internalProperty() private _switching?: boolean; + @state() private _switching?: boolean; private _hidden = localStorage.hide_demo_card; @@ -113,7 +113,7 @@ export class HADemoCard extends LitElement implements LovelaceCard { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ css` a { diff --git a/gallery/src/demos/demo-automation-trace.ts b/gallery/src/demos/demo-automation-trace.ts index 8187c01630..e6c0fe624a 100644 --- a/gallery/src/demos/demo-automation-trace.ts +++ b/gallery/src/demos/demo-automation-trace.ts @@ -4,7 +4,7 @@ import { css, LitElement, TemplateResult, - internalProperty, + state, property, } from "lit-element"; import "../../../src/components/ha-card"; @@ -22,7 +22,7 @@ const traces: DemoTrace[] = [basicTrace, motionLightTrace]; export class DemoAutomationTrace extends LitElement { @property({ attribute: false }) hass?: HomeAssistant; - @internalProperty() private _selected = {}; + @state() private _selected = {}; protected render(): TemplateResult { if (!this.hass) { diff --git a/gallery/src/demos/demo-integration-card.ts b/gallery/src/demos/demo-integration-card.ts index 7fb8607930..8cb51ddd2b 100644 --- a/gallery/src/demos/demo-integration-card.ts +++ b/gallery/src/demos/demo-integration-card.ts @@ -2,7 +2,7 @@ import { customElement, html, css, - internalProperty, + state, LitElement, TemplateResult, property, @@ -220,9 +220,9 @@ const createDeviceRegistryEntries = ( export class DemoIntegrationCard extends LitElement { @property({ attribute: false }) hass?: HomeAssistant; - @internalProperty() isCustomIntegration = false; + @state() isCustomIntegration = false; - @internalProperty() isCloud = false; + @state() isCloud = false; protected render(): TemplateResult { if (!this.hass) { diff --git a/hassio/src/addon-store/hassio-addon-repository.ts b/hassio/src/addon-store/hassio-addon-repository.ts index 4e33f15e8b..4462d03854 100644 --- a/hassio/src/addon-store/hassio-addon-repository.ts +++ b/hassio/src/addon-store/hassio-addon-repository.ts @@ -1,7 +1,7 @@ import { mdiArrowUpBoldCircle, mdiPuzzle } from "@mdi/js"; import { css, - CSSResultArray, + CSSResultGroup, html, LitElement, property, @@ -129,7 +129,7 @@ class HassioAddonRepositoryEl extends LitElement { navigate(this, `/hassio/addon/${ev.currentTarget.addon.slug}`); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ hassioStyle, css` diff --git a/hassio/src/addon-store/hassio-addon-store.ts b/hassio/src/addon-store/hassio-addon-store.ts index fd41a504db..21e67c7d24 100644 --- a/hassio/src/addon-store/hassio-addon-store.ts +++ b/hassio/src/addon-store/hassio-addon-store.ts @@ -4,8 +4,8 @@ import "@material/mwc-list/mwc-list-item"; import { mdiDotsVertical } from "@mdi/js"; import { css, - CSSResult, - internalProperty, + CSSResultGroup, + state, LitElement, property, PropertyValues, @@ -58,7 +58,7 @@ class HassioAddonStore extends LitElement { @property({ attribute: false }) public route!: Route; - @internalProperty() private _filter?: string; + @state() private _filter?: string; public async refreshData() { await reloadHassioAddons(this.hass); @@ -218,7 +218,7 @@ class HassioAddonStore extends LitElement { this._filter = e.detail.value; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` hassio-addon-repository { margin-top: 24px; diff --git a/hassio/src/addon-view/config/hassio-addon-audio.ts b/hassio/src/addon-view/config/hassio-addon-audio.ts index 79275a39cf..a3e4121418 100644 --- a/hassio/src/addon-view/config/hassio-addon-audio.ts +++ b/hassio/src/addon-view/config/hassio-addon-audio.ts @@ -4,10 +4,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -39,15 +39,15 @@ class HassioAddonAudio extends LitElement { @property({ attribute: false }) public addon!: HassioAddonDetails; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _inputDevices?: HassioHardwareAudioDevice[]; + @state() private _inputDevices?: HassioHardwareAudioDevice[]; - @internalProperty() private _outputDevices?: HassioHardwareAudioDevice[]; + @state() private _outputDevices?: HassioHardwareAudioDevice[]; - @internalProperty() private _selectedInput!: null | string; + @state() private _selectedInput!: null | string; - @internalProperty() private _selectedOutput!: null | string; + @state() private _selectedOutput!: null | string; protected render(): TemplateResult { return html` @@ -109,7 +109,7 @@ class HassioAddonAudio extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/addon-view/config/hassio-addon-config-tab.ts b/hassio/src/addon-view/config/hassio-addon-config-tab.ts index b9a5907075..ab57e72d6a 100644 --- a/hassio/src/addon-view/config/hassio-addon-config-tab.ts +++ b/hassio/src/addon-view/config/hassio-addon-config-tab.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -70,7 +70,7 @@ class HassioAddonConfigDashboard extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/addon-view/config/hassio-addon-config.ts b/hassio/src/addon-view/config/hassio-addon-config.ts index 9bbc6ac782..936c5d7651 100644 --- a/hassio/src/addon-view/config/hassio-addon-config.ts +++ b/hassio/src/addon-view/config/hassio-addon-config.ts @@ -5,10 +5,10 @@ import { mdiDotsVertical } from "@mdi/js"; import "@polymer/iron-autogrow-textarea/iron-autogrow-textarea"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -53,15 +53,15 @@ class HassioAddonConfig extends LitElement { @property({ type: Boolean }) private _valid = true; - @internalProperty() private _canShowSchema = false; + @state() private _canShowSchema = false; - @internalProperty() private _showOptional = false; + @state() private _showOptional = false; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _options?: Record; + @state() private _options?: Record; - @internalProperty() private _yamlMode = false; + @state() private _yamlMode = false; @query("ha-yaml-editor") private _editor?: HaYamlEditor; @@ -292,7 +292,7 @@ class HassioAddonConfig extends LitElement { fireEvent(this, "hass-api-called", eventdata); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/addon-view/config/hassio-addon-network.ts b/hassio/src/addon-view/config/hassio-addon-network.ts index 256f81175f..6a96a88741 100644 --- a/hassio/src/addon-view/config/hassio-addon-network.ts +++ b/hassio/src/addon-view/config/hassio-addon-network.ts @@ -1,10 +1,10 @@ import { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -43,9 +43,9 @@ class HassioAddonNetwork extends LitElement { @property({ attribute: false }) public addon!: HassioAddonDetails; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _config?: NetworkItem[]; + @state() private _config?: NetworkItem[]; public connectedCallback(): void { super.connectedCallback(); @@ -216,7 +216,7 @@ class HassioAddonNetwork extends LitElement { button.progress = false; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts b/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts index 0cb15c1842..3ae8b65427 100644 --- a/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts +++ b/hassio/src/addon-view/documentation/hassio-addon-documentation-tab.ts @@ -1,10 +1,10 @@ import "../../../../src/components/ha-card"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -30,9 +30,9 @@ class HassioAddonDocumentationDashboard extends LitElement { @property({ attribute: false }) public addon?: HassioAddonDetails; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _content?: string; + @state() private _content?: string; public async connectedCallback(): Promise { super.connectedCallback(); @@ -57,7 +57,7 @@ class HassioAddonDocumentationDashboard extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/addon-view/hassio-addon-dashboard.ts b/hassio/src/addon-view/hassio-addon-dashboard.ts index 5113aa3bdb..52f5859f14 100644 --- a/hassio/src/addon-view/hassio-addon-dashboard.ts +++ b/hassio/src/addon-view/hassio-addon-dashboard.ts @@ -6,10 +6,10 @@ import { } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -52,7 +52,7 @@ class HassioAddonDashboard extends LitElement { @property({ type: Boolean }) public narrow!: boolean; - @internalProperty() _error?: string; + @state() _error?: string; private _computeTail = memoizeOne((route: Route) => { const dividerPos = route.path.indexOf("/", 1); @@ -133,7 +133,7 @@ class HassioAddonDashboard extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/addon-view/info/hassio-addon-info-tab.ts b/hassio/src/addon-view/info/hassio-addon-info-tab.ts index dffd2a8b66..a46becbd75 100644 --- a/hassio/src/addon-view/info/hassio-addon-info-tab.ts +++ b/hassio/src/addon-view/info/hassio-addon-info-tab.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -42,7 +42,7 @@ class HassioAddonInfoDashboard extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/addon-view/info/hassio-addon-info.ts b/hassio/src/addon-view/info/hassio-addon-info.ts index 20af66c7ce..0a3e0fd691 100644 --- a/hassio/src/addon-view/info/hassio-addon-info.ts +++ b/hassio/src/addon-view/info/hassio-addon-info.ts @@ -16,10 +16,10 @@ import { } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -90,9 +90,9 @@ class HassioAddonInfo extends LitElement { @property({ attribute: false }) public supervisor!: Supervisor; - @internalProperty() private _metrics?: HassioStats; + @state() private _metrics?: HassioStats; - @internalProperty() private _error?: string; + @state() private _error?: string; private _addonStoreInfo = memoizeOne( (slug: string, storeAddons: StoreAddon[]) => @@ -1098,7 +1098,7 @@ class HassioAddonInfo extends LitElement { button.progress = false; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/addon-view/log/hassio-addon-log-tab.ts b/hassio/src/addon-view/log/hassio-addon-log-tab.ts index 7b93e38a5b..d9d4cff07d 100644 --- a/hassio/src/addon-view/log/hassio-addon-log-tab.ts +++ b/hassio/src/addon-view/log/hassio-addon-log-tab.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -38,7 +38,7 @@ class HassioAddonLogDashboard extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/addon-view/log/hassio-addon-logs.ts b/hassio/src/addon-view/log/hassio-addon-logs.ts index c380c0b92e..3d2034f1ac 100644 --- a/hassio/src/addon-view/log/hassio-addon-logs.ts +++ b/hassio/src/addon-view/log/hassio-addon-logs.ts @@ -1,10 +1,10 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -29,9 +29,9 @@ class HassioAddonLogs extends LitElement { @property({ attribute: false }) public addon!: HassioAddonDetails; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _content?: string; + @state() private _content?: string; public async connectedCallback(): Promise { super.connectedCallback(); @@ -59,7 +59,7 @@ class HassioAddonLogs extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/components/hassio-ansi-to-html.ts b/hassio/src/components/hassio-ansi-to-html.ts index b957b172b4..e31b4dba05 100644 --- a/hassio/src/components/hassio-ansi-to-html.ts +++ b/hassio/src/components/hassio-ansi-to-html.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -25,7 +25,7 @@ class HassioAnsiToHtml extends LitElement { return html`${this._parseTextToColoredPre(this.content)}`; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` pre { overflow-x: auto; diff --git a/hassio/src/components/hassio-card-content.ts b/hassio/src/components/hassio-card-content.ts index 03884e6b94..383388bde9 100644 --- a/hassio/src/components/hassio-card-content.ts +++ b/hassio/src/components/hassio-card-content.ts @@ -1,7 +1,7 @@ import { mdiHelpCircle } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -77,7 +77,7 @@ class HassioCardContent extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-svg-icon { margin-right: 24px; diff --git a/hassio/src/components/hassio-upload-snapshot.ts b/hassio/src/components/hassio-upload-snapshot.ts index 834281d911..5f16b62f8e 100644 --- a/hassio/src/components/hassio-upload-snapshot.ts +++ b/hassio/src/components/hassio-upload-snapshot.ts @@ -5,7 +5,7 @@ import "@polymer/paper-input/paper-input-container"; import { customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -33,9 +33,9 @@ const MAX_FILE_SIZE = 1 * 1024 * 1024 * 1024; // 1GB export class HassioUploadSnapshot extends LitElement { public hass!: HomeAssistant; - @internalProperty() public value: string | null = null; + @state() public value: string | null = null; - @internalProperty() private _uploading = false; + @state() private _uploading = false; public render(): TemplateResult { return html` diff --git a/hassio/src/components/supervisor-metric.ts b/hassio/src/components/supervisor-metric.ts index bf6246876c..3030c9cf65 100644 --- a/hassio/src/components/supervisor-metric.ts +++ b/hassio/src/components/supervisor-metric.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -37,7 +37,7 @@ class SupervisorMetric extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-settings-row { padding: 0; diff --git a/hassio/src/dashboard/hassio-addons.ts b/hassio/src/dashboard/hassio-addons.ts index 3a578581ab..aa5393313c 100644 --- a/hassio/src/dashboard/hassio-addons.ts +++ b/hassio/src/dashboard/hassio-addons.ts @@ -1,7 +1,7 @@ import { mdiArrowUpBoldCircle, mdiPuzzle } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -90,7 +90,7 @@ class HassioAddons extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/dashboard/hassio-dashboard.ts b/hassio/src/dashboard/hassio-dashboard.ts index 1a4c373eda..9c27910641 100644 --- a/hassio/src/dashboard/hassio-dashboard.ts +++ b/hassio/src/dashboard/hassio-dashboard.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -53,7 +53,7 @@ class HassioDashboard extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/hassio/src/dashboard/hassio-update.ts b/hassio/src/dashboard/hassio-update.ts index 1a11ee99e4..9a4f7487a8 100644 --- a/hassio/src/dashboard/hassio-update.ts +++ b/hassio/src/dashboard/hassio-update.ts @@ -2,7 +2,7 @@ import "@material/mwc-button"; import { mdiHomeAssistant } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -233,7 +233,7 @@ export class HassioUpdate extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts b/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts index 95177a18f5..1f6db1677f 100644 --- a/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts +++ b/hassio/src/dialogs/markdown/dialog-hassio-markdown.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -23,7 +23,7 @@ class HassioMarkdownDialog extends LitElement { @property() public content!: string; - @internalProperty() private _opened = false; + @state() private _opened = false; public showDialog(params: HassioMarkdownDialogParams) { this.title = params.title; @@ -50,7 +50,7 @@ class HassioMarkdownDialog extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, hassioStyle, diff --git a/hassio/src/dialogs/network/dialog-hassio-network.ts b/hassio/src/dialogs/network/dialog-hassio-network.ts index 04f2710465..91d08c8d57 100644 --- a/hassio/src/dialogs/network/dialog-hassio-network.ts +++ b/hassio/src/dialogs/network/dialog-hassio-network.ts @@ -8,10 +8,10 @@ import { mdiClose } from "@mdi/js"; import { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -54,23 +54,23 @@ export class DialogHassioNetwork @property({ attribute: false }) public supervisor!: Supervisor; - @internalProperty() private _accessPoints?: AccessPoints; + @state() private _accessPoints?: AccessPoints; - @internalProperty() private _curTabIndex = 0; + @state() private _curTabIndex = 0; - @internalProperty() private _dirty = false; + @state() private _dirty = false; - @internalProperty() private _interface?: NetworkInterface; + @state() private _interface?: NetworkInterface; - @internalProperty() private _interfaces!: NetworkInterface[]; + @state() private _interfaces!: NetworkInterface[]; - @internalProperty() private _params?: HassioNetworkDialogParams; + @state() private _params?: HassioNetworkDialogParams; - @internalProperty() private _processing = false; + @state() private _processing = false; - @internalProperty() private _scanning = false; + @state() private _scanning = false; - @internalProperty() private _wifiConfiguration?: WifiConfiguration; + @state() private _wifiConfiguration?: WifiConfiguration; public async showDialog(params: HassioNetworkDialogParams): Promise { this._params = params; @@ -543,7 +543,7 @@ export class DialogHassioNetwork this._wifiConfiguration![id] = value; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/hassio/src/dialogs/registries/dialog-hassio-registries.ts b/hassio/src/dialogs/registries/dialog-hassio-registries.ts index 4b77b41436..7f02cb769b 100644 --- a/hassio/src/dialogs/registries/dialog-hassio-registries.ts +++ b/hassio/src/dialogs/registries/dialog-hassio-registries.ts @@ -5,10 +5,10 @@ import { mdiDelete } from "@mdi/js"; import { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -39,15 +39,15 @@ class HassioRegistriesDialog extends LitElement { username: string; }[]; - @internalProperty() private _registry?: string; + @state() private _registry?: string; - @internalProperty() private _username?: string; + @state() private _username?: string; - @internalProperty() private _password?: string; + @state() private _password?: string; - @internalProperty() private _opened = false; + @state() private _opened = false; - @internalProperty() private _addingRegistry = false; + @state() private _addingRegistry = false; protected render(): TemplateResult { return html` @@ -220,7 +220,7 @@ class HassioRegistriesDialog extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, haStyleDialog, diff --git a/hassio/src/dialogs/repositories/dialog-hassio-repositories.ts b/hassio/src/dialogs/repositories/dialog-hassio-repositories.ts index 0c91f31055..d776b83d27 100644 --- a/hassio/src/dialogs/repositories/dialog-hassio-repositories.ts +++ b/hassio/src/dialogs/repositories/dialog-hassio-repositories.ts @@ -7,10 +7,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -37,15 +37,15 @@ class HassioRepositoriesDialog extends LitElement { @query("#repository_input", true) private _optionInput?: PaperInputElement; - @internalProperty() private _repositories?: HassioAddonRepository[]; + @state() private _repositories?: HassioAddonRepository[]; - @internalProperty() private _dialogParams?: HassioRepositoryDialogParams; + @state() private _dialogParams?: HassioRepositoryDialogParams; - @internalProperty() private _opened = false; + @state() private _opened = false; - @internalProperty() private _processing = false; + @state() private _processing = false; - @internalProperty() private _error?: string; + @state() private _error?: string; public async showDialog( dialogParams: HassioRepositoryDialogParams @@ -137,7 +137,7 @@ class HassioRepositoriesDialog extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, haStyleDialog, diff --git a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot-upload.ts b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot-upload.ts index d4948bd553..b87b4c7031 100644 --- a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot-upload.ts +++ b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot-upload.ts @@ -1,10 +1,10 @@ import { mdiClose } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -23,7 +23,7 @@ export class DialogHassioSnapshotUpload implements HassDialog { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _params?: HassioSnapshotUploadDialogParams; + @state() private _params?: HassioSnapshotUploadDialogParams; public async showDialog( params: HassioSnapshotUploadDialogParams @@ -78,7 +78,7 @@ export class DialogHassioSnapshotUpload this.closeDialog(); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts index b44c9eb6c3..c4e13a02d8 100755 --- a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts +++ b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts @@ -5,10 +5,10 @@ import type { PaperCheckboxElement } from "@polymer/paper-checkbox/paper-checkbo import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -80,21 +80,21 @@ class HassioSnapshotDialog extends LitElement { @property({ attribute: false }) public supervisor?: Supervisor; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _onboarding = false; + @state() private _onboarding = false; - @internalProperty() private _snapshot?: HassioSnapshotDetail; + @state() private _snapshot?: HassioSnapshotDetail; - @internalProperty() private _folders!: FolderItem[]; + @state() private _folders!: FolderItem[]; - @internalProperty() private _addons!: AddonItem[]; + @state() private _addons!: AddonItem[]; - @internalProperty() private _dialogParams?: HassioSnapshotDialogParams; + @state() private _dialogParams?: HassioSnapshotDialogParams; - @internalProperty() private _snapshotPassword!: string; + @state() private _snapshotPassword!: string; - @internalProperty() private _restoreHass = true; + @state() private _restoreHass = true; public async showDialog(params: HassioSnapshotDialogParams) { this._snapshot = await fetchHassioSnapshotInfo(this.hass, params.slug); @@ -235,7 +235,7 @@ class HassioSnapshotDialog extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, haStyleDialog, diff --git a/hassio/src/dialogs/update/dialog-supervisor-update.ts b/hassio/src/dialogs/update/dialog-supervisor-update.ts index 47f509331d..e8cb3fb67e 100644 --- a/hassio/src/dialogs/update/dialog-supervisor-update.ts +++ b/hassio/src/dialogs/update/dialog-supervisor-update.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -27,15 +27,15 @@ import { SupervisorDialogSupervisorUpdateParams } from "./show-dialog-update"; class DialogSupervisorUpdate extends LitElement { public hass!: HomeAssistant; - @internalProperty() private _opened = false; + @state() private _opened = false; - @internalProperty() private _createSnapshot = true; + @state() private _createSnapshot = true; - @internalProperty() private _action: "snapshot" | "update" | null = null; + @state() private _action: "snapshot" | "update" | null = null; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() + @state() private _dialogParams?: SupervisorDialogSupervisorUpdateParams; public async showDialog( @@ -173,7 +173,7 @@ class DialogSupervisorUpdate extends LitElement { this.closeDialog(); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, haStyleDialog, diff --git a/hassio/src/hassio-my-redirect.ts b/hassio/src/hassio-my-redirect.ts index ff9a40b399..0e73adc529 100644 --- a/hassio/src/hassio-my-redirect.ts +++ b/hassio/src/hassio-my-redirect.ts @@ -1,7 +1,7 @@ import { customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -59,7 +59,7 @@ class HassioMyRedirect extends LitElement { @property({ attribute: false }) public route!: Route; - @internalProperty() public _error?: TemplateResult | string; + @state() public _error?: TemplateResult | string; connectedCallback() { super.connectedCallback(); diff --git a/hassio/src/hassio-panel.ts b/hassio/src/hassio-panel.ts index c52339821e..a52de0a6eb 100644 --- a/hassio/src/hassio-panel.ts +++ b/hassio/src/hassio-panel.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -46,7 +46,7 @@ class HassioPanel extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { --app-header-background-color: var(--sidebar-background-color); diff --git a/hassio/src/ingress-view/hassio-ingress-view.ts b/hassio/src/ingress-view/hassio-ingress-view.ts index 531673ac2f..bbdde5c053 100644 --- a/hassio/src/ingress-view/hassio-ingress-view.ts +++ b/hassio/src/ingress-view/hassio-ingress-view.ts @@ -1,10 +1,10 @@ import { mdiMenu } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -33,7 +33,7 @@ class HassioIngressView extends LitElement { @property() public ingressPanel = false; - @internalProperty() private _addon?: HassioAddonDetails; + @state() private _addon?: HassioAddonDetails; @property({ type: Boolean }) public narrow = false; @@ -162,7 +162,7 @@ class HassioIngressView extends LitElement { fireEvent(this, "hass-toggle-menu"); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` iframe { display: block; diff --git a/hassio/src/snapshots/hassio-snapshots.ts b/hassio/src/snapshots/hassio-snapshots.ts index cf44e561b4..c01310191f 100644 --- a/hassio/src/snapshots/hassio-snapshots.ts +++ b/hassio/src/snapshots/hassio-snapshots.ts @@ -16,10 +16,10 @@ import "@polymer/paper-radio-group/paper-radio-group"; import type { PaperRadioGroupElement } from "@polymer/paper-radio-group/paper-radio-group"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -69,19 +69,19 @@ class HassioSnapshots extends LitElement { @property({ attribute: false }) public supervisor!: Supervisor; - @internalProperty() private _snapshotName = ""; + @state() private _snapshotName = ""; - @internalProperty() private _snapshotPassword = ""; + @state() private _snapshotPassword = ""; - @internalProperty() private _snapshotHasPassword = false; + @state() private _snapshotHasPassword = false; - @internalProperty() private _snapshotType: HassioSnapshot["type"] = "full"; + @state() private _snapshotType: HassioSnapshot["type"] = "full"; - @internalProperty() private _snapshots?: HassioSnapshot[] = []; + @state() private _snapshots?: HassioSnapshot[] = []; - @internalProperty() private _addonList: CheckboxItem[] = []; + @state() private _addonList: CheckboxItem[] = []; - @internalProperty() private _folderList: CheckboxItem[] = [ + @state() private _folderList: CheckboxItem[] = [ { slug: "homeassistant", checked: true, @@ -92,7 +92,7 @@ class HassioSnapshots extends LitElement { { slug: "addons/local", checked: true }, ]; - @internalProperty() private _error = ""; + @state() private _error = ""; public async refreshData() { await reloadHassioSnapshots(this.hass); @@ -428,7 +428,7 @@ class HassioSnapshots extends LitElement { }); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/supervisor-base-element.ts b/hassio/src/supervisor-base-element.ts index 2043a8a2ae..a763d16d2b 100644 --- a/hassio/src/supervisor-base-element.ts +++ b/hassio/src/supervisor-base-element.ts @@ -1,10 +1,5 @@ import { Collection, UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - internalProperty, - LitElement, - property, - PropertyValues, -} from "lit-element"; +import { state, LitElement, property, PropertyValues } from "lit-element"; import { atLeastVersion } from "../../src/common/config/version"; import { computeLocalize } from "../../src/common/translations/localize"; import { fetchHassioAddonsInfo } from "../../src/data/hassio/addon"; @@ -46,14 +41,11 @@ export class SupervisorBaseElement extends urlSyncMixin( localize: () => "", }; - @internalProperty() private _unsubs: Record = {}; + @state() private _unsubs: Record = {}; - @internalProperty() private _collections: Record< - string, - Collection - > = {}; + @state() private _collections: Record> = {}; - @internalProperty() private _language = "en"; + @state() private _language = "en"; public connectedCallback(): void { super.connectedCallback(); diff --git a/hassio/src/system/hassio-core-info.ts b/hassio/src/system/hassio-core-info.ts index bdb156fe20..4ee474ff08 100644 --- a/hassio/src/system/hassio-core-info.ts +++ b/hassio/src/system/hassio-core-info.ts @@ -2,10 +2,10 @@ import "@material/mwc-button"; import "@material/mwc-list/mwc-list-item"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -39,7 +39,7 @@ class HassioCoreInfo extends LitElement { @property({ attribute: false }) public supervisor!: Supervisor; - @internalProperty() private _metrics?: HassioStats; + @state() private _metrics?: HassioStats; protected render(): TemplateResult | void { const metrics = [ @@ -189,7 +189,7 @@ class HassioCoreInfo extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/system/hassio-host-info.ts b/hassio/src/system/hassio-host-info.ts index db5e4e2f7e..be5b6910e1 100644 --- a/hassio/src/system/hassio-host-info.ts +++ b/hassio/src/system/hassio-host-info.ts @@ -5,7 +5,7 @@ import { mdiDotsVertical } from "@mdi/js"; import { safeDump } from "js-yaml"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -415,7 +415,7 @@ class HassioHostInfo extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/system/hassio-supervisor-info.ts b/hassio/src/system/hassio-supervisor-info.ts index db60abcdc5..dfe04b3a92 100644 --- a/hassio/src/system/hassio-supervisor-info.ts +++ b/hassio/src/system/hassio-supervisor-info.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -67,7 +67,7 @@ class HassioSupervisorInfo extends LitElement { @property({ attribute: false }) public supervisor!: Supervisor; - @internalProperty() private _metrics?: HassioStats; + @state() private _metrics?: HassioStats; protected render(): TemplateResult | void { const metrics = [ @@ -504,7 +504,7 @@ class HassioSupervisorInfo extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/system/hassio-supervisor-log.ts b/hassio/src/system/hassio-supervisor-log.ts index 29ce5a242a..8a78153feb 100644 --- a/hassio/src/system/hassio-supervisor-log.ts +++ b/hassio/src/system/hassio-supervisor-log.ts @@ -4,10 +4,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -61,11 +61,11 @@ class HassioSupervisorLog extends LitElement { @property({ attribute: false }) public supervisor!: Supervisor; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _selectedLogProvider = "supervisor"; + @state() private _selectedLogProvider = "supervisor"; - @internalProperty() private _content?: string; + @state() private _content?: string; public async connectedCallback(): Promise { super.connectedCallback(); @@ -146,7 +146,7 @@ class HassioSupervisorLog extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/hassio/src/system/hassio-system.ts b/hassio/src/system/hassio-system.ts index 5c02662932..e7b1d74b0b 100644 --- a/hassio/src/system/hassio-system.ts +++ b/hassio/src/system/hassio-system.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -64,7 +64,7 @@ class HassioSystem extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, hassioStyle, diff --git a/package.json b/package.json index e320fc9ff2..2002de0926 100644 --- a/package.json +++ b/package.json @@ -115,8 +115,8 @@ "js-yaml": "^3.13.1", "leaflet": "^1.7.1", "leaflet-draw": "^1.0.4", - "lit-element": "^2.5.0", - "lit-html": "^1.4.0", + "lit-element": "2.5.1", + "lit-html": "1.4.1", "lit-virtualizer": "^0.4.2", "marked": "2.0.0", "mdn-polyfills": "^5.16.0", @@ -241,8 +241,8 @@ "resolutions": { "@webcomponents/webcomponentsjs": "^2.2.10", "@polymer/polymer": "3.1.0", - "lit-html": "1.4.0", - "lit-element": "2.5.0" + "lit-html": "1.4.1", + "lit-element": "2.5.1" }, "main": "src/home-assistant.js", "husky": { diff --git a/src/auth/ha-auth-flow.ts b/src/auth/ha-auth-flow.ts index 3164b6dafb..0602edab15 100644 --- a/src/auth/ha-auth-flow.ts +++ b/src/auth/ha-auth-flow.ts @@ -1,9 +1,9 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -29,13 +29,13 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) { @property() public oauth2State?: string; - @internalProperty() private _state: State = "loading"; + @state() private _state: State = "loading"; - @internalProperty() private _stepData: any = {}; + @state() private _stepData: any = {}; - @internalProperty() private _step?: DataEntryFlowStep; + @state() private _step?: DataEntryFlowStep; - @internalProperty() private _errorMessage?: string; + @state() private _errorMessage?: string; protected render() { return html`
${this._renderForm()}
`; @@ -313,7 +313,7 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { /* So we can set min-height to avoid jumping during loading */ diff --git a/src/auth/ha-authorize.ts b/src/auth/ha-authorize.ts index ceabc2b409..02d1f80cea 100644 --- a/src/auth/ha-authorize.ts +++ b/src/auth/ha-authorize.ts @@ -1,8 +1,8 @@ import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -32,11 +32,11 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) { @property() public oauth2State?: string; - @internalProperty() private _authProvider?: AuthProvider; + @state() private _authProvider?: AuthProvider; - @internalProperty() private _authProviders?: AuthProvider[]; + @state() private _authProviders?: AuthProvider[]; - @internalProperty() private _discovery?: DiscoveryInformation; + @state() private _discovery?: DiscoveryInformation; constructor() { super(); @@ -189,7 +189,7 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) { this._authProvider = ev.detail; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-pick-auth-provider { display: block; diff --git a/src/common/decorators/local-storage.ts b/src/common/decorators/local-storage.ts index e72c9f0657..2299705033 100644 --- a/src/common/decorators/local-storage.ts +++ b/src/common/decorators/local-storage.ts @@ -1,5 +1,5 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { PropertyDeclaration, UpdatingElement } from "lit-element"; +import { PropertyDeclaration, ReactiveElement } from "lit-element"; import type { ClassElement } from "../../types"; type Callback = (oldValue: any, newValue: any) => void; @@ -93,7 +93,7 @@ export const LocalStorage = ( storage.addFromStorage(storageKey); - const subscribe = (el: UpdatingElement): UnsubscribeFunc => + const subscribe = (el: ReactiveElement): UnsubscribeFunc => storage.subscribeChanges(storageKey!, (oldValue) => { el.requestUpdate(clsElement.key, oldValue); }); @@ -101,7 +101,7 @@ export const LocalStorage = ( const getValue = (): any => storage.hasKey(storageKey!) ? storage.getValue(storageKey!) : initVal; - const setValue = (el: UpdatingElement, value: any) => { + const setValue = (el: ReactiveElement, value: any) => { let oldValue: unknown | undefined; if (property) { oldValue = getValue(); @@ -117,7 +117,7 @@ export const LocalStorage = ( placement: "prototype", key: clsElement.key, descriptor: { - set(this: UpdatingElement, value: unknown) { + set(this: ReactiveElement, value: unknown) { setValue(this, value); }, get() { @@ -126,7 +126,7 @@ export const LocalStorage = ( enumerable: true, configurable: true, }, - finisher(cls: typeof UpdatingElement) { + finisher(cls: typeof ReactiveElement) { if (property) { const connectedCallback = cls.prototype.connectedCallback; const disconnectedCallback = cls.prototype.disconnectedCallback; diff --git a/src/common/dom/dynamic-element-directive.ts b/src/common/dom/dynamic-element-directive.ts index e3e48e57af..cad1f45137 100644 --- a/src/common/dom/dynamic-element-directive.ts +++ b/src/common/dom/dynamic-element-directive.ts @@ -1,30 +1,47 @@ -import { directive, NodePart, Part } from "lit-html"; +import { noChange } from "lit-html"; +import { + ChildPart, + Directive, + directive, + DirectiveParameters, + PartInfo, + PartType, + // eslint-disable-next-line import/extensions +} from "lit-html/directive.js"; export const dynamicElement = directive( - (tag: string, properties?: Record) => (part: Part): void => { - if (!(part instanceof NodePart)) { - throw new Error( - "dynamicElementDirective can only be used in content bindings" - ); + class extends Directive { + private _element?: HTMLElement; + + constructor(partInfo: PartInfo) { + super(partInfo); + if (partInfo.type !== PartType.CHILD) { + throw new Error( + "dynamicElementDirective can only be used in content bindings" + ); + } } - let element = part.value as HTMLElement | undefined; + update(_part: ChildPart, [tag, properties]: DirectiveParameters) { + if (this._element && this._element.localName === tag) { + if (properties) { + Object.entries(properties).forEach(([key, value]) => { + this._element![key] = value; + }); + } + return noChange; + } + return this.render(tag, properties); + } - if (tag === element?.localName) { + render(tag: string, properties?: Record): HTMLElement { + this._element = document.createElement(tag); if (properties) { Object.entries(properties).forEach(([key, value]) => { - element![key] = value; + this._element![key] = value; }); } - return; + return this._element; } - - element = document.createElement(tag); - if (properties) { - Object.entries(properties).forEach(([key, value]) => { - element![key] = value; - }); - } - part.setValue(element); } ); diff --git a/src/common/search/search-input.ts b/src/common/search/search-input.ts index aff3a1a2a7..d6a76951d4 100644 --- a/src/common/search/search-input.ts +++ b/src/common/search/search-input.ts @@ -3,7 +3,7 @@ import { mdiClose, mdiMagnify } from "@mdi/js"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, LitElement, property, @@ -80,7 +80,7 @@ class SearchInput extends LitElement { this._filterChanged(""); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-svg-icon, mwc-icon-button { diff --git a/src/components/buttons/ha-call-api-button.ts b/src/components/buttons/ha-call-api-button.ts index ab5d075373..b7cec1d738 100644 --- a/src/components/buttons/ha-call-api-button.ts +++ b/src/components/buttons/ha-call-api-button.ts @@ -1,4 +1,11 @@ -import { css, CSSResult, html, LitElement, property, query } from "lit-element"; +import { + css, + CSSResultGroup, + html, + LitElement, + property, + query, +} from "lit-element"; import { fireEvent } from "../../common/dom/fire_event"; import { HomeAssistant } from "../../types"; import "./ha-progress-button"; @@ -59,7 +66,7 @@ class HaCallApiButton extends LitElement { fireEvent(this, "hass-api-called", eventData as any); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host([disabled]) { pointer-events: none; diff --git a/src/components/buttons/ha-progress-button.ts b/src/components/buttons/ha-progress-button.ts index bb431cf7cb..68c39559e1 100644 --- a/src/components/buttons/ha-progress-button.ts +++ b/src/components/buttons/ha-progress-button.ts @@ -2,7 +2,7 @@ import "@material/mwc-button"; import type { Button } from "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -60,7 +60,7 @@ class HaProgressButton extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { outline: none; diff --git a/src/components/data-table/ha-data-table.ts b/src/components/data-table/ha-data-table.ts index cca0ddf896..639849eb7a 100644 --- a/src/components/data-table/ha-data-table.ts +++ b/src/components/data-table/ha-data-table.ts @@ -1,11 +1,11 @@ import deepClone from "deep-clone-simple"; import { css, - CSSResult, + CSSResultGroup, customElement, eventOptions, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -118,21 +118,21 @@ export class HaDataTable extends LitElement { @property({ type: String }) public filter = ""; - @internalProperty() private _filterable = false; + @state() private _filterable = false; - @internalProperty() private _filter = ""; + @state() private _filter = ""; - @internalProperty() private _sortColumn?: string; + @state() private _sortColumn?: string; - @internalProperty() private _sortDirection: SortingDirection = null; + @state() private _sortDirection: SortingDirection = null; - @internalProperty() private _filteredData: DataTableRowData[] = []; + @state() private _filteredData: DataTableRowData[] = []; - @internalProperty() private _headerHeight = 0; + @state() private _headerHeight = 0; @query("slot[name='header']") private _header!: HTMLSlotElement; - @internalProperty() private _items: DataTableRowData[] = []; + @state() private _items: DataTableRowData[] = []; private _checkableRowsCount?: number; @@ -573,7 +573,7 @@ export class HaDataTable extends LitElement { this._savedScrollPos = (e.target as HTMLDivElement).scrollTop; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` /* default mdc styles, colors changed, without checkbox styles */ :host { diff --git a/src/components/date-range-picker.ts b/src/components/date-range-picker.ts index f7ec87169e..7dd6244640 100644 --- a/src/components/date-range-picker.ts +++ b/src/components/date-range-picker.ts @@ -1,6 +1,5 @@ // @ts-nocheck import wrap from "@vue/web-component-wrapper"; -import { customElement } from "lit-element/lib/decorators"; import Vue from "vue"; import DateRangePicker from "vue2-daterange-picker"; import dateRangePickerStyles from "vue2-daterange-picker/dist/vue2-daterange-picker.css"; diff --git a/src/components/device/ha-area-devices-picker.ts b/src/components/device/ha-area-devices-picker.ts index 6e635d0720..677db126a0 100644 --- a/src/components/device/ha-area-devices-picker.ts +++ b/src/components/device/ha-area-devices-picker.ts @@ -9,10 +9,10 @@ import "@vaadin/vaadin-combo-box/theme/material/vaadin-combo-box-light"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -127,13 +127,13 @@ export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) { @property({ type: Boolean }) private _opened?: boolean; - @internalProperty() private _areaPicker = true; + @state() private _areaPicker = true; - @internalProperty() private _devices?: DeviceRegistryEntry[]; + @state() private _devices?: DeviceRegistryEntry[]; - @internalProperty() private _areas?: AreaRegistryEntry[]; + @state() private _areas?: AreaRegistryEntry[]; - @internalProperty() private _entities?: EntityRegistryEntry[]; + @state() private _entities?: EntityRegistryEntry[]; private _selectedDevices: string[] = []; @@ -407,7 +407,7 @@ export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) { }, 0); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .suffix { display: flex; diff --git a/src/components/device/ha-device-automation-picker.ts b/src/components/device/ha-device-automation-picker.ts index 98e79035b6..2743e77d89 100644 --- a/src/components/device/ha-device-automation-picker.ts +++ b/src/components/device/ha-device-automation-picker.ts @@ -4,9 +4,9 @@ import "@polymer/paper-item/paper-item-body"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -33,11 +33,11 @@ export abstract class HaDeviceAutomationPicker< @property() public value?: T; - @internalProperty() private _automations: T[] = []; + @state() private _automations: T[] = []; // Trigger an empty render so we start with a clean DOM. // paper-listbox does not like changing things around. - @internalProperty() private _renderEmpty = false; + @state() private _renderEmpty = false; protected get NO_AUTOMATION_TEXT() { return this.hass.localize( @@ -188,7 +188,7 @@ export abstract class HaDeviceAutomationPicker< fireEvent(this, "value-changed", { value: automation }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-paper-dropdown-menu { width: 100%; diff --git a/src/components/device/ha-device-picker.ts b/src/components/device/ha-device-picker.ts index 3644ad9405..3e70ef85e8 100644 --- a/src/components/device/ha-device-picker.ts +++ b/src/components/device/ha-device-picker.ts @@ -3,10 +3,10 @@ import "@polymer/paper-item/paper-item-body"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -111,7 +111,7 @@ export class HaDevicePicker extends SubscribeMixin(LitElement) { @property({ type: Boolean }) public disabled?: boolean; - @internalProperty() private _opened?: boolean; + @state() private _opened?: boolean; @query("ha-combo-box", true) public comboBox!: HaComboBox; @@ -326,7 +326,7 @@ export class HaDevicePicker extends SubscribeMixin(LitElement) { }, 0); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` paper-input > mwc-icon-button { --mdc-icon-button-size: 24px; diff --git a/src/components/entity/ha-entity-attribute-picker.ts b/src/components/entity/ha-entity-attribute-picker.ts index 784ea421f8..10ffef76db 100644 --- a/src/components/entity/ha-entity-attribute-picker.ts +++ b/src/components/entity/ha-entity-attribute-picker.ts @@ -6,7 +6,7 @@ import "@vaadin/vaadin-combo-box/theme/material/vaadin-combo-box-light"; import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -165,7 +165,7 @@ class HaEntityAttributePicker extends LitElement { }, 0); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .suffix { display: flex; diff --git a/src/components/entity/ha-entity-picker.ts b/src/components/entity/ha-entity-picker.ts index dfaeecd570..e2307a529b 100644 --- a/src/components/entity/ha-entity-picker.ts +++ b/src/components/entity/ha-entity-picker.ts @@ -7,7 +7,7 @@ import "@vaadin/vaadin-combo-box/theme/material/vaadin-combo-box-light"; import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -311,7 +311,7 @@ export class HaEntityPicker extends LitElement { }, 0); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .suffix { display: flex; diff --git a/src/components/entity/ha-entity-toggle.ts b/src/components/entity/ha-entity-toggle.ts index 10fb56e096..19c08a57aa 100644 --- a/src/components/entity/ha-entity-toggle.ts +++ b/src/components/entity/ha-entity-toggle.ts @@ -1,9 +1,9 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -32,7 +32,7 @@ export class HaEntityToggle extends LitElement { @property() public label?: string; - @internalProperty() private _isOn = false; + @state() private _isOn = false; protected render(): TemplateResult { if (!this.stateObj) { @@ -148,7 +148,7 @@ export class HaEntityToggle extends LitElement { }, 2000); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { white-space: nowrap; diff --git a/src/components/entity/ha-state-label-badge.ts b/src/components/entity/ha-state-label-badge.ts index 340677ff41..e2ce11c133 100644 --- a/src/components/entity/ha-state-label-badge.ts +++ b/src/components/entity/ha-state-label-badge.ts @@ -1,10 +1,10 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -35,7 +35,7 @@ export class HaStateLabelBadge extends LitElement { @property() public image?: string; - @internalProperty() private _timerTimeRemaining?: number; + @state() private _timerTimeRemaining?: number; private _connected?: boolean; @@ -54,9 +54,9 @@ export class HaStateLabelBadge extends LitElement { } protected render(): TemplateResult { - const state = this.state; + const entityState = this.state; - if (!state) { + if (!entityState) { return html` `; } @@ -99,7 +106,7 @@ export class HaStateLabelBadge extends LitElement { } } - private _computeValue(domain: string, state: HassEntity) { + private _computeValue(domain: string, entityState: HassEntity) { switch (domain) { case "binary_sensor": case "device_tracker": @@ -111,77 +118,81 @@ export class HaStateLabelBadge extends LitElement { return null; case "sensor": default: - return state.attributes.device_class === "moon__phase" + return entityState.attributes.device_class === "moon__phase" ? null - : state.state === UNKNOWN + : entityState.state === UNKNOWN ? "-" - : state.attributes.unit_of_measurement - ? formatNumber(state.state, this.hass!.locale) - : computeStateDisplay(this.hass!.localize, state, this.hass!.locale); + : entityState.attributes.unit_of_measurement + ? formatNumber(entityState.state, this.hass!.locale) + : computeStateDisplay( + this.hass!.localize, + entityState, + this.hass!.locale + ); } } - private _computeIcon(domain: string, state: HassEntity) { - if (state.state === UNAVAILABLE) { + private _computeIcon(domain: string, entityState: HassEntity) { + if (entityState.state === UNAVAILABLE) { return null; } switch (domain) { case "alarm_control_panel": - if (state.state === "pending") { + if (entityState.state === "pending") { return "hass:clock-fast"; } - if (state.state === "armed_away") { + if (entityState.state === "armed_away") { return "hass:nature"; } - if (state.state === "armed_home") { + if (entityState.state === "armed_home") { return "hass:home-variant"; } - if (state.state === "armed_night") { + if (entityState.state === "armed_night") { return "hass:weather-night"; } - if (state.state === "armed_custom_bypass") { + if (entityState.state === "armed_custom_bypass") { return "hass:shield-home"; } - if (state.state === "triggered") { + if (entityState.state === "triggered") { return "hass:alert-circle"; } // state == 'disarmed' - return domainIcon(domain, state); + return domainIcon(domain, entityState); case "binary_sensor": case "device_tracker": case "updater": case "person": case "sun": - return stateIcon(state); + return stateIcon(entityState); case "timer": - return state.state === "active" + return entityState.state === "active" ? "hass:timer-outline" : "hass:timer-off-outline"; default: - return state?.attributes.device_class === "moon__phase" - ? stateIcon(state) + return entityState?.attributes.device_class === "moon__phase" + ? stateIcon(entityState) : null; } } - private _computeLabel(domain, state, _timerTimeRemaining) { + private _computeLabel(domain, entityState, _timerTimeRemaining) { if ( - state.state === UNAVAILABLE || + entityState.state === UNAVAILABLE || ["device_tracker", "alarm_control_panel", "person"].includes(domain) ) { // Localize the state with a special state_badge namespace, which has variations of // the state translations that are truncated to fit within the badge label. Translations // are only added for device_tracker, alarm_control_panel and person. return ( - this.hass!.localize(`state_badge.${domain}.${state.state}`) || - this.hass!.localize(`state_badge.default.${state.state}`) || - state.state + this.hass!.localize(`state_badge.${domain}.${entityState.state}`) || + this.hass!.localize(`state_badge.default.${entityState.state}`) || + entityState.state ); } if (domain === "timer") { return secondsToDuration(_timerTimeRemaining); } - return state.attributes.unit_of_measurement || null; + return entityState.attributes.unit_of_measurement || null; } private clearInterval() { @@ -209,7 +220,7 @@ export class HaStateLabelBadge extends LitElement { this._timerTimeRemaining = timerTimeRemaining(stateObj); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { cursor: pointer; diff --git a/src/components/entity/state-badge.ts b/src/components/entity/state-badge.ts index 46886fa909..76604f87bd 100644 --- a/src/components/entity/state-badge.ts +++ b/src/components/entity/state-badge.ts @@ -1,9 +1,9 @@ import type { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -32,7 +32,7 @@ export class StateBadge extends LitElement { @property({ type: Boolean, reflect: true, attribute: "icon" }) private _showIcon = true; - @internalProperty() private _iconStyle: { [name: string]: string } = {}; + @state() private _iconStyle: { [name: string]: string } = {}; protected render(): TemplateResult { const stateObj = this.stateObj; @@ -128,7 +128,7 @@ export class StateBadge extends LitElement { Object.assign(this.style, hostStyle); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { position: relative; diff --git a/src/components/entity/state-info.ts b/src/components/entity/state-info.ts index 0bb035cc7f..f53089578f 100644 --- a/src/components/entity/state-info.ts +++ b/src/components/entity/state-info.ts @@ -2,7 +2,7 @@ import "@polymer/paper-tooltip/paper-tooltip"; import type { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -89,7 +89,7 @@ class StateInfo extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { min-width: 120px; diff --git a/src/components/ha-addon-picker.ts b/src/components/ha-addon-picker.ts index 582eaefcff..05d5f30bbd 100644 --- a/src/components/ha-addon-picker.ts +++ b/src/components/ha-addon-picker.ts @@ -1,7 +1,7 @@ import { customElement, html, - internalProperty, + state, LitElement, property, query, @@ -51,7 +51,7 @@ class HaAddonPicker extends LitElement { @property() public value = ""; - @internalProperty() private _addons?: HassioAddonInfo[]; + @state() private _addons?: HassioAddonInfo[]; @property({ type: Boolean }) public disabled = false; diff --git a/src/components/ha-analytics.ts b/src/components/ha-analytics.ts index e3f5ae6858..f357342581 100644 --- a/src/components/ha-analytics.ts +++ b/src/components/ha-analytics.ts @@ -1,7 +1,7 @@ import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -151,7 +151,7 @@ export class HaAnalytics extends LitElement { fireEvent(this, "analytics-preferences-changed", { preferences }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/components/ha-area-picker.ts b/src/components/ha-area-picker.ts index 35f7fc00bb..fc48bac838 100644 --- a/src/components/ha-area-picker.ts +++ b/src/components/ha-area-picker.ts @@ -8,10 +8,10 @@ import "@vaadin/vaadin-combo-box/theme/material/vaadin-combo-box-light"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -119,13 +119,13 @@ export class HaAreaPicker extends SubscribeMixin(LitElement) { @property({ type: Boolean }) public disabled?: boolean; - @internalProperty() private _areas?: AreaRegistryEntry[]; + @state() private _areas?: AreaRegistryEntry[]; - @internalProperty() private _devices?: DeviceRegistryEntry[]; + @state() private _devices?: DeviceRegistryEntry[]; - @internalProperty() private _entities?: EntityRegistryEntry[]; + @state() private _entities?: EntityRegistryEntry[]; - @internalProperty() private _opened?: boolean; + @state() private _opened?: boolean; @query("vaadin-combo-box-light", true) public comboBox!: HTMLElement; @@ -457,7 +457,7 @@ export class HaAreaPicker extends SubscribeMixin(LitElement) { }, 0); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` paper-input > mwc-icon-button { --mdc-icon-button-size: 24px; diff --git a/src/components/ha-attributes.ts b/src/components/ha-attributes.ts index e18910ef1d..24af62f6a6 100644 --- a/src/components/ha-attributes.ts +++ b/src/components/ha-attributes.ts @@ -1,7 +1,7 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -58,7 +58,7 @@ class HaAttributes extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/components/ha-bar.ts b/src/components/ha-bar.ts index 3378958a56..0c58dd5964 100644 --- a/src/components/ha-bar.ts +++ b/src/components/ha-bar.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, LitElement, property, @@ -40,7 +40,7 @@ export class HaBar extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` rect { height: 100%; diff --git a/src/components/ha-blueprint-picker.ts b/src/components/ha-blueprint-picker.ts index 716d85ba17..95e1318647 100644 --- a/src/components/ha-blueprint-picker.ts +++ b/src/components/ha-blueprint-picker.ts @@ -3,7 +3,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -98,7 +98,7 @@ class HaBluePrintPicker extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: inline-block; diff --git a/src/components/ha-button-menu.ts b/src/components/ha-button-menu.ts index de50f7bd42..27c75b9ac5 100644 --- a/src/components/ha-button-menu.ts +++ b/src/components/ha-button-menu.ts @@ -2,7 +2,7 @@ import "@material/mwc-menu"; import type { Corner, Menu } from "@material/mwc-menu"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -53,7 +53,7 @@ export class HaButtonMenu extends LitElement { this._menu!.show(); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: inline-block; diff --git a/src/components/ha-button-related-filter-menu.ts b/src/components/ha-button-related-filter-menu.ts index 1e4cde248d..1a2eba9209 100644 --- a/src/components/ha-button-related-filter-menu.ts +++ b/src/components/ha-button-related-filter-menu.ts @@ -3,10 +3,10 @@ import type { Corner } from "@material/mwc-menu"; import { mdiFilterVariant } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -59,7 +59,7 @@ export class HaRelatedFilterButtonMenu extends LitElement { @property({ type: Array, attribute: "exclude-domains" }) public excludeDomains?: string[]; - @internalProperty() private _open = false; + @state() private _open = false; protected render(): TemplateResult { return html` @@ -175,7 +175,7 @@ export class HaRelatedFilterButtonMenu extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: inline-block; diff --git a/src/components/ha-button-toggle-group.ts b/src/components/ha-button-toggle-group.ts index 8facec61bf..f6aa48c317 100644 --- a/src/components/ha-button-toggle-group.ts +++ b/src/components/ha-button-toggle-group.ts @@ -2,7 +2,7 @@ import "@material/mwc-button/mwc-button"; import "@material/mwc-icon-button/mwc-icon-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -56,7 +56,7 @@ export class HaButtonToggleGroup extends LitElement { fireEvent(this, "value-changed", { value: this.active }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` div { display: flex; diff --git a/src/components/ha-camera-stream.ts b/src/components/ha-camera-stream.ts index adc3913644..acd0c90ff2 100644 --- a/src/components/ha-camera-stream.ts +++ b/src/components/ha-camera-stream.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -39,9 +39,9 @@ class HaCameraStream extends LitElement { // We keep track if we should force MJPEG with a string // that way it automatically resets if we change entity. - @internalProperty() private _forceMJPEG?: string; + @state() private _forceMJPEG?: string; - @internalProperty() private _url?: string; + @state() private _url?: string; protected render(): TemplateResult { if (!this.stateObj) { @@ -113,7 +113,7 @@ class HaCameraStream extends LitElement { fireEvent(this, "iron-resize"); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host, img { diff --git a/src/components/ha-card.ts b/src/components/ha-card.ts index 157d663bfe..7ec2045fe7 100644 --- a/src/components/ha-card.ts +++ b/src/components/ha-card.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -14,7 +14,7 @@ export class HaCard extends LitElement { @property({ type: Boolean, reflect: true }) public outlined = false; - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { background: var( diff --git a/src/components/ha-chip-set.ts b/src/components/ha-chip-set.ts index 9f1e237188..0d6fed061e 100644 --- a/src/components/ha-chip-set.ts +++ b/src/components/ha-chip-set.ts @@ -2,7 +2,7 @@ import chipStyles from "@material/chips/dist/mdc.chips.min.css"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -48,7 +48,7 @@ export class HaChipSet extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ${unsafeCSS(chipStyles)} diff --git a/src/components/ha-chip.ts b/src/components/ha-chip.ts index 2f57b6c943..3e317bc0b5 100644 --- a/src/components/ha-chip.ts +++ b/src/components/ha-chip.ts @@ -4,7 +4,7 @@ import { ripple } from "@material/mwc-ripple/ripple-directive"; import "./ha-icon"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -44,7 +44,7 @@ export class HaChip extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ${unsafeCSS(chipStyles)} .mdc-chip { diff --git a/src/components/ha-climate-state.ts b/src/components/ha-climate-state.ts index aac651d6af..bc330ff3b1 100644 --- a/src/components/ha-climate-state.ts +++ b/src/components/ha-climate-state.ts @@ -1,7 +1,7 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -126,7 +126,7 @@ class HaClimateState extends LitElement { : stateString; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/components/ha-code-editor.ts b/src/components/ha-code-editor.ts index d830e06e08..678eef7304 100644 --- a/src/components/ha-code-editor.ts +++ b/src/components/ha-code-editor.ts @@ -1,10 +1,12 @@ import type { EditorView, KeyBinding, ViewUpdate } from "@codemirror/view"; import { customElement, - internalProperty, + state, property, PropertyValues, - UpdatingElement, + ReactiveElement, + css, + CSSResultGroup, } from "lit-element"; import { fireEvent } from "../common/dom/fire_event"; import { loadCodeMirror } from "../resources/codemirror.ondemand"; @@ -24,7 +26,7 @@ const saveKeyBinding: KeyBinding = { }; @customElement("ha-code-editor") -export class HaCodeEditor extends UpdatingElement { +export class HaCodeEditor extends ReactiveElement { public codemirror?: EditorView; @property() public mode = "yaml"; @@ -35,7 +37,7 @@ export class HaCodeEditor extends UpdatingElement { @property() public error = false; - @internalProperty() private _value = ""; + @state() private _value = ""; private _loadedCodeMirror?: typeof import("../resources/codemirror"); @@ -60,6 +62,14 @@ export class HaCodeEditor extends UpdatingElement { public connectedCallback() { super.connectedCallback(); + // Lit 2.0 will create the shadowRoot for us, and adopt the styles, check if it was created + if (!this.shadowRoot) { + this.attachShadow({ mode: "open" }).innerHTML = ``; + } if (!this.codemirror) { return; } @@ -116,14 +126,6 @@ export class HaCodeEditor extends UpdatingElement { private async _load(): Promise { this._loadedCodeMirror = await loadCodeMirror(); - const shadowRoot = this.attachShadow({ mode: "open" }); - - shadowRoot!.innerHTML = ``; - this.codemirror = new this._loadedCodeMirror.EditorView({ state: this._loadedCodeMirror.EditorState.create({ doc: this._value, @@ -155,8 +157,8 @@ export class HaCodeEditor extends UpdatingElement { ), ], }), - root: shadowRoot, - parent: shadowRoot, + root: this.shadowRoot!, + parent: this.shadowRoot!, }); } @@ -175,6 +177,15 @@ export class HaCodeEditor extends UpdatingElement { this._value = newValue; fireEvent(this, "value-changed", { value: this._value }); } + + // Only Lit 2.0 will use this + static get styles(): CSSResultGroup { + return css` + :host(.error-state) div.cm-wrap .cm-gutters { + border-color: var(--error-state-color, red); + } + `; + } } declare global { diff --git a/src/components/ha-combo-box.ts b/src/components/ha-combo-box.ts index 19f89bd410..be09112404 100644 --- a/src/components/ha-combo-box.ts +++ b/src/components/ha-combo-box.ts @@ -7,10 +7,10 @@ import "@polymer/paper-listbox/paper-listbox"; import "@vaadin/vaadin-combo-box/theme/material/vaadin-combo-box-light"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -70,7 +70,7 @@ export class HaComboBox extends LitElement { @property({ type: Boolean }) public disabled?: boolean; - @internalProperty() private _opened?: boolean; + @state() private _opened?: boolean; @query("vaadin-combo-box-light", true) private _comboBox!: HTMLElement; @@ -167,7 +167,7 @@ export class HaComboBox extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` paper-input > mwc-icon-button { --mdc-icon-button-size: 24px; diff --git a/src/components/ha-cover-controls.ts b/src/components/ha-cover-controls.ts index 08910a7735..bbe03b6af4 100644 --- a/src/components/ha-cover-controls.ts +++ b/src/components/ha-cover-controls.ts @@ -1,10 +1,10 @@ import type { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -23,7 +23,7 @@ class HaCoverControls extends LitElement { @property({ attribute: false }) public stateObj!: HassEntity; - @internalProperty() private _entityObj?: CoverEntity; + @state() private _entityObj?: CoverEntity; protected updated(changedProperties: PropertyValues): void { super.updated(changedProperties); @@ -114,7 +114,7 @@ class HaCoverControls extends LitElement { this._entityObj.stopCover(); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .state { white-space: nowrap; diff --git a/src/components/ha-cover-tilt-controls.ts b/src/components/ha-cover-tilt-controls.ts index be2f6f4087..9ae7e1eb8d 100644 --- a/src/components/ha-cover-tilt-controls.ts +++ b/src/components/ha-cover-tilt-controls.ts @@ -1,10 +1,10 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -22,7 +22,7 @@ class HaCoverTiltControls extends LitElement { @property({ attribute: false }) stateObj!: HassEntity; - @internalProperty() private _entityObj?: CoverEntity; + @state() private _entityObj?: CoverEntity; protected updated(changedProperties: PropertyValues): void { super.updated(changedProperties); @@ -101,7 +101,7 @@ class HaCoverTiltControls extends LitElement { this._entityObj.stopCoverTilt(); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { white-space: nowrap; diff --git a/src/components/ha-date-input.ts b/src/components/ha-date-input.ts index 40493d1345..a7ec481461 100644 --- a/src/components/ha-date-input.ts +++ b/src/components/ha-date-input.ts @@ -1,7 +1,7 @@ import "@vaadin/vaadin-date-picker/theme/material/vaadin-date-picker-light"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -134,7 +134,7 @@ export class HaDateInput extends LitElement { return true; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` paper-input { width: 110px; diff --git a/src/components/ha-date-range-picker.ts b/src/components/ha-date-range-picker.ts index d0d1442f87..0b67c7e50a 100644 --- a/src/components/ha-date-range-picker.ts +++ b/src/components/ha-date-range-picker.ts @@ -6,7 +6,7 @@ import { mdiCalendar } from "@mdi/js"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -146,7 +146,7 @@ export class HaDateRangePicker extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-svg-icon { margin-right: 8px; diff --git a/src/components/ha-dialog.ts b/src/components/ha-dialog.ts index 40e0f736db..a38faff951 100644 --- a/src/components/ha-dialog.ts +++ b/src/components/ha-dialog.ts @@ -2,7 +2,7 @@ import "@material/mwc-dialog"; import type { Dialog } from "@material/mwc-dialog"; import { style } from "@material/mwc-dialog/mwc-dialog-css"; import { mdiClose } from "@mdi/js"; -import { css, CSSResult, customElement, html } from "lit-element"; +import { css, CSSResultGroup, customElement, html } from "lit-element"; import { computeRTLDirection } from "../common/util/compute_rtl"; import type { Constructor, HomeAssistant } from "../types"; import "./ha-icon-button"; @@ -31,7 +31,7 @@ export class HaDialog extends MwcDialog { return html` ${super.renderHeading()} `; } - protected static get styles(): CSSResult[] { + protected static get styles(): CSSResultGroup { return [ style, css` diff --git a/src/components/ha-expansion-panel.ts b/src/components/ha-expansion-panel.ts index be3dc4f77d..0676b6a178 100644 --- a/src/components/ha-expansion-panel.ts +++ b/src/components/ha-expansion-panel.ts @@ -1,7 +1,7 @@ import { mdiChevronDown } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -59,7 +59,7 @@ class HaExpansionPanel extends LitElement { fireEvent(this, "expanded-changed", { expanded: this.expanded }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/components/ha-file-upload.ts b/src/components/ha-file-upload.ts index 0fa12a6ed9..d3324d63c4 100644 --- a/src/components/ha-file-upload.ts +++ b/src/components/ha-file-upload.ts @@ -6,7 +6,7 @@ import { css, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -39,7 +39,7 @@ export class HaFileUpload extends LitElement { @property({ type: Boolean, attribute: "auto-open-file-dialog" }) private autoOpenFileDialog = false; - @internalProperty() private _drag = false; + @state() private _drag = false; @query("#input") private _input?: HTMLInputElement; diff --git a/src/components/ha-form/ha-form-boolean.ts b/src/components/ha-form/ha-form-boolean.ts index 454a01e718..2eac24c33f 100644 --- a/src/components/ha-form/ha-form-boolean.ts +++ b/src/components/ha-form/ha-form-boolean.ts @@ -2,7 +2,7 @@ import "@polymer/paper-checkbox/paper-checkbox"; import type { PaperCheckboxElement } from "@polymer/paper-checkbox/paper-checkbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -49,7 +49,7 @@ export class HaFormBoolean extends LitElement implements HaFormElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` paper-checkbox { display: block; diff --git a/src/components/ha-form/ha-form-constant.ts b/src/components/ha-form/ha-form-constant.ts index 4e6d6e21b4..e860191635 100644 --- a/src/components/ha-form/ha-form-constant.ts +++ b/src/components/ha-form/ha-form-constant.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -28,7 +28,7 @@ export class HaFormConstant extends LitElement implements HaFormElement { return html`${this.label}: ${this.schema.value}`; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/components/ha-form/ha-form-integer.ts b/src/components/ha-form/ha-form-integer.ts index 9fab3cabc0..cb8fa55d46 100644 --- a/src/components/ha-form/ha-form-integer.ts +++ b/src/components/ha-form/ha-form-integer.ts @@ -4,7 +4,7 @@ import "@polymer/paper-slider/paper-slider"; import type { PaperSliderElement } from "@polymer/paper-slider/paper-slider"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -107,7 +107,7 @@ export class HaFormInteger extends LitElement implements HaFormElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .flex { display: flex; diff --git a/src/components/ha-form/ha-form-multi_select.ts b/src/components/ha-form/ha-form-multi_select.ts index 117dbe927e..c9424e4ec6 100644 --- a/src/components/ha-form/ha-form-multi_select.ts +++ b/src/components/ha-form/ha-form-multi_select.ts @@ -6,10 +6,10 @@ import "@polymer/paper-menu-button/paper-menu-button"; import "@polymer/paper-ripple/paper-ripple"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -33,7 +33,7 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement { @property() public suffix!: string; - @internalProperty() private _init = false; + @state() private _init = false; @query("paper-menu-button", true) private _input?: HTMLElement; @@ -140,7 +140,7 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement { ); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` paper-menu-button { display: block; diff --git a/src/components/ha-form/ha-form-select.ts b/src/components/ha-form/ha-form-select.ts index 398de2afda..05ee346726 100644 --- a/src/components/ha-form/ha-form-select.ts +++ b/src/components/ha-form/ha-form-select.ts @@ -2,7 +2,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -74,7 +74,7 @@ export class HaFormSelect extends LitElement implements HaFormElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-paper-dropdown-menu { display: block; diff --git a/src/components/ha-form/ha-form-string.ts b/src/components/ha-form/ha-form-string.ts index a376520783..d78d793268 100644 --- a/src/components/ha-form/ha-form-string.ts +++ b/src/components/ha-form/ha-form-string.ts @@ -3,10 +3,10 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -31,7 +31,7 @@ export class HaFormString extends LitElement implements HaFormElement { @property() public suffix!: string; - @internalProperty() private _unmaskedPassword = false; + @state() private _unmaskedPassword = false; @query("paper-input") private _input?: HTMLElement; @@ -104,7 +104,7 @@ export class HaFormString extends LitElement implements HaFormElement { return "text"; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` mwc-icon-button { --mdc-icon-button-size: 24px; diff --git a/src/components/ha-form/ha-form.ts b/src/components/ha-form/ha-form.ts index adfe4fd71f..4b7f3ef7d8 100644 --- a/src/components/ha-form/ha-form.ts +++ b/src/components/ha-form/ha-form.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -207,7 +207,7 @@ export class HaForm extends LitElement implements HaFormElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .error { color: var(--error-color); diff --git a/src/components/ha-formfield.ts b/src/components/ha-formfield.ts index 96187b8803..9b31ed66f5 100644 --- a/src/components/ha-formfield.ts +++ b/src/components/ha-formfield.ts @@ -1,7 +1,7 @@ import "@material/mwc-formfield"; import type { Formfield } from "@material/mwc-formfield"; import { style } from "@material/mwc-formfield/mwc-formfield-css"; -import { css, CSSResult, customElement } from "lit-element"; +import { css, CSSResultGroup, customElement } from "lit-element"; import { Constructor } from "../types"; const MwcFormfield = customElements.get( @@ -10,7 +10,7 @@ const MwcFormfield = customElements.get( @customElement("ha-formfield") export class HaFormfield extends MwcFormfield { - protected static get styles(): CSSResult[] { + protected static get styles(): CSSResultGroup { return [ style, css` diff --git a/src/components/ha-gauge.ts b/src/components/ha-gauge.ts index 0628cb2243..11db5a890f 100644 --- a/src/components/ha-gauge.ts +++ b/src/components/ha-gauge.ts @@ -1,7 +1,7 @@ import { css, customElement, - internalProperty, + state, LitElement, property, PropertyValues, @@ -34,9 +34,9 @@ export class Gauge extends LitElement { @property() public label = ""; - @internalProperty() private _angle = 0; + @state() private _angle = 0; - @internalProperty() private _updated = false; + @state() private _updated = false; protected firstUpdated(changedProperties: PropertyValues) { super.firstUpdated(changedProperties); diff --git a/src/components/ha-hls-player.ts b/src/components/ha-hls-player.ts index e841993c1b..ee9d20001b 100644 --- a/src/components/ha-hls-player.ts +++ b/src/components/ha-hls-player.ts @@ -1,10 +1,10 @@ import type HlsType from "hls.js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -40,7 +40,7 @@ class HaHLSPlayer extends LitElement { // don't cache this, as we remove it on disconnects @query("video") private _videoEl!: HTMLVideoElement; - @internalProperty() private _attached = false; + @state() private _attached = false; private _hlsPolyfillInstance?: HlsType; @@ -220,7 +220,7 @@ class HaHLSPlayer extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host, video { diff --git a/src/components/ha-icon-button-arrow-next.ts b/src/components/ha-icon-button-arrow-next.ts index 85bc2d245f..d6076d7ffd 100644 --- a/src/components/ha-icon-button-arrow-next.ts +++ b/src/components/ha-icon-button-arrow-next.ts @@ -3,7 +3,7 @@ import { mdiArrowLeft, mdiArrowRight } from "@mdi/js"; import { customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -19,7 +19,7 @@ export class HaIconButtonArrowNext extends LitElement { @property() public label?: string; - @internalProperty() private _icon = mdiArrowRight; + @state() private _icon = mdiArrowRight; public connectedCallback() { super.connectedCallback(); diff --git a/src/components/ha-icon-button-arrow-prev.ts b/src/components/ha-icon-button-arrow-prev.ts index c426c589a7..50ef9120ee 100644 --- a/src/components/ha-icon-button-arrow-prev.ts +++ b/src/components/ha-icon-button-arrow-prev.ts @@ -3,7 +3,7 @@ import { mdiArrowLeft, mdiArrowRight } from "@mdi/js"; import { customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -19,7 +19,7 @@ export class HaIconButtonArrowPrev extends LitElement { @property() public label?: string; - @internalProperty() private _icon = mdiArrowLeft; + @state() private _icon = mdiArrowLeft; public connectedCallback() { super.connectedCallback(); diff --git a/src/components/ha-icon-button-next.ts b/src/components/ha-icon-button-next.ts index 04213393eb..8b4df6eb54 100644 --- a/src/components/ha-icon-button-next.ts +++ b/src/components/ha-icon-button-next.ts @@ -3,7 +3,7 @@ import { mdiChevronLeft, mdiChevronRight } from "@mdi/js"; import { customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -19,7 +19,7 @@ export class HaIconButtonNext extends LitElement { @property() public label?: string; - @internalProperty() private _icon = mdiChevronRight; + @state() private _icon = mdiChevronRight; public connectedCallback() { super.connectedCallback(); diff --git a/src/components/ha-icon-button-prev.ts b/src/components/ha-icon-button-prev.ts index 6384039f13..3a962bc23a 100644 --- a/src/components/ha-icon-button-prev.ts +++ b/src/components/ha-icon-button-prev.ts @@ -3,7 +3,7 @@ import { mdiChevronLeft, mdiChevronRight } from "@mdi/js"; import { customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -19,7 +19,7 @@ export class HaIconButtonPrev extends LitElement { @property() public label?: string; - @internalProperty() private _icon = mdiChevronLeft; + @state() private _icon = mdiChevronLeft; public connectedCallback() { super.connectedCallback(); diff --git a/src/components/ha-icon-button.ts b/src/components/ha-icon-button.ts index e8cc62ab55..3e57d5a9b6 100644 --- a/src/components/ha-icon-button.ts +++ b/src/components/ha-icon-button.ts @@ -1,7 +1,7 @@ import "@material/mwc-icon-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -18,9 +18,10 @@ export class HaIconButton extends LitElement { @property({ type: String }) label = ""; - protected createRenderRoot() { - return this.attachShadow({ mode: "open", delegatesFocus: true }); - } + static shadowRootOptions: ShadowRootInit = { + mode: "open", + delegatesFocus: true, + }; protected render(): TemplateResult { return html` @@ -30,7 +31,7 @@ export class HaIconButton extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: inline-block; diff --git a/src/components/ha-icon.ts b/src/components/ha-icon.ts index 2cb7e0bdf6..ba1a4a74da 100644 --- a/src/components/ha-icon.ts +++ b/src/components/ha-icon.ts @@ -1,10 +1,10 @@ import "@polymer/iron-icon/iron-icon"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -45,11 +45,11 @@ const cachedIcons: Record = {}; export class HaIcon extends LitElement { @property() public icon?: string; - @internalProperty() private _path?: string; + @state() private _path?: string; - @internalProperty() private _viewBox?; + @state() private _viewBox?; - @internalProperty() private _legacy = false; + @state() private _legacy = false; protected updated(changedProps: PropertyValues) { if (changedProps.has("icon")) { @@ -161,7 +161,7 @@ export class HaIcon extends LitElement { cachedIcons[iconName] = iconPack[iconName]; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { fill: currentcolor; diff --git a/src/components/ha-label-badge.ts b/src/components/ha-label-badge.ts index 49ecff7bf2..66aa2dc0bc 100644 --- a/src/components/ha-label-badge.ts +++ b/src/components/ha-label-badge.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, html, LitElement, property, @@ -60,7 +60,7 @@ class HaLabelBadge extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ css` .badge-container { diff --git a/src/components/ha-markdown-element.ts b/src/components/ha-markdown-element.ts index cd07cf0a01..4658f5ee05 100644 --- a/src/components/ha-markdown-element.ts +++ b/src/components/ha-markdown-element.ts @@ -1,15 +1,22 @@ -import { customElement, property, UpdatingElement } from "lit-element"; +import { customElement, property, ReactiveElement } from "lit-element"; import { fireEvent } from "../common/dom/fire_event"; import { renderMarkdown } from "../resources/render-markdown"; @customElement("ha-markdown-element") -class HaMarkdownElement extends UpdatingElement { +class HaMarkdownElement extends ReactiveElement { @property() public content?; @property({ type: Boolean }) public allowSvg = false; @property({ type: Boolean }) public breaks = false; + public connectedCallback() { + super.connectedCallback(); + if (!this.shadowRoot) { + this.attachShadow({ mode: "open" }); + } + } + protected update(changedProps) { super.update(changedProps); if (this.content !== undefined) { @@ -18,7 +25,7 @@ class HaMarkdownElement extends UpdatingElement { } private async _render() { - this.innerHTML = await renderMarkdown( + this.shadowRoot!.innerHTML = await renderMarkdown( this.content, { breaks: this.breaks, @@ -32,10 +39,8 @@ class HaMarkdownElement extends UpdatingElement { this._resize(); const walker = document.createTreeWalker( - this, - 1 /* SHOW_ELEMENT */, - null, - false + this.shadowRoot!, + 1 /* SHOW_ELEMENT */ ); while (walker.nextNode()) { diff --git a/src/components/ha-markdown.ts b/src/components/ha-markdown.ts index c98f5d07a9..b47e96e706 100644 --- a/src/components/ha-markdown.ts +++ b/src/components/ha-markdown.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -29,7 +29,7 @@ class HaMarkdown extends LitElement { >`; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/components/ha-menu-button.ts b/src/components/ha-menu-button.ts index b95d012938..067bf93324 100644 --- a/src/components/ha-menu-button.ts +++ b/src/components/ha-menu-button.ts @@ -3,10 +3,10 @@ import { mdiMenu } from "@mdi/js"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -25,7 +25,7 @@ class HaMenuButton extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _hasNotifications = false; + @state() private _hasNotifications = false; private _alwaysVisible = false; @@ -125,7 +125,7 @@ class HaMenuButton extends LitElement { fireEvent(this, "hass-toggle-menu"); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { position: relative; diff --git a/src/components/ha-picture-upload.ts b/src/components/ha-picture-upload.ts index 0ac990c667..f63eaedf4a 100644 --- a/src/components/ha-picture-upload.ts +++ b/src/components/ha-picture-upload.ts @@ -5,7 +5,7 @@ import "@polymer/paper-input/paper-input-container"; import { customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -36,7 +36,7 @@ export class HaPictureUpload extends LitElement { @property({ type: Number }) public size = 512; - @internalProperty() private _uploading = false; + @state() private _uploading = false; public render(): TemplateResult { return html` diff --git a/src/components/ha-related-items.ts b/src/components/ha-related-items.ts index 3d2cc72c27..9bee1152b5 100644 --- a/src/components/ha-related-items.ts +++ b/src/components/ha-related-items.ts @@ -1,10 +1,10 @@ import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -34,13 +34,13 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) { @property() public itemId!: string; - @internalProperty() private _entries?: ConfigEntry[]; + @state() private _entries?: ConfigEntry[]; - @internalProperty() private _devices?: DeviceRegistryEntry[]; + @state() private _devices?: DeviceRegistryEntry[]; - @internalProperty() private _areas?: AreaRegistryEntry[]; + @state() private _areas?: AreaRegistryEntry[]; - @internalProperty() private _related?: RelatedResult; + @state() private _related?: RelatedResult; public hassSubscribe(): UnsubscribeFunc[] { return [ @@ -303,7 +303,7 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) { fireEvent(this, "hass-more-info", { entityId }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` a { color: var(--primary-color); diff --git a/src/components/ha-relative-time.ts b/src/components/ha-relative-time.ts index 98b9228dec..83ad795ac7 100644 --- a/src/components/ha-relative-time.ts +++ b/src/components/ha-relative-time.ts @@ -2,13 +2,13 @@ import { customElement, property, PropertyValues, - UpdatingElement, + ReactiveElement, } from "lit-element"; import relativeTime from "../common/datetime/relative_time"; import type { HomeAssistant } from "../types"; @customElement("ha-relative-time") -class HaRelativeTime extends UpdatingElement { +class HaRelativeTime extends ReactiveElement { @property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public datetime?: string | Date; @@ -27,6 +27,10 @@ class HaRelativeTime extends UpdatingElement { } } + protected createRenderRoot() { + return this; + } + protected firstUpdated(changedProps: PropertyValues) { super.firstUpdated(changedProps); this._updateRelative(); diff --git a/src/components/ha-selector/ha-selector-action.ts b/src/components/ha-selector/ha-selector-action.ts index 8b2ca84fca..321e5f4f00 100644 --- a/src/components/ha-selector/ha-selector-action.ts +++ b/src/components/ha-selector/ha-selector-action.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -31,7 +31,7 @@ export class HaActionSelector extends LitElement { >`; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-automation-action { display: block; diff --git a/src/components/ha-selector/ha-selector-area.ts b/src/components/ha-selector/ha-selector-area.ts index c3443291d6..5fb5621570 100644 --- a/src/components/ha-selector/ha-selector-area.ts +++ b/src/components/ha-selector/ha-selector-area.ts @@ -1,10 +1,4 @@ -import { - customElement, - html, - internalProperty, - LitElement, - property, -} from "lit-element"; +import { customElement, html, state, LitElement, property } from "lit-element"; import { ConfigEntry, getConfigEntries } from "../../data/config_entries"; import { DeviceRegistryEntry } from "../../data/device_registry"; import { EntityRegistryEntry } from "../../data/entity_registry"; @@ -22,7 +16,7 @@ export class HaAreaSelector extends LitElement { @property() public label?: string; - @internalProperty() public _configEntries?: ConfigEntry[]; + @state() public _configEntries?: ConfigEntry[]; @property({ type: Boolean }) public disabled = false; diff --git a/src/components/ha-selector/ha-selector-boolean.ts b/src/components/ha-selector/ha-selector-boolean.ts index 0f56180fe5..7299316b72 100644 --- a/src/components/ha-selector/ha-selector-boolean.ts +++ b/src/components/ha-selector/ha-selector-boolean.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -39,7 +39,7 @@ export class HaBooleanSelector extends LitElement { fireEvent(this, "value-changed", { value }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-formfield { width: 100%; diff --git a/src/components/ha-selector/ha-selector-device.ts b/src/components/ha-selector/ha-selector-device.ts index 9446c16a51..b528beb784 100644 --- a/src/components/ha-selector/ha-selector-device.ts +++ b/src/components/ha-selector/ha-selector-device.ts @@ -1,10 +1,4 @@ -import { - customElement, - html, - internalProperty, - LitElement, - property, -} from "lit-element"; +import { customElement, html, state, LitElement, property } from "lit-element"; import { ConfigEntry, getConfigEntries } from "../../data/config_entries"; import { DeviceRegistryEntry } from "../../data/device_registry"; import { DeviceSelector } from "../../data/selector"; @@ -21,7 +15,7 @@ export class HaDeviceSelector extends LitElement { @property() public label?: string; - @internalProperty() public _configEntries?: ConfigEntry[]; + @state() public _configEntries?: ConfigEntry[]; @property({ type: Boolean }) public disabled = false; diff --git a/src/components/ha-selector/ha-selector-entity.ts b/src/components/ha-selector/ha-selector-entity.ts index 21977aa46c..884905f7bb 100644 --- a/src/components/ha-selector/ha-selector-entity.ts +++ b/src/components/ha-selector/ha-selector-entity.ts @@ -1,11 +1,5 @@ import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - customElement, - html, - internalProperty, - LitElement, - property, -} from "lit-element"; +import { customElement, html, state, LitElement, property } from "lit-element"; import { computeStateDomain } from "../../common/entity/compute_state_domain"; import { subscribeEntityRegistry } from "../../data/entity_registry"; import { EntitySelector } from "../../data/selector"; @@ -19,7 +13,7 @@ export class HaEntitySelector extends SubscribeMixin(LitElement) { @property() public selector!: EntitySelector; - @internalProperty() private _entityPlaformLookup?: Record; + @state() private _entityPlaformLookup?: Record; @property() public value?: any; diff --git a/src/components/ha-selector/ha-selector-number.ts b/src/components/ha-selector/ha-selector-number.ts index 6360ed1568..393dbb7d00 100644 --- a/src/components/ha-selector/ha-selector-number.ts +++ b/src/components/ha-selector/ha-selector-number.ts @@ -1,7 +1,7 @@ import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -92,7 +92,7 @@ export class HaNumberSelector extends LitElement { fireEvent(this, "value-changed", { value }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/components/ha-selector/ha-selector-select.ts b/src/components/ha-selector/ha-selector-select.ts index 55a2fa7357..ae19d099d5 100644 --- a/src/components/ha-selector/ha-selector-select.ts +++ b/src/components/ha-selector/ha-selector-select.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -52,7 +52,7 @@ export class HaSelectSelector extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-paper-dropdown-menu { width: 100%; diff --git a/src/components/ha-selector/ha-selector-target.ts b/src/components/ha-selector/ha-selector-target.ts index 60c93c8857..814b69275c 100644 --- a/src/components/ha-selector/ha-selector-target.ts +++ b/src/components/ha-selector/ha-selector-target.ts @@ -10,10 +10,10 @@ import { } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, } from "lit-element"; @@ -38,9 +38,9 @@ export class HaTargetSelector extends SubscribeMixin(LitElement) { @property() public label?: string; - @internalProperty() private _entityPlaformLookup?: Record; + @state() private _entityPlaformLookup?: Record; - @internalProperty() private _configEntries?: ConfigEntry[]; + @state() private _configEntries?: ConfigEntry[]; @property({ type: Boolean }) public disabled = false; @@ -153,7 +153,7 @@ export class HaTargetSelector extends SubscribeMixin(LitElement) { ); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-target-picker { display: block; diff --git a/src/components/ha-service-control.ts b/src/components/ha-service-control.ts index 8fab54997b..50ae36f237 100644 --- a/src/components/ha-service-control.ts +++ b/src/components/ha-service-control.ts @@ -6,10 +6,10 @@ import { } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -55,13 +55,13 @@ export class HaServiceControl extends LitElement { data?: Record; }; - @internalProperty() private _value!: this["value"]; + @state() private _value!: this["value"]; @property({ reflect: true, type: Boolean }) public narrow!: boolean; @property({ type: Boolean }) public showAdvanced?: boolean; - @internalProperty() private _checkedKeys = new Set(); + @state() private _checkedKeys = new Set(); @query("ha-yaml-editor") private _yamlEditor?: HaYamlEditor; @@ -407,7 +407,7 @@ export class HaServiceControl extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-settings-row { padding: var(--service-control-padding, 0 16px); diff --git a/src/components/ha-service-picker.ts b/src/components/ha-service-picker.ts index 17bff6027f..1f7d8449d2 100644 --- a/src/components/ha-service-picker.ts +++ b/src/components/ha-service-picker.ts @@ -1,4 +1,4 @@ -import { html, internalProperty, LitElement, property } from "lit-element"; +import { html, state, LitElement, property } from "lit-element"; import memoizeOne from "memoize-one"; import { fireEvent } from "../common/dom/fire_event"; import { LocalizeFunc } from "../common/translations/localize"; @@ -38,7 +38,7 @@ class HaServicePicker extends LitElement { @property() public value?: string; - @internalProperty() private _filter?: string; + @state() private _filter?: string; protected render() { return html` diff --git a/src/components/ha-settings-row.ts b/src/components/ha-settings-row.ts index 12f37bfe79..aa6f9d5707 100644 --- a/src/components/ha-settings-row.ts +++ b/src/components/ha-settings-row.ts @@ -1,7 +1,7 @@ import "@polymer/paper-item/paper-item-body"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -32,7 +32,7 @@ export class HaSettingsRow extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/components/ha-sidebar.ts b/src/components/ha-sidebar.ts index 83502db730..a3fe63f50d 100644 --- a/src/components/ha-sidebar.ts +++ b/src/components/ha-sidebar.ts @@ -15,14 +15,15 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, eventOptions, html, - internalProperty, + state, LitElement, property, PropertyValues, + CSSResult, } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import { guard } from "lit-html/directives/guard"; @@ -171,15 +172,15 @@ class HaSidebar extends LitElement { @property({ type: Boolean }) public editMode = false; - @internalProperty() private _externalConfig?: ExternalConfig; + @state() private _externalConfig?: ExternalConfig; - @internalProperty() private _notifications?: PersistentNotification[]; + @state() private _notifications?: PersistentNotification[]; // property used only in css // @ts-ignore @property({ type: Boolean, reflect: true }) public rtl = false; - @internalProperty() private _renderEmptySortable = false; + @state() private _renderEmptySortable = false; private _mouseLeaveTimeout?: number; @@ -524,7 +525,7 @@ class HaSidebar extends LitElement { ]); const style = document.createElement("style"); - style.innerHTML = sortStylesImport.sortableStyles.cssText; + style.innerHTML = (sortStylesImport.sortableStyles as CSSResult).cssText; this.shadowRoot!.appendChild(style); Sortable = sortableImport.Sortable; @@ -741,7 +742,7 @@ class HaSidebar extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleScrollbar, css` diff --git a/src/components/ha-svg-icon.ts b/src/components/ha-svg-icon.ts index ecc95d0d44..b803d3bc6d 100644 --- a/src/components/ha-svg-icon.ts +++ b/src/components/ha-svg-icon.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, LitElement, property, @@ -26,7 +26,7 @@ export class HaSvgIcon extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: var(--ha-icon-display, inline-flex); diff --git a/src/components/ha-switch.ts b/src/components/ha-switch.ts index ed5c123a1d..77ce4b30dd 100644 --- a/src/components/ha-switch.ts +++ b/src/components/ha-switch.ts @@ -1,7 +1,7 @@ import "@material/mwc-switch"; import type { Switch } from "@material/mwc-switch"; import { style } from "@material/mwc-switch/mwc-switch-css"; -import { css, CSSResult, customElement, property } from "lit-element"; +import { css, CSSResultGroup, customElement, property } from "lit-element"; import { forwardHaptic } from "../data/haptics"; import { Constructor } from "../types"; @@ -27,7 +27,7 @@ export class HaSwitch extends MwcSwitch { }); } - protected static get styles(): CSSResult[] { + protected static get styles(): CSSResultGroup { return [ style, css` diff --git a/src/components/ha-tab.ts b/src/components/ha-tab.ts index c887c6c440..7ab6364e09 100644 --- a/src/components/ha-tab.ts +++ b/src/components/ha-tab.ts @@ -3,11 +3,11 @@ import "@material/mwc-ripple/mwc-ripple"; import { RippleHandlers } from "@material/mwc-ripple/ripple-handlers"; import { css, - CSSResult, + CSSResultGroup, customElement, eventOptions, html, - internalProperty, + state, LitElement, property, queryAsync, @@ -27,7 +27,7 @@ export class HaTab extends LitElement { @queryAsync("mwc-ripple") private _ripple!: Promise; - @internalProperty() private _shouldRenderRipple = false; + @state() private _shouldRenderRipple = false; protected render(): TemplateResult { return html` @@ -92,7 +92,7 @@ export class HaTab extends LitElement { this._rippleHandlers.endFocus(); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` div { padding: 0 32px; diff --git a/src/components/ha-target-picker.ts b/src/components/ha-target-picker.ts index d082962d9b..b2ceeb39f1 100644 --- a/src/components/ha-target-picker.ts +++ b/src/components/ha-target-picker.ts @@ -16,10 +16,10 @@ import { } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -86,15 +86,15 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) { @property({ type: Boolean, reflect: true }) public disabled = false; - @internalProperty() private _areas?: { [areaId: string]: AreaRegistryEntry }; + @state() private _areas?: { [areaId: string]: AreaRegistryEntry }; - @internalProperty() private _devices?: { + @state() private _devices?: { [deviceId: string]: DeviceRegistryEntry; }; - @internalProperty() private _entities?: EntityRegistryEntry[]; + @state() private _entities?: EntityRegistryEntry[]; - @internalProperty() private _addMode?: "area_id" | "entity_id" | "device_id"; + @state() private _addMode?: "area_id" | "entity_id" | "device_id"; @query("#input") private _inputElement?; @@ -534,7 +534,7 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) { return true; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ${unsafeCSS(chipStyles)} .mdc-chip { diff --git a/src/components/ha-yaml-editor.ts b/src/components/ha-yaml-editor.ts index a702be77ac..f0eabb168d 100644 --- a/src/components/ha-yaml-editor.ts +++ b/src/components/ha-yaml-editor.ts @@ -2,7 +2,7 @@ import { safeDump, safeLoad } from "js-yaml"; import { customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -32,7 +32,7 @@ export class HaYamlEditor extends LitElement { @property() public label?: string; - @internalProperty() private _yaml = ""; + @state() private _yaml = ""; public setValue(value): void { try { diff --git a/src/components/map/ha-location-editor.ts b/src/components/map/ha-location-editor.ts index 8ba1ec3c2b..8a7954cba6 100644 --- a/src/components/map/ha-location-editor.ts +++ b/src/components/map/ha-location-editor.ts @@ -10,7 +10,7 @@ import { } from "leaflet"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -271,7 +271,7 @@ class LocationEditor extends LitElement { (this._locationMarker as Circle).setStyle({ color: this.radiusColor }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/components/map/ha-locations-editor.ts b/src/components/map/ha-locations-editor.ts index 5991f36706..2dda009670 100644 --- a/src/components/map/ha-locations-editor.ts +++ b/src/components/map/ha-locations-editor.ts @@ -10,7 +10,7 @@ import { } from "leaflet"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -303,7 +303,7 @@ export class HaLocationsEditor extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/components/map/ha-map.ts b/src/components/map/ha-map.ts index 98113ab100..3e4df08b30 100644 --- a/src/components/map/ha-map.ts +++ b/src/components/map/ha-map.ts @@ -1,7 +1,7 @@ import { Circle, Layer, Map, Marker, TileLayer } from "leaflet"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -326,7 +326,7 @@ class HaMap extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/components/media-player/dialog-media-player-browse.ts b/src/components/media-player/dialog-media-player-browse.ts index 3ef4f00c04..ba885213fa 100644 --- a/src/components/media-player/dialog-media-player-browse.ts +++ b/src/components/media-player/dialog-media-player-browse.ts @@ -1,9 +1,9 @@ import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -23,15 +23,15 @@ import { MediaPlayerBrowseDialogParams } from "./show-media-browser-dialog"; class DialogMediaPlayerBrowse extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _entityId!: string; + @state() private _entityId!: string; - @internalProperty() private _mediaContentId?: string; + @state() private _mediaContentId?: string; - @internalProperty() private _mediaContentType?: string; + @state() private _mediaContentType?: string; - @internalProperty() private _action?: MediaPlayerBrowseAction; + @state() private _action?: MediaPlayerBrowseAction; - @internalProperty() private _params?: MediaPlayerBrowseDialogParams; + @state() private _params?: MediaPlayerBrowseDialogParams; public showDialog(params: MediaPlayerBrowseDialogParams): void { this._params = params; @@ -81,7 +81,7 @@ class DialogMediaPlayerBrowse extends LitElement { } } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/components/media-player/ha-media-player-browse.ts b/src/components/media-player/ha-media-player-browse.ts index 88ccff39d1..1c7e093527 100644 --- a/src/components/media-player/ha-media-player-browse.ts +++ b/src/components/media-player/ha-media-player-browse.ts @@ -7,11 +7,11 @@ import "@polymer/paper-listbox/paper-listbox"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResultArray, + CSSResultGroup, customElement, eventOptions, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -72,11 +72,11 @@ export class HaMediaPlayerBrowse extends LitElement { @property({ type: Boolean, attribute: "scroll", reflect: true }) private _scrolled = false; - @internalProperty() private _loading = false; + @state() private _loading = false; - @internalProperty() private _error?: { message: string; code: string }; + @state() private _error?: { message: string; code: string }; - @internalProperty() private _mediaPlayerItems: MediaPlayerItem[] = []; + @state() private _mediaPlayerItems: MediaPlayerItem[] = []; @query(".header") private _header?: HTMLDivElement; @@ -610,7 +610,7 @@ export class HaMediaPlayerBrowse extends LitElement { return html`${err.message}`; } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/components/state-history-charts.ts b/src/components/state-history-charts.ts index 49ac8049c5..20abd72ae2 100644 --- a/src/components/state-history-charts.ts +++ b/src/components/state-history-charts.ts @@ -1,7 +1,7 @@ import "./ha-circular-progress"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -98,7 +98,7 @@ class StateHistoryCharts extends LitElement { return !this.isLoadingData && historyDataEmpty; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/components/trace/ha-timeline.ts b/src/components/trace/ha-timeline.ts index d9572c4a67..4ce8b7b495 100644 --- a/src/components/trace/ha-timeline.ts +++ b/src/components/trace/ha-timeline.ts @@ -6,7 +6,7 @@ import { css, property, TemplateResult, - internalProperty, + state, } from "lit-element"; import { buttonLinkStyle } from "../../resources/styles"; import "../ha-svg-icon"; @@ -23,7 +23,7 @@ export class HaTimeline extends LitElement { @property({ attribute: false }) public moreItems?: TemplateResult[]; - @internalProperty() private _showMore = false; + @state() private _showMore = false; protected render() { return html` diff --git a/src/components/trace/hat-trace-timeline.ts b/src/components/trace/hat-trace-timeline.ts index 49898be86f..ea6746322e 100644 --- a/src/components/trace/hat-trace-timeline.ts +++ b/src/components/trace/hat-trace-timeline.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -568,7 +568,7 @@ export class HaAutomationTracer extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ css` ha-timeline[lastItem].condition { diff --git a/src/components/user/ha-person-badge.ts b/src/components/user/ha-person-badge.ts index eead0784c2..07cdd916ac 100644 --- a/src/components/user/ha-person-badge.ts +++ b/src/components/user/ha-person-badge.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -37,7 +37,7 @@ class PersonBadge extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: contents; diff --git a/src/components/user/ha-user-badge.ts b/src/components/user/ha-user-badge.ts index cb978dd004..3e5411d8dc 100644 --- a/src/components/user/ha-user-badge.ts +++ b/src/components/user/ha-user-badge.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -36,7 +36,7 @@ class UserBadge extends LitElement { @property({ attribute: false }) public user?: User | CurrentUser; - @internalProperty() private _personPicture?: string; + @state() private _personPicture?: string; private _personEntityId?: string; @@ -53,9 +53,9 @@ class UserBadge extends LitElement { this.hass.states[this._personEntityId] !== oldHass.states[this._personEntityId] ) { - const state = this.hass.states[this._personEntityId]; - if (state) { - this._personPicture = state.attributes.entity_picture; + const entityState = this.hass.states[this._personEntityId]; + if (entityState) { + this._personPicture = entityState.attributes.entity_picture; } else { this._getPersonPicture(); } @@ -102,7 +102,7 @@ class UserBadge extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: contents; diff --git a/src/components/user/ha-user-picker.ts b/src/components/user/ha-user-picker.ts index e8cd417bc6..9a028ad7c6 100644 --- a/src/components/user/ha-user-picker.ts +++ b/src/components/user/ha-user-picker.ts @@ -5,7 +5,7 @@ import "@polymer/paper-item/paper-item-body"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, html, LitElement, property, @@ -96,7 +96,7 @@ class HaUserPicker extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: inline-block; diff --git a/src/components/user/ha-users-picker.ts b/src/components/user/ha-users-picker.ts index 36a8012596..886307f5f1 100644 --- a/src/components/user/ha-users-picker.ts +++ b/src/components/user/ha-users-picker.ts @@ -1,7 +1,7 @@ import { mdiClose } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -149,7 +149,7 @@ class HaUsersPickerLight extends LitElement { this._updateUsers(this._currentUsers.filter((user) => user !== userId)); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts index ece523c8fa..442be29383 100644 --- a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts +++ b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -28,15 +28,15 @@ import { ConfigEntrySystemOptionsDialogParams } from "./show-dialog-config-entry class DialogConfigEntrySystemOptions extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _disableNewEntities!: boolean; + @state() private _disableNewEntities!: boolean; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _params?: ConfigEntrySystemOptionsDialogParams; + @state() private _params?: ConfigEntrySystemOptionsDialogParams; - @internalProperty() private _loading = false; + @state() private _loading = false; - @internalProperty() private _submitting = false; + @state() private _submitting = false; public async showDialog( params: ConfigEntrySystemOptionsDialogParams @@ -154,7 +154,7 @@ class DialogConfigEntrySystemOptions extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/dialogs/config-flow/dialog-data-entry-flow.ts b/src/dialogs/config-flow/dialog-data-entry-flow.ts index c4cb084fab..86529c24dc 100644 --- a/src/dialogs/config-flow/dialog-data-entry-flow.ts +++ b/src/dialogs/config-flow/dialog-data-entry-flow.ts @@ -3,10 +3,10 @@ import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import type { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, PropertyValues, TemplateResult, @@ -61,27 +61,27 @@ declare global { class DataEntryFlowDialog extends LitElement { public hass!: HomeAssistant; - @internalProperty() private _params?: DataEntryFlowDialogParams; + @state() private _params?: DataEntryFlowDialogParams; - @internalProperty() private _loading = true; + @state() private _loading = true; private _instance = instance; - @internalProperty() private _step: + @state() private _step: | DataEntryFlowStep | undefined // Null means we need to pick a config flow | null; - @internalProperty() private _devices?: DeviceRegistryEntry[]; + @state() private _devices?: DeviceRegistryEntry[]; - @internalProperty() private _areas?: AreaRegistryEntry[]; + @state() private _areas?: AreaRegistryEntry[]; - @internalProperty() private _handlers?: string[]; + @state() private _handlers?: string[]; - @internalProperty() private _handler?: string; + @state() private _handler?: string; - @internalProperty() private _flowsInProgress?: DataEntryFlowProgress[]; + @state() private _flowsInProgress?: DataEntryFlowProgress[]; private _unsubAreas?: UnsubscribeFunc; @@ -400,7 +400,7 @@ class DataEntryFlowDialog extends LitElement { this._step = step; } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/dialogs/config-flow/step-flow-abort.ts b/src/dialogs/config-flow/step-flow-abort.ts index 7309ff2226..041e681e15 100644 --- a/src/dialogs/config-flow/step-flow-abort.ts +++ b/src/dialogs/config-flow/step-flow-abort.ts @@ -1,6 +1,6 @@ import "@material/mwc-button"; import { - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -47,7 +47,7 @@ class StepFlowAbort extends LitElement { fireEvent(this, "flow-update", { step: undefined }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return configFlowContentStyles; } } diff --git a/src/dialogs/config-flow/step-flow-create-entry.ts b/src/dialogs/config-flow/step-flow-create-entry.ts index 46b67ab1a6..8ee662ba66 100644 --- a/src/dialogs/config-flow/step-flow-create-entry.ts +++ b/src/dialogs/config-flow/step-flow-create-entry.ts @@ -4,7 +4,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -109,7 +109,7 @@ class StepFlowCreateEntry extends LitElement { } } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ configFlowContentStyles, css` diff --git a/src/dialogs/config-flow/step-flow-external.ts b/src/dialogs/config-flow/step-flow-external.ts index 3f9c84bbc7..28261e6433 100644 --- a/src/dialogs/config-flow/step-flow-external.ts +++ b/src/dialogs/config-flow/step-flow-external.ts @@ -1,7 +1,7 @@ import "@material/mwc-button"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -48,7 +48,7 @@ class StepFlowExternal extends LitElement { window.open(this.step.url); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ configFlowContentStyles, css` diff --git a/src/dialogs/config-flow/step-flow-form.ts b/src/dialogs/config-flow/step-flow-form.ts index 5c569873d6..f168cc68e2 100644 --- a/src/dialogs/config-flow/step-flow-form.ts +++ b/src/dialogs/config-flow/step-flow-form.ts @@ -2,7 +2,7 @@ import "@material/mwc-button"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -183,7 +183,7 @@ class StepFlowForm extends LitElement { private _errorCallback = (error: string) => this.flowConfig.renderShowFormStepFieldError(this.hass, this.step, error); - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ configFlowContentStyles, css` diff --git a/src/dialogs/config-flow/step-flow-loading.ts b/src/dialogs/config-flow/step-flow-loading.ts index 8b4d28735b..c8df08ae34 100644 --- a/src/dialogs/config-flow/step-flow-loading.ts +++ b/src/dialogs/config-flow/step-flow-loading.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -22,7 +22,7 @@ class StepFlowLoading extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .init-spinner { padding: 50px 100px; diff --git a/src/dialogs/config-flow/step-flow-pick-flow.ts b/src/dialogs/config-flow/step-flow-pick-flow.ts index b75f2e3b38..94f4ae203e 100644 --- a/src/dialogs/config-flow/step-flow-pick-flow.ts +++ b/src/dialogs/config-flow/step-flow-pick-flow.ts @@ -3,7 +3,7 @@ import "@polymer/paper-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -89,7 +89,7 @@ class StepFlowPickFlow extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ configFlowContentStyles, css` diff --git a/src/dialogs/config-flow/step-flow-pick-handler.ts b/src/dialogs/config-flow/step-flow-pick-handler.ts index 660416a71e..4ab3e2eeda 100644 --- a/src/dialogs/config-flow/step-flow-pick-handler.ts +++ b/src/dialogs/config-flow/step-flow-pick-handler.ts @@ -3,10 +3,10 @@ import "@polymer/paper-item/paper-item-body"; import Fuse from "fuse.js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -46,7 +46,7 @@ class StepFlowPickHandler extends LitElement { @property() public showAdvanced?: boolean; - @internalProperty() private _filter?: string; + @state() private _filter?: string; private _width?: number; @@ -175,7 +175,7 @@ class StepFlowPickHandler extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ configFlowContentStyles, css` diff --git a/src/dialogs/config-flow/step-flow-progress.ts b/src/dialogs/config-flow/step-flow-progress.ts index fc12f9b5c5..347a178d95 100644 --- a/src/dialogs/config-flow/step-flow-progress.ts +++ b/src/dialogs/config-flow/step-flow-progress.ts @@ -1,7 +1,7 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -39,7 +39,7 @@ class StepFlowProgress extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ configFlowContentStyles, css` diff --git a/src/dialogs/domain-toggler/dialog-domain-toggler.ts b/src/dialogs/domain-toggler/dialog-domain-toggler.ts index 4b2aa3aea4..e07d2d9b4a 100644 --- a/src/dialogs/domain-toggler/dialog-domain-toggler.ts +++ b/src/dialogs/domain-toggler/dialog-domain-toggler.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -24,7 +24,7 @@ class DomainTogglerDialog implements HassDialog { public hass!: HomeAssistant; - @internalProperty() private _params?: HaDomainTogglerDialogParams; + @state() private _params?: HaDomainTogglerDialogParams; public showDialog(params: HaDomainTogglerDialogParams): void { this._params = params; @@ -91,7 +91,7 @@ class DomainTogglerDialog ev.currentTarget.blur(); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/dialogs/generic/dialog-box.ts b/src/dialogs/generic/dialog-box.ts index 3dcbbd37f8..5ccd33d199 100644 --- a/src/dialogs/generic/dialog-box.ts +++ b/src/dialogs/generic/dialog-box.ts @@ -2,10 +2,10 @@ import "@material/mwc-button/mwc-button"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -23,9 +23,9 @@ import { DialogBoxParams } from "./show-dialog-box"; class DialogBox extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _params?: DialogBoxParams; + @state() private _params?: DialogBoxParams; - @internalProperty() private _value?: string; + @state() private _value?: string; public async showDialog(params: DialogBoxParams): Promise { this._params = params; @@ -154,7 +154,7 @@ class DialogBox extends LitElement { fireEvent(this, "dialog-closed", { dialog: this.localName }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts b/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts index 82dd0bc958..2571ae29fe 100644 --- a/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts +++ b/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts @@ -4,10 +4,10 @@ import Cropper from "cropperjs"; import cropperCss from "cropperjs/dist/cropper.css"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -25,9 +25,9 @@ import { HaImageCropperDialogParams } from "./show-image-cropper-dialog"; export class HaImagecropperDialog extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _params?: HaImageCropperDialogParams; + @state() private _params?: HaImageCropperDialogParams; - @internalProperty() private _open = false; + @state() private _open = false; @query("img", true) private _image!: HTMLImageElement; @@ -104,7 +104,7 @@ export class HaImagecropperDialog extends LitElement { ); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/dialogs/more-info/controls/more-info-automation.ts b/src/dialogs/more-info/controls/more-info-automation.ts index 293b56f6ad..cdd9fe7729 100644 --- a/src/dialogs/more-info/controls/more-info-automation.ts +++ b/src/dialogs/more-info/controls/more-info-automation.ts @@ -2,7 +2,7 @@ import "@material/mwc-button"; import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -50,7 +50,7 @@ class MoreInfoAutomation extends LitElement { triggerAutomationActions(this.hass, this.stateObj!.entity_id); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .flex { display: flex; diff --git a/src/dialogs/more-info/controls/more-info-camera.ts b/src/dialogs/more-info/controls/more-info-camera.ts index d5ed6dfb5c..1dfcd4157e 100644 --- a/src/dialogs/more-info/controls/more-info-camera.ts +++ b/src/dialogs/more-info/controls/more-info-camera.ts @@ -2,9 +2,9 @@ import "@polymer/paper-checkbox/paper-checkbox"; import type { PaperCheckboxElement } from "@polymer/paper-checkbox/paper-checkbox"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -27,9 +27,9 @@ class MoreInfoCamera extends LitElement { @property() public stateObj?: CameraEntity; - @internalProperty() private _cameraPrefs?: CameraPreferences; + @state() private _cameraPrefs?: CameraPreferences; - @internalProperty() private _attached = false; + @state() private _attached = false; public connectedCallback() { super.connectedCallback(); @@ -113,7 +113,7 @@ class MoreInfoCamera extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/dialogs/more-info/controls/more-info-climate.ts b/src/dialogs/more-info/controls/more-info-climate.ts index 02d48e8a1b..bd80dfc223 100644 --- a/src/dialogs/more-info/controls/more-info-climate.ts +++ b/src/dialogs/more-info/controls/more-info-climate.ts @@ -3,7 +3,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, html, LitElement, property, @@ -437,7 +437,7 @@ class MoreInfoClimate extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { color: var(--primary-text-color); diff --git a/src/dialogs/more-info/controls/more-info-counter.ts b/src/dialogs/more-info/controls/more-info-counter.ts index 330f504f50..fcdff2f781 100644 --- a/src/dialogs/more-info/controls/more-info-counter.ts +++ b/src/dialogs/more-info/controls/more-info-counter.ts @@ -2,7 +2,7 @@ import "@material/mwc-button"; import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -59,7 +59,7 @@ class MoreInfoCounter extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .actions { margin: 8px 0; diff --git a/src/dialogs/more-info/controls/more-info-group.ts b/src/dialogs/more-info/controls/more-info-group.ts index 615bf3314d..597cf1d5a4 100644 --- a/src/dialogs/more-info/controls/more-info-group.ts +++ b/src/dialogs/more-info/controls/more-info-group.ts @@ -1,8 +1,8 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, - internalProperty, + CSSResultGroup, + state, LitElement, property, PropertyValues, @@ -23,9 +23,9 @@ class MoreInfoGroup extends LitElement { @property() public stateObj?: GroupEntity; - @internalProperty() private _groupDomainStateObj?: HassEntity; + @state() private _groupDomainStateObj?: HassEntity; - @internalProperty() private _moreInfoType?: string; + @state() private _moreInfoType?: string; protected updated(changedProperties: PropertyValues) { if ( @@ -38,7 +38,7 @@ class MoreInfoGroup extends LitElement { const states = this.stateObj.attributes.entity_id .map((entity_id) => this.hass.states[entity_id]) - .filter((state) => state); + .filter((entityState) => entityState); if (!states.length) { this._groupDomainStateObj = undefined; @@ -53,7 +53,9 @@ class MoreInfoGroup extends LitElement { // first child above the children of the current group if ( groupDomain !== "group" && - states.every((state) => groupDomain === computeStateDomain(state)) + states.every( + (entityState) => groupDomain === computeStateDomain(entityState) + ) ) { this._groupDomainStateObj = { ...baseStateObj, @@ -80,20 +82,20 @@ class MoreInfoGroup extends LitElement { }) : ""} ${this.stateObj.attributes.entity_id.map((entity_id) => { - const state = this.hass!.states[entity_id]; - if (!state) { + const entityState = this.hass!.states[entity_id]; + if (!entityState) { return ""; } return html` `; })}`; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` state-card-content { display: block; diff --git a/src/dialogs/more-info/controls/more-info-humidifier.ts b/src/dialogs/more-info/controls/more-info-humidifier.ts index 56f89af45d..7a118a2521 100644 --- a/src/dialogs/more-info/controls/more-info-humidifier.ts +++ b/src/dialogs/more-info/controls/more-info-humidifier.ts @@ -3,7 +3,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, html, LitElement, property, @@ -171,7 +171,7 @@ class MoreInfoHumidifier extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { color: var(--primary-text-color); diff --git a/src/dialogs/more-info/controls/more-info-light.ts b/src/dialogs/more-info/controls/more-info-light.ts index 18e355b81f..2cff114519 100644 --- a/src/dialogs/more-info/controls/more-info-light.ts +++ b/src/dialogs/more-info/controls/more-info-light.ts @@ -2,10 +2,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -41,27 +41,27 @@ class MoreInfoLight extends LitElement { @property({ attribute: false }) public stateObj?: LightEntity; - @internalProperty() private _brightnessSliderValue = 0; + @state() private _brightnessSliderValue = 0; - @internalProperty() private _ctSliderValue?: number; + @state() private _ctSliderValue?: number; - @internalProperty() private _cwSliderValue?: number; + @state() private _cwSliderValue?: number; - @internalProperty() private _wwSliderValue?: number; + @state() private _wwSliderValue?: number; - @internalProperty() private _wvSliderValue?: number; + @state() private _wvSliderValue?: number; - @internalProperty() private _colorBrightnessSliderValue?: number; + @state() private _colorBrightnessSliderValue?: number; - @internalProperty() private _brightnessAdjusted?: number; + @state() private _brightnessAdjusted?: number; - @internalProperty() private _hueSegments = 24; + @state() private _hueSegments = 24; - @internalProperty() private _saturationSegments = 8; + @state() private _saturationSegments = 8; - @internalProperty() private _colorPickerColor?: [number, number, number]; + @state() private _colorPickerColor?: [number, number, number]; - @internalProperty() private _mode?: "color" | LightColorModes.COLOR_TEMP; + @state() private _mode?: "color" | LightColorModes.COLOR_TEMP; protected render(): TemplateResult { if (!this.hass || !this.stateObj) { @@ -539,7 +539,7 @@ class MoreInfoLight extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .content { display: flex; diff --git a/src/dialogs/more-info/controls/more-info-media_player.ts b/src/dialogs/more-info/controls/more-info-media_player.ts index 95ebc74d26..c617a8f761 100644 --- a/src/dialogs/more-info/controls/more-info-media_player.ts +++ b/src/dialogs/more-info/controls/more-info-media_player.ts @@ -6,7 +6,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -203,7 +203,7 @@ class MoreInfoMediaPlayer extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-icon-button[action="turn_off"], ha-icon-button[action="turn_on"], diff --git a/src/dialogs/more-info/controls/more-info-person.ts b/src/dialogs/more-info/controls/more-info-person.ts index 4caa2ea3d3..57e8e38470 100644 --- a/src/dialogs/more-info/controls/more-info-person.ts +++ b/src/dialogs/more-info/controls/more-info-person.ts @@ -2,7 +2,7 @@ import "@material/mwc-button"; import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -68,7 +68,7 @@ class MoreInfoPerson extends LitElement { fireEvent(this, "hass-more-info", { entityId: null }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .flex { display: flex; diff --git a/src/dialogs/more-info/controls/more-info-remote.ts b/src/dialogs/more-info/controls/more-info-remote.ts index 276b862b33..e144094c8d 100644 --- a/src/dialogs/more-info/controls/more-info-remote.ts +++ b/src/dialogs/more-info/controls/more-info-remote.ts @@ -2,7 +2,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -75,7 +75,7 @@ class MoreInfoRemote extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` paper-item { cursor: pointer; diff --git a/src/dialogs/more-info/controls/more-info-script.ts b/src/dialogs/more-info/controls/more-info-script.ts index 1c364318b9..61005dda6a 100644 --- a/src/dialogs/more-info/controls/more-info-script.ts +++ b/src/dialogs/more-info/controls/more-info-script.ts @@ -1,7 +1,7 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -42,7 +42,7 @@ class MoreInfoScript extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .flex { display: flex; diff --git a/src/dialogs/more-info/controls/more-info-sun.ts b/src/dialogs/more-info/controls/more-info-sun.ts index 22904234d5..9f8b49d71e 100644 --- a/src/dialogs/more-info/controls/more-info-sun.ts +++ b/src/dialogs/more-info/controls/more-info-sun.ts @@ -1,7 +1,7 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -68,7 +68,7 @@ class MoreInfoSun extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .row { margin: 0; diff --git a/src/dialogs/more-info/controls/more-info-timer.ts b/src/dialogs/more-info/controls/more-info-timer.ts index 80f8819009..a9b07bfb81 100644 --- a/src/dialogs/more-info/controls/more-info-timer.ts +++ b/src/dialogs/more-info/controls/more-info-timer.ts @@ -1,7 +1,7 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -73,7 +73,7 @@ class MoreInfoTimer extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .actions { margin: 8px 0; diff --git a/src/dialogs/more-info/controls/more-info-vacuum.ts b/src/dialogs/more-info/controls/more-info-vacuum.ts index f6285c28d2..99716e91aa 100644 --- a/src/dialogs/more-info/controls/more-info-vacuum.ts +++ b/src/dialogs/more-info/controls/more-info-vacuum.ts @@ -2,7 +2,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -224,7 +224,7 @@ class MoreInfoVacuum extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { line-height: 1.5; diff --git a/src/dialogs/more-info/controls/more-info-weather.ts b/src/dialogs/more-info/controls/more-info-weather.ts index 0f2b63313d..dc4a529985 100644 --- a/src/dialogs/more-info/controls/more-info-weather.ts +++ b/src/dialogs/more-info/controls/more-info-weather.ts @@ -22,7 +22,7 @@ import { import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, LitElement, property, @@ -224,7 +224,7 @@ class MoreInfoWeather extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-svg-icon { color: var(--paper-item-icon-color); diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 0e57bc9112..493c04f245 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -7,7 +7,7 @@ import { css, customElement, html, - internalProperty, + state, LitElement, property, } from "lit-element"; @@ -58,9 +58,9 @@ export class MoreInfoDialog extends LitElement { @property({ type: Boolean, reflect: true }) public large = false; - @internalProperty() private _entityId?: string | null; + @state() private _entityId?: string | null; - @internalProperty() private _currTabIndex = 0; + @state() private _currTabIndex = 0; public showDialog(params: MoreInfoDialogParams) { this._entityId = params.entityId; diff --git a/src/dialogs/more-info/ha-more-info-history.ts b/src/dialogs/more-info/ha-more-info-history.ts index eb393e3395..2374ccd7e4 100644 --- a/src/dialogs/more-info/ha-more-info-history.ts +++ b/src/dialogs/more-info/ha-more-info-history.ts @@ -1,7 +1,7 @@ import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -20,7 +20,7 @@ export class MoreInfoHistory extends LitElement { @property() public entityId!: string; - @internalProperty() private _stateHistory?: HistoryResult; + @state() private _stateHistory?: HistoryResult; private _throttleGetStateHistory = throttle(() => { this._getStateHistory(); diff --git a/src/dialogs/more-info/ha-more-info-logbook.ts b/src/dialogs/more-info/ha-more-info-logbook.ts index 397dc10fc4..2af0eb69f4 100644 --- a/src/dialogs/more-info/ha-more-info-logbook.ts +++ b/src/dialogs/more-info/ha-more-info-logbook.ts @@ -2,7 +2,7 @@ import { css, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -26,11 +26,11 @@ export class MoreInfoLogbook extends LitElement { @property() public entityId!: string; - @internalProperty() private _logbookEntries?: LogbookEntry[]; + @state() private _logbookEntries?: LogbookEntry[]; - @internalProperty() private _traceContexts?: TraceContexts; + @state() private _traceContexts?: TraceContexts; - @internalProperty() private _persons = {}; + @state() private _persons = {}; private _lastLogbookDate?: Date; diff --git a/src/dialogs/more-info/more-info-content.ts b/src/dialogs/more-info/more-info-content.ts index 4adae879ad..0c5ddab96c 100644 --- a/src/dialogs/more-info/more-info-content.ts +++ b/src/dialogs/more-info/more-info-content.ts @@ -1,17 +1,21 @@ import { HassEntity } from "home-assistant-js-websocket"; -import { property, PropertyValues, UpdatingElement } from "lit-element"; +import { property, PropertyValues, ReactiveElement } from "lit-element"; import dynamicContentUpdater from "../../common/dom/dynamic_content_updater"; import { importMoreInfoControl } from "../../panels/lovelace/custom-card-helpers"; import { HomeAssistant } from "../../types"; import { stateMoreInfoType } from "./state_more_info_control"; -class MoreInfoContent extends UpdatingElement { +class MoreInfoContent extends ReactiveElement { @property({ attribute: false }) public hass?: HomeAssistant; @property({ attribute: false }) public stateObj?: HassEntity; private _detachedChild?: ChildNode; + protected createRenderRoot() { + return this; + } + // This is not a lit element, but an updating element, so we implement update protected update(changedProps: PropertyValues): void { super.update(changedProps); diff --git a/src/dialogs/notifications/notification-item-template.ts b/src/dialogs/notifications/notification-item-template.ts index f6b5d319d8..28fb986784 100644 --- a/src/dialogs/notifications/notification-item-template.ts +++ b/src/dialogs/notifications/notification-item-template.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -20,7 +20,7 @@ export class HuiNotificationItemTemplate extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .contents { padding: 16px; diff --git a/src/dialogs/notifications/persistent-notification-item.ts b/src/dialogs/notifications/persistent-notification-item.ts index 44cab069de..cb66b0fad8 100644 --- a/src/dialogs/notifications/persistent-notification-item.ts +++ b/src/dialogs/notifications/persistent-notification-item.ts @@ -2,7 +2,7 @@ import "@material/mwc-button"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -57,7 +57,7 @@ export class HuiPersistentNotificationItem extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .time { display: flex; diff --git a/src/dialogs/quick-bar/ha-quick-bar.ts b/src/dialogs/quick-bar/ha-quick-bar.ts index a570e6a699..b398a9759c 100644 --- a/src/dialogs/quick-bar/ha-quick-bar.ts +++ b/src/dialogs/quick-bar/ha-quick-bar.ts @@ -15,7 +15,7 @@ import { css, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -87,19 +87,19 @@ type BaseNavigationCommand = Pick< export class QuickBar extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _commandItems?: CommandItem[]; + @state() private _commandItems?: CommandItem[]; - @internalProperty() private _entityItems?: EntityItem[]; + @state() private _entityItems?: EntityItem[]; - @internalProperty() private _filter = ""; + @state() private _filter = ""; - @internalProperty() private _search = ""; + @state() private _search = ""; - @internalProperty() private _opened = false; + @state() private _opened = false; - @internalProperty() private _commandMode = false; + @state() private _commandMode = false; - @internalProperty() private _done = false; + @state() private _done = false; @query("paper-input", false) private _filterInputField?: HTMLElement; diff --git a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts index 31c573e52d..62e9ae5c93 100644 --- a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts +++ b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts @@ -4,10 +4,10 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -46,16 +46,16 @@ export class HaVoiceCommandDialog extends LitElement { @property() public results: Results | null = null; - @internalProperty() private _conversation: Message[] = [ + @state() private _conversation: Message[] = [ { who: "hass", text: "", }, ]; - @internalProperty() private _opened = false; + @state() private _opened = false; - @internalProperty() private _agentInfo?: AgentInfo; + @state() private _agentInfo?: AgentInfo; @query("#messages", true) private messages!: PaperDialogScrollableElement; @@ -360,7 +360,7 @@ export class HaVoiceCommandDialog extends LitElement { return `message ${message.who} ${message.error ? " error" : ""}`; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/entrypoints/custom-panel.ts b/src/entrypoints/custom-panel.ts index de6df8758a..711bb6db64 100644 --- a/src/entrypoints/custom-panel.ts +++ b/src/entrypoints/custom-panel.ts @@ -10,6 +10,7 @@ import { createCustomPanelElement } from "../util/custom-panel/create-custom-pan import { loadCustomPanel } from "../util/custom-panel/load-custom-panel"; import { setCustomPanelProperties } from "../util/custom-panel/set-custom-panel-properties"; import { baseEntrypointStyles } from "../resources/styles"; +import { CSSResult } from "lit-element"; declare global { interface Window { @@ -101,7 +102,7 @@ function initialize( } const errorStyle = document.createElement("style"); - errorStyle.innerHTML = baseEntrypointStyles.cssText; + errorStyle.innerHTML = (baseEntrypointStyles as CSSResult).cssText; document.body.appendChild(errorStyle); errorScreen.hass = properties.hass; diff --git a/src/layouts/ha-init-page.ts b/src/layouts/ha-init-page.ts index e0fa8384c5..0d657ec304 100644 --- a/src/layouts/ha-init-page.ts +++ b/src/layouts/ha-init-page.ts @@ -1,5 +1,5 @@ import "@material/mwc-button"; -import { css, CSSResult, html, LitElement, property } from "lit-element"; +import { css, CSSResultGroup, html, LitElement, property } from "lit-element"; import "../components/ha-circular-progress"; import { removeInitSkeleton } from "../util/init-skeleton"; @@ -43,7 +43,7 @@ class HaInitPage extends LitElement { location.reload(); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` div { height: 100%; diff --git a/src/layouts/hass-error-screen.ts b/src/layouts/hass-error-screen.ts index b335218f03..e80a37e0e8 100644 --- a/src/layouts/hass-error-screen.ts +++ b/src/layouts/hass-error-screen.ts @@ -1,7 +1,7 @@ import "@material/mwc-button"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -58,7 +58,7 @@ class HassErrorScreen extends LitElement { history.back(); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ css` :host { diff --git a/src/layouts/hass-loading-screen.ts b/src/layouts/hass-loading-screen.ts index 763622b3c1..d2f08eb69f 100644 --- a/src/layouts/hass-loading-screen.ts +++ b/src/layouts/hass-loading-screen.ts @@ -1,7 +1,7 @@ import "@polymer/app-layout/app-toolbar/app-toolbar"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -54,7 +54,7 @@ class HassLoadingScreen extends LitElement { history.back(); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/layouts/hass-router-page.ts b/src/layouts/hass-router-page.ts index 450e331a73..4c88766031 100644 --- a/src/layouts/hass-router-page.ts +++ b/src/layouts/hass-router-page.ts @@ -1,4 +1,4 @@ -import { property, PropertyValues, UpdatingElement } from "lit-element"; +import { property, PropertyValues, ReactiveElement } from "lit-element"; import memoizeOne from "memoize-one"; import { navigate } from "../common/navigate"; import { Route } from "../types"; @@ -46,7 +46,7 @@ export interface RouterOptions { // Time to wait for code to load before we show loading screen. const LOADING_SCREEN_THRESHOLD = 400; // ms -export class HassRouterPage extends UpdatingElement { +export class HassRouterPage extends ReactiveElement { @property() public route?: Route; protected routerOptions!: RouterOptions; @@ -72,6 +72,10 @@ export class HassRouterPage extends UpdatingElement { }; }); + protected createRenderRoot() { + return this; + } + protected update(changedProps: PropertyValues) { super.update(changedProps); diff --git a/src/layouts/hass-subpage.ts b/src/layouts/hass-subpage.ts index 780fdb068b..1b100c3892 100644 --- a/src/layouts/hass-subpage.ts +++ b/src/layouts/hass-subpage.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, eventOptions, html, @@ -62,7 +62,7 @@ class HassSubpage extends LitElement { history.back(); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/layouts/hass-tabs-subpage-data-table.ts b/src/layouts/hass-tabs-subpage-data-table.ts index 1c46a6caba..2b9687b20d 100644 --- a/src/layouts/hass-tabs-subpage-data-table.ts +++ b/src/layouts/hass-tabs-subpage-data-table.ts @@ -3,7 +3,7 @@ import { mdiFilterVariant } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -238,7 +238,7 @@ export class HaTabsSubpageDataTable extends LitElement { fireEvent(this, "clear-filter"); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-data-table { width: 100%; diff --git a/src/layouts/hass-tabs-subpage.ts b/src/layouts/hass-tabs-subpage.ts index 23c599e613..448c6e3e17 100644 --- a/src/layouts/hass-tabs-subpage.ts +++ b/src/layouts/hass-tabs-subpage.ts @@ -1,11 +1,11 @@ import "@material/mwc-ripple"; import { css, - CSSResult, + CSSResultGroup, customElement, eventOptions, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -62,7 +62,7 @@ class HassTabsSubpage extends LitElement { @property({ type: Boolean, reflect: true }) public rtl = false; - @internalProperty() private _activeTab?: PageNavigation; + @state() private _activeTab?: PageNavigation; // @ts-ignore @restoreScroll(".content") private _savedScrollPos?: number; @@ -201,7 +201,7 @@ class HassTabsSubpage extends LitElement { history.back(); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/layouts/home-assistant-main.ts b/src/layouts/home-assistant-main.ts index f90e26b861..78e0630db0 100644 --- a/src/layouts/home-assistant-main.ts +++ b/src/layouts/home-assistant-main.ts @@ -4,10 +4,10 @@ import "@polymer/app-layout/app-drawer/app-drawer"; import type { AppDrawerElement } from "@polymer/app-layout/app-drawer/app-drawer"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -46,7 +46,7 @@ class HomeAssistantMain extends LitElement { @property({ type: Boolean }) public narrow?: boolean; - @internalProperty() private _sidebarEditMode = false; + @state() private _sidebarEditMode = false; protected render(): TemplateResult { const hass = this.hass; @@ -186,7 +186,7 @@ class HomeAssistantMain extends LitElement { return this.shadowRoot!.querySelector("app-drawer-layout")!; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { color: var(--primary-text-color); diff --git a/src/layouts/home-assistant.ts b/src/layouts/home-assistant.ts index 42abe399ce..675781d5a5 100644 --- a/src/layouts/home-assistant.ts +++ b/src/layouts/home-assistant.ts @@ -1,10 +1,5 @@ import "@polymer/app-route/app-location"; -import { - customElement, - html, - internalProperty, - PropertyValues, -} from "lit-element"; +import { customElement, html, state, PropertyValues } from "lit-element"; import { navigate } from "../common/navigate"; import { getStorageDefaultPanelUrlPath } from "../data/panel"; import "../resources/custom-card-support"; @@ -21,11 +16,11 @@ import "./home-assistant-main"; @customElement("home-assistant") export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { - @internalProperty() private _route?: Route; + @state() private _route?: Route; - @internalProperty() private _error = false; + @state() private _error = false; - @internalProperty() private _panelUrl?: string; + @state() private _panelUrl?: string; private _haVersion?: string; diff --git a/src/layouts/supervisor-error-screen.ts b/src/layouts/supervisor-error-screen.ts index dab453f236..7d35f95e73 100644 --- a/src/layouts/supervisor-error-screen.ts +++ b/src/layouts/supervisor-error-screen.ts @@ -2,7 +2,7 @@ import "../components/ha-card"; import "@material/mwc-button"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -112,7 +112,7 @@ class SupervisorErrorScreen extends LitElement { ); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/managers/notification-manager.ts b/src/managers/notification-manager.ts index a282adfd78..8c3de2c802 100644 --- a/src/managers/notification-manager.ts +++ b/src/managers/notification-manager.ts @@ -1,9 +1,9 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, query, @@ -29,9 +29,9 @@ export interface ToastActionParams { class NotificationManager extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _action?: ToastActionParams; + @state() private _action?: ToastActionParams; - @internalProperty() private _noCancelOnOutsideClick = false; + @state() private _noCancelOnOutsideClick = false; @query("ha-toast") private _toast!: HaToast; @@ -80,7 +80,7 @@ class NotificationManager extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-toast { display: flex; diff --git a/src/mixins/provide-hass-lit-mixin.ts b/src/mixins/provide-hass-lit-mixin.ts index ba9ab227c3..8ebe9ebc11 100644 --- a/src/mixins/provide-hass-lit-mixin.ts +++ b/src/mixins/provide-hass-lit-mixin.ts @@ -1,11 +1,11 @@ -import { PropertyValues, UpdatingElement } from "lit-element"; +import { PropertyValues, ReactiveElement } from "lit-element"; import { Constructor, HomeAssistant } from "../types"; export interface ProvideHassElement { provideHass(element: HTMLElement); } -export const ProvideHassLitMixin = >( +export const ProvideHassLitMixin = >( superClass: T ) => class extends superClass { diff --git a/src/mixins/subscribe-mixin.ts b/src/mixins/subscribe-mixin.ts index 88c54eaf3c..e104737784 100644 --- a/src/mixins/subscribe-mixin.ts +++ b/src/mixins/subscribe-mixin.ts @@ -1,12 +1,12 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { property, PropertyValues, UpdatingElement } from "lit-element"; +import { property, PropertyValues, ReactiveElement } from "lit-element"; import { Constructor, HomeAssistant } from "../types"; export interface HassSubscribeElement { hassSubscribe(): UnsubscribeFunc[]; } -export const SubscribeMixin = >( +export const SubscribeMixin = >( superClass: T ) => { class SubscribeClass extends superClass { diff --git a/src/onboarding/action-badge.ts b/src/onboarding/action-badge.ts index 45d69b0c72..c9f516084e 100644 --- a/src/onboarding/action-badge.ts +++ b/src/onboarding/action-badge.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -31,7 +31,7 @@ class ActionBadge extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: inline-flex; diff --git a/src/onboarding/ha-onboarding.ts b/src/onboarding/ha-onboarding.ts index 64ff66bf5a..ea13d7c615 100644 --- a/src/onboarding/ha-onboarding.ts +++ b/src/onboarding/ha-onboarding.ts @@ -8,7 +8,7 @@ import { import { customElement, html, - internalProperty, + state, property, PropertyValues, TemplateResult, @@ -66,13 +66,13 @@ class HaOnboarding extends litLocalizeLiteMixin(HassElement) { public translationFragment = "page-onboarding"; - @internalProperty() private _loading = false; + @state() private _loading = false; - @internalProperty() private _restoring = false; + @state() private _restoring = false; - @internalProperty() private _supervisor?: boolean; + @state() private _supervisor?: boolean; - @internalProperty() private _steps?: OnboardingStep[]; + @state() private _steps?: OnboardingStep[]; protected render(): TemplateResult { const step = this._curStep()!; diff --git a/src/onboarding/integration-badge.ts b/src/onboarding/integration-badge.ts index 341c3f6219..b03acb8b02 100644 --- a/src/onboarding/integration-badge.ts +++ b/src/onboarding/integration-badge.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -35,7 +35,7 @@ class IntegrationBadge extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: inline-flex; diff --git a/src/onboarding/onboarding-analytics.ts b/src/onboarding/onboarding-analytics.ts index 78c20b485f..b22173a73c 100644 --- a/src/onboarding/onboarding-analytics.ts +++ b/src/onboarding/onboarding-analytics.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -23,9 +23,9 @@ class OnboardingAnalytics extends LitElement { @property() public localize!: LocalizeFunc; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _analyticsDetails: Analytics = { + @state() private _analyticsDetails: Analytics = { preferences: {}, }; @@ -85,7 +85,7 @@ class OnboardingAnalytics extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .error { color: var(--error-color); diff --git a/src/onboarding/onboarding-core-config.ts b/src/onboarding/onboarding-core-config.ts index a983a2288b..7a3380229d 100644 --- a/src/onboarding/onboarding-core-config.ts +++ b/src/onboarding/onboarding-core-config.ts @@ -5,10 +5,10 @@ import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -35,17 +35,17 @@ class OnboardingCoreConfig extends LitElement { @property() public onboardingLocalize!: LocalizeFunc; - @internalProperty() private _working = false; + @state() private _working = false; - @internalProperty() private _name!: ConfigUpdateValues["location_name"]; + @state() private _name!: ConfigUpdateValues["location_name"]; - @internalProperty() private _location!: [number, number]; + @state() private _location!: [number, number]; - @internalProperty() private _elevation!: string; + @state() private _elevation!: string; - @internalProperty() private _unitSystem!: ConfigUpdateValues["unit_system"]; + @state() private _unitSystem!: ConfigUpdateValues["unit_system"]; - @internalProperty() private _timeZone!: string; + @state() private _timeZone!: string; protected render(): TemplateResult { return html` @@ -278,7 +278,7 @@ class OnboardingCoreConfig extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .row { display: flex; diff --git a/src/onboarding/onboarding-create-user.ts b/src/onboarding/onboarding-create-user.ts index 63cff1ca6e..64250f91ce 100644 --- a/src/onboarding/onboarding-create-user.ts +++ b/src/onboarding/onboarding-create-user.ts @@ -3,10 +3,10 @@ import "@polymer/paper-input/paper-input"; import { genClientId } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -23,17 +23,17 @@ class OnboardingCreateUser extends LitElement { @property() public language!: string; - @internalProperty() private _name = ""; + @state() private _name = ""; - @internalProperty() private _username = ""; + @state() private _username = ""; - @internalProperty() private _password = ""; + @state() private _password = ""; - @internalProperty() private _passwordConfirm = ""; + @state() private _passwordConfirm = ""; - @internalProperty() private _loading = false; + @state() private _loading = false; - @internalProperty() private _errorMsg?: string = undefined; + @state() private _errorMsg?: string = undefined; protected render(): TemplateResult { return html` @@ -199,7 +199,7 @@ class OnboardingCreateUser extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .error { color: red; diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts index 0ea9a94ff5..eee62415b3 100644 --- a/src/onboarding/onboarding-integrations.ts +++ b/src/onboarding/onboarding-integrations.ts @@ -1,12 +1,12 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, property, - internalProperty, + state, PropertyValues, TemplateResult, } from "lit-element"; @@ -37,9 +37,9 @@ class OnboardingIntegrations extends LitElement { @property() public onboardingLocalize!: LocalizeFunc; - @internalProperty() private _entries?: ConfigEntry[]; + @state() private _entries?: ConfigEntry[]; - @internalProperty() private _discovered?: DataEntryFlowProgress[]; + @state() private _discovered?: DataEntryFlowProgress[]; private _unsubEvents?: () => void; @@ -175,7 +175,7 @@ class OnboardingIntegrations extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .badges { margin-top: 24px; diff --git a/src/onboarding/onboarding-loading.ts b/src/onboarding/onboarding-loading.ts index 96703c6a6c..29005246dc 100644 --- a/src/onboarding/onboarding-loading.ts +++ b/src/onboarding/onboarding-loading.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -13,7 +13,7 @@ class OnboardingLoading extends LitElement { return html`
`; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` /* MIT License (MIT). Copyright (c) 2014 Luke Haas */ .loader, diff --git a/src/onboarding/onboarding-restore-snapshot.ts b/src/onboarding/onboarding-restore-snapshot.ts index 6fb86da28e..835a31aff4 100644 --- a/src/onboarding/onboarding-restore-snapshot.ts +++ b/src/onboarding/onboarding-restore-snapshot.ts @@ -1,7 +1,7 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -86,7 +86,7 @@ class OnboardingRestoreSnapshot extends ProvideHassLitMixin(LitElement) { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/calendar/ha-full-calendar.ts b/src/panels/calendar/ha-full-calendar.ts index 9d11cff9d2..71e5ebbb02 100644 --- a/src/panels/calendar/ha-full-calendar.ts +++ b/src/panels/calendar/ha-full-calendar.ts @@ -14,9 +14,9 @@ import "@material/mwc-button"; import { mdiViewAgenda, mdiViewDay, mdiViewModule, mdiViewWeek } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -91,9 +91,9 @@ export class HAFullCalendar extends LitElement { @property() public initialView: FullCalendarView = "dayGridMonth"; - @internalProperty() private calendar?: Calendar; + @state() private calendar?: Calendar; - @internalProperty() private _activeView?: FullCalendarView; + @state() private _activeView?: FullCalendarView; public updateSize(): void { this.calendar?.updateSize(); @@ -285,7 +285,7 @@ export class HAFullCalendar extends LitElement { ) ); - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/calendar/ha-panel-calendar.ts b/src/panels/calendar/ha-panel-calendar.ts index 636c9fb117..1f73721efc 100644 --- a/src/panels/calendar/ha-panel-calendar.ts +++ b/src/panels/calendar/ha-panel-calendar.ts @@ -4,10 +4,10 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -39,9 +39,9 @@ class PanelCalendar extends LitElement { @property({ type: Boolean, reflect: true }) public narrow!: boolean; - @internalProperty() private _calendars: Calendar[] = []; + @state() private _calendars: Calendar[] = []; - @internalProperty() private _events: CalendarEvent[] = []; + @state() private _events: CalendarEvent[] = []; @LocalStorage("deSelectedCalendars", true) private _deSelectedCalendars: string[] = []; @@ -175,7 +175,7 @@ class PanelCalendar extends LitElement { ); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/areas/dialog-area-registry-detail.ts b/src/panels/config/areas/dialog-area-registry-detail.ts index e0c5c48467..dcb29ffdf2 100644 --- a/src/panels/config/areas/dialog-area-registry-detail.ts +++ b/src/panels/config/areas/dialog-area-registry-detail.ts @@ -3,9 +3,9 @@ import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -22,13 +22,13 @@ import { AreaRegistryDetailDialogParams } from "./show-dialog-area-registry-deta class DialogAreaDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _params?: AreaRegistryDetailDialogParams; + @state() private _params?: AreaRegistryDetailDialogParams; - @internalProperty() private _submitting?: boolean; + @state() private _submitting?: boolean; public async showDialog( params: AreaRegistryDetailDialogParams @@ -159,7 +159,7 @@ class DialogAreaDetail extends LitElement { navigate(this, "/config/areas/dashboard"); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/areas/ha-config-area-page.ts b/src/panels/config/areas/ha-config-area-page.ts index d1356ef014..29d5269810 100644 --- a/src/panels/config/areas/ha-config-area-page.ts +++ b/src/panels/config/areas/ha-config-area-page.ts @@ -1,10 +1,10 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -58,7 +58,7 @@ class HaConfigAreaPage extends LitElement { @property() public route!: Route; - @internalProperty() private _related?: RelatedResult; + @state() private _related?: RelatedResult; private _area = memoizeOne((areaId: string, areas: AreaRegistryEntry[]): | AreaRegistryEntry @@ -215,27 +215,27 @@ class HaConfigAreaPage extends LitElement { )} >${this._related?.automation?.length ? this._related.automation.map((automation) => { - const state = this.hass.states[automation]; - return state + const entityState = this.hass.states[automation]; + return entityState ? html`
- ${computeStateName(state)} + ${computeStateName(entityState)} - ${!state.attributes.id + ${!entityState.attributes.id ? html` ${this.hass.localize( @@ -268,27 +268,27 @@ class HaConfigAreaPage extends LitElement { )} >${this._related?.scene?.length ? this._related.scene.map((scene) => { - const state = this.hass.states[scene]; - return state + const entityState = this.hass.states[scene]; + return entityState ? html`
- ${computeStateName(state)} + ${computeStateName(entityState)} - ${!state.attributes.id + ${!entityState.attributes.id ? html` ${this.hass.localize( @@ -319,15 +319,15 @@ class HaConfigAreaPage extends LitElement { )} >${this._related?.script?.length ? this._related.script.map((script) => { - const state = this.hass.states[script]; - return state + const entityState = this.hass.states[script]; + return entityState ? html` - ${computeStateName(state)} + ${computeStateName(entityState)} @@ -399,7 +399,7 @@ class HaConfigAreaPage extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/areas/ha-config-areas-dashboard.ts b/src/panels/config/areas/ha-config-areas-dashboard.ts index 7ba5201c97..cee1c49c53 100644 --- a/src/panels/config/areas/ha-config-areas-dashboard.ts +++ b/src/panels/config/areas/ha-config-areas-dashboard.ts @@ -3,7 +3,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -210,7 +210,7 @@ export class HaConfigAreasDashboard extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` hass-loading-screen { --app-header-background-color: var(--sidebar-background-color); diff --git a/src/panels/config/areas/ha-config-areas.ts b/src/panels/config/areas/ha-config-areas.ts index c742b304d0..725bf14cd9 100644 --- a/src/panels/config/areas/ha-config-areas.ts +++ b/src/panels/config/areas/ha-config-areas.ts @@ -1,10 +1,5 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - customElement, - internalProperty, - property, - PropertyValues, -} from "lit-element"; +import { customElement, state, property, PropertyValues } from "lit-element"; import { compare } from "../../../common/string/compare"; import { AreaRegistryEntry, @@ -50,15 +45,15 @@ class HaConfigAreas extends HassRouterPage { }, }; - @internalProperty() private _configEntries: ConfigEntry[] = []; + @state() private _configEntries: ConfigEntry[] = []; - @internalProperty() + @state() private _deviceRegistryEntries: DeviceRegistryEntry[] = []; - @internalProperty() + @state() private _entityRegistryEntries: EntityRegistryEntry[] = []; - @internalProperty() private _areas: AreaRegistryEntry[] = []; + @state() private _areas: AreaRegistryEntry[] = []; private _unsubs?: UnsubscribeFunc[]; diff --git a/src/panels/config/automation/action/ha-automation-action-row.ts b/src/panels/config/automation/action/ha-automation-action-row.ts index 87556b3a75..5dfc358a5f 100644 --- a/src/panels/config/automation/action/ha-automation-action-row.ts +++ b/src/panels/config/automation/action/ha-automation-action-row.ts @@ -8,10 +8,10 @@ import "@polymer/paper-listbox/paper-listbox"; import type { PaperListboxElement } from "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -99,11 +99,11 @@ export default class HaAutomationActionRow extends LitElement { @property({ type: Boolean }) public narrow = false; - @internalProperty() private _warnings?: string[]; + @state() private _warnings?: string[]; - @internalProperty() private _uiModeAvailable = true; + @state() private _uiModeAvailable = true; - @internalProperty() private _yamlMode = false; + @state() private _yamlMode = false; @query("ha-yaml-editor") private _yamlEditor?: HaYamlEditor; @@ -339,7 +339,7 @@ export default class HaAutomationActionRow extends LitElement { this._yamlMode = !this._yamlMode; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/automation/action/ha-automation-action.ts b/src/panels/config/automation/action/ha-automation-action.ts index 568dc9676b..9d2c266783 100644 --- a/src/panels/config/automation/action/ha-automation-action.ts +++ b/src/panels/config/automation/action/ha-automation-action.ts @@ -1,7 +1,7 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -90,7 +90,7 @@ export default class HaAutomationAction extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-automation-action-row, ha-card { diff --git a/src/panels/config/automation/action/types/ha-automation-action-choose.ts b/src/panels/config/automation/action/types/ha-automation-action-choose.ts index 2a04f9e022..2cc117665b 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-choose.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-choose.ts @@ -3,7 +3,7 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, LitElement, property, @@ -156,7 +156,7 @@ export class HaChooseAction extends LitElement implements ActionElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/automation/action/types/ha-automation-action-device_id.ts b/src/panels/config/automation/action/types/ha-automation-action-device_id.ts index 051b3a8889..535be0f254 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-device_id.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-device_id.ts @@ -1,10 +1,4 @@ -import { - customElement, - html, - internalProperty, - LitElement, - property, -} from "lit-element"; +import { customElement, html, state, LitElement, property } from "lit-element"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/device/ha-device-action-picker"; @@ -24,9 +18,9 @@ export class HaDeviceAction extends LitElement { @property({ type: Object }) public action!: DeviceAction; - @internalProperty() private _deviceId?: string; + @state() private _deviceId?: string; - @internalProperty() private _capabilities?: DeviceCapabilities; + @state() private _capabilities?: DeviceCapabilities; private _origAction?: DeviceAction; diff --git a/src/panels/config/automation/action/types/ha-automation-action-repeat.ts b/src/panels/config/automation/action/types/ha-automation-action-repeat.ts index 807aa2fefa..538fb94767 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-repeat.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-repeat.ts @@ -1,7 +1,12 @@ import "@polymer/paper-input/paper-input"; import type { PaperListboxElement } from "@polymer/paper-listbox"; import "@polymer/paper-listbox/paper-listbox"; -import { CSSResult, customElement, LitElement, property } from "lit-element"; +import { + CSSResultGroup, + customElement, + LitElement, + property, +} from "lit-element"; import { html } from "lit-html"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { @@ -165,7 +170,7 @@ export class HaRepeatAction extends LitElement implements ActionElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return haStyle; } } diff --git a/src/panels/config/automation/action/types/ha-automation-action-service.ts b/src/panels/config/automation/action/types/ha-automation-action-service.ts index 175c11f9a5..7743800b30 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-service.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-service.ts @@ -1,9 +1,9 @@ import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, - internalProperty, + state, LitElement, property, PropertyValues, @@ -33,7 +33,7 @@ export class HaServiceAction extends LitElement implements ActionElement { @property({ type: Boolean }) public narrow = false; - @internalProperty() private _action!: ServiceAction; + @state() private _action!: ServiceAction; public static get defaultConfig() { return { service: "", data: {} }; @@ -86,7 +86,7 @@ export class HaServiceAction extends LitElement implements ActionElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-service-control { display: block; diff --git a/src/panels/config/automation/blueprint-automation-editor.ts b/src/panels/config/automation/blueprint-automation-editor.ts index 75a7019d27..14358dec95 100644 --- a/src/panels/config/automation/blueprint-automation-editor.ts +++ b/src/panels/config/automation/blueprint-automation-editor.ts @@ -4,9 +4,9 @@ import "@polymer/paper-input/paper-textarea"; import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, - internalProperty, + state, LitElement, property, } from "lit-element"; @@ -44,7 +44,7 @@ export class HaBlueprintAutomationEditor extends LitElement { @property() public stateObj?: HassEntity; - @internalProperty() private _blueprints?: Blueprints; + @state() private _blueprints?: Blueprints; protected firstUpdated(changedProps) { super.firstUpdated(changedProps); @@ -270,7 +270,7 @@ export class HaBlueprintAutomationEditor extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/automation/condition/ha-automation-condition-editor.ts b/src/panels/config/automation/condition/ha-automation-condition-editor.ts index e7a1c2f691..59c2ac55d3 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-editor.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-editor.ts @@ -3,7 +3,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import type { PaperListboxElement } from "@polymer/paper-listbox/paper-listbox"; import { - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -134,7 +134,7 @@ export default class HaAutomationConditionEditor extends LitElement { fireEvent(this, "value-changed", { value: ev.detail.value }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return haStyle; } } diff --git a/src/panels/config/automation/condition/ha-automation-condition-row.ts b/src/panels/config/automation/condition/ha-automation-condition-row.ts index 6b824a60fc..d1dbed74fa 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-row.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-row.ts @@ -4,10 +4,10 @@ import { mdiDotsVertical } from "@mdi/js"; import "@polymer/paper-item/paper-item"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, } from "lit-element"; @@ -56,7 +56,7 @@ export default class HaAutomationConditionRow extends LitElement { @property() public condition!: Condition; - @internalProperty() private _yamlMode = false; + @state() private _yamlMode = false; protected render() { if (!this.condition) { @@ -135,7 +135,7 @@ export default class HaAutomationConditionRow extends LitElement { this._yamlMode = !this._yamlMode; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/automation/condition/ha-automation-condition.ts b/src/panels/config/automation/condition/ha-automation-condition.ts index b4529c4650..1105e7be11 100644 --- a/src/panels/config/automation/condition/ha-automation-condition.ts +++ b/src/panels/config/automation/condition/ha-automation-condition.ts @@ -1,7 +1,7 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -107,7 +107,7 @@ export default class HaAutomationCondition extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-automation-condition-row, ha-card { diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-device.ts b/src/panels/config/automation/condition/types/ha-automation-condition-device.ts index 4470724548..2ba0ba91fc 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-device.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-device.ts @@ -1,10 +1,4 @@ -import { - customElement, - html, - internalProperty, - LitElement, - property, -} from "lit-element"; +import { customElement, html, state, LitElement, property } from "lit-element"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/device/ha-device-condition-picker"; @@ -24,9 +18,9 @@ export class HaDeviceCondition extends LitElement { @property({ type: Object }) public condition!: DeviceCondition; - @internalProperty() private _deviceId?: string; + @state() private _deviceId?: string; - @internalProperty() private _capabilities?: DeviceCapabilities; + @state() private _capabilities?: DeviceCapabilities; private _origCondition?: DeviceCondition; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-time.ts b/src/panels/config/automation/condition/types/ha-automation-condition-time.ts index 87b22ef223..fbbf6baa8b 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-time.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-time.ts @@ -2,10 +2,10 @@ import { Radio } from "@material/mwc-radio"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, } from "lit-element"; @@ -43,9 +43,9 @@ export class HaTimeCondition extends LitElement implements ConditionElement { @property({ attribute: false }) public condition!: TimeCondition; - @internalProperty() private _inputModeBefore?: boolean; + @state() private _inputModeBefore?: boolean; - @internalProperty() private _inputModeAfter?: boolean; + @state() private _inputModeAfter?: boolean; public static get defaultConfig() { return {}; @@ -210,7 +210,7 @@ export class HaTimeCondition extends LitElement implements ConditionElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .weekday-toggle { display: flex; diff --git a/src/panels/config/automation/dialog-new-automation.ts b/src/panels/config/automation/dialog-new-automation.ts index 3815eee8b0..35932dab35 100644 --- a/src/panels/config/automation/dialog-new-automation.ts +++ b/src/panels/config/automation/dialog-new-automation.ts @@ -1,10 +1,10 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -27,7 +27,7 @@ import { showThingtalkDialog } from "./thingtalk/show-dialog-thingtalk"; class DialogNewAutomation extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _opened = false; + @state() private _opened = false; public showDialog(): void { this._opened = true; @@ -125,7 +125,7 @@ class DialogNewAutomation extends LitElement { this.closeDialog(); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, haStyleDialog, diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 19c73ac31b..7b4ad82315 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -13,9 +13,9 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; import "@polymer/paper-input/paper-textarea"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -85,15 +85,15 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { @property() public route!: Route; - @internalProperty() private _config?: AutomationConfig; + @state() private _config?: AutomationConfig; - @internalProperty() private _dirty = false; + @state() private _dirty = false; - @internalProperty() private _errors?: string; + @state() private _errors?: string; - @internalProperty() private _entityId?: string; + @state() private _entityId?: string; - @internalProperty() private _mode: "gui" | "yaml" = "gui"; + @state() private _mode: "gui" | "yaml" = "gui"; @query("ha-yaml-editor", true) private _editor?: HaYamlEditor; @@ -519,7 +519,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { this._saveAutomation(); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index 03dd102f45..760069e16b 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -9,10 +9,10 @@ import { } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -56,9 +56,9 @@ class HaAutomationPicker extends LitElement { @property() private _activeFilters?: string[]; - @internalProperty() private _filteredAutomations?: string[] | null; + @state() private _filteredAutomations?: string[] | null; - @internalProperty() private _filterValue?; + @state() private _filterValue?; private _automations = memoizeOne( ( @@ -335,7 +335,7 @@ class HaAutomationPicker extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return haStyle; } } diff --git a/src/panels/config/automation/manual-automation-editor.ts b/src/panels/config/automation/manual-automation-editor.ts index 8828066792..492621e877 100644 --- a/src/panels/config/automation/manual-automation-editor.ts +++ b/src/panels/config/automation/manual-automation-editor.ts @@ -5,7 +5,7 @@ import { PaperListboxElement } from "@polymer/paper-listbox"; import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, LitElement, property, @@ -317,7 +317,7 @@ export class HaManualAutomationEditor extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/automation/thingtalk/dialog-thingtalk.ts b/src/panels/config/automation/thingtalk/dialog-thingtalk.ts index 5c09ed45cd..663b6a552e 100644 --- a/src/panels/config/automation/thingtalk/dialog-thingtalk.ts +++ b/src/panels/config/automation/thingtalk/dialog-thingtalk.ts @@ -4,10 +4,10 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -40,15 +40,15 @@ export interface PlaceholderContainer { class DialogThingtalk extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _params?: ThingtalkDialogParams; + @state() private _params?: ThingtalkDialogParams; - @internalProperty() private _submitting = false; + @state() private _submitting = false; - @internalProperty() private _opened = false; + @state() private _opened = false; - @internalProperty() private _placeholders?: PlaceholderContainer; + @state() private _placeholders?: PlaceholderContainer; @query("#input") private _input?: PaperInputElement; @@ -257,7 +257,7 @@ class DialogThingtalk extends LitElement { this._input!.value = (ev.target as HTMLAnchorElement).innerText; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, haStyleDialog, diff --git a/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts b/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts index f71d8a8ab9..3a42951f93 100644 --- a/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts +++ b/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts @@ -1,10 +1,10 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -72,13 +72,13 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) { @property() public placeholders!: PlaceholderContainer; - @internalProperty() private _error?: string; + @state() private _error?: string; private _deviceEntityLookup: DeviceEntitiesLookup = {}; - @internalProperty() private _extraInfo: ExtraInfo = {}; + @state() private _extraInfo: ExtraInfo = {}; - @internalProperty() private _placeholderValues: PlaceholderValues = {}; + @state() private _placeholderValues: PlaceholderValues = {}; private _devices?: DeviceRegistryEntry[]; @@ -198,13 +198,13 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) { "device_id", ]) )}`} - .entityFilter=${(state: HassEntity) => { + .entityFilter=${(entityState: HassEntity) => { const devId = this._placeholderValues[type][ placeholder.index ][idx].device_id; return this._deviceEntityLookup[ devId - ].includes(state.entity_id); + ].includes(entityState.entity_id); }} > ` @@ -470,7 +470,7 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) { this.dispatchEvent(new CustomEvent(ev.type, ev)); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/automation/trace/ha-automation-trace-config.ts b/src/panels/config/automation/trace/ha-automation-trace-config.ts index f579e30815..73a49f6649 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-config.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-config.ts @@ -1,7 +1,7 @@ import { safeDump } from "js-yaml"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -28,7 +28,7 @@ export class HaAutomationTraceConfig extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [css``]; } } diff --git a/src/panels/config/automation/trace/ha-automation-trace-logbook.ts b/src/panels/config/automation/trace/ha-automation-trace-logbook.ts index b18d83d1be..54c78e201a 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-logbook.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-logbook.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -36,7 +36,7 @@ export class HaAutomationTraceLogbook extends LitElement {
`; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ css` .padded-box { diff --git a/src/panels/config/automation/trace/ha-automation-trace-path-details.ts b/src/panels/config/automation/trace/ha-automation-trace-path-details.ts index 51ebbdab7f..a7c3754c4d 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-path-details.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-path-details.ts @@ -1,10 +1,10 @@ import { safeDump } from "js-yaml"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -40,10 +40,7 @@ export class HaAutomationTracePathDetails extends LitElement { @property() public trackedNodes!: Record; - @internalProperty() private _view: - | "config" - | "changed_variables" - | "logbook" = "config"; + @state() private _view: "config" | "changed_variables" | "logbook" = "config"; protected render(): TemplateResult { return html` @@ -254,7 +251,7 @@ ${safeDump(trace.changed_variables).trimRight()} void; diff --git a/src/panels/config/core/ha-config-analytics.ts b/src/panels/config/core/ha-config-analytics.ts index ee145e9f64..b533c4c407 100644 --- a/src/panels/config/core/ha-config-analytics.ts +++ b/src/panels/config/core/ha-config-analytics.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -28,9 +28,9 @@ import type { HomeAssistant } from "../../../types"; class ConfigAnalytics extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _analyticsDetails?: Analytics; + @state() private _analyticsDetails?: Analytics; - @internalProperty() private _error?: string; + @state() private _error?: string; protected render(): TemplateResult { const error = this._error @@ -101,7 +101,7 @@ class ConfigAnalytics extends LitElement { }; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/core/ha-config-core-form.ts b/src/panels/config/core/ha-config-core-form.ts index 2d3bfff403..848d89bbdf 100644 --- a/src/panels/config/core/ha-config-core-form.ts +++ b/src/panels/config/core/ha-config-core-form.ts @@ -5,10 +5,10 @@ import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -26,15 +26,15 @@ import type { HomeAssistant } from "../../../types"; class ConfigCoreForm extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _working = false; + @state() private _working = false; - @internalProperty() private _location!: [number, number]; + @state() private _location!: [number, number]; - @internalProperty() private _elevation!: string; + @state() private _elevation!: string; - @internalProperty() private _unitSystem!: ConfigUpdateValues["unit_system"]; + @state() private _unitSystem!: ConfigUpdateValues["unit_system"]; - @internalProperty() private _timeZone!: string; + @state() private _timeZone!: string; protected render(): TemplateResult { const canEdit = ["storage", "default"].includes( @@ -231,7 +231,7 @@ class ConfigCoreForm extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .row { display: flex; diff --git a/src/panels/config/core/ha-config-name-form.ts b/src/panels/config/core/ha-config-name-form.ts index 3dbdefb1ed..bbb9f16035 100644 --- a/src/panels/config/core/ha-config-name-form.ts +++ b/src/panels/config/core/ha-config-name-form.ts @@ -7,7 +7,7 @@ import { css, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -21,9 +21,9 @@ import type { HomeAssistant } from "../../../types"; class ConfigNameForm extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _working = false; + @state() private _working = false; - @internalProperty() private _name!: ConfigUpdateValues["location_name"]; + @state() private _name!: ConfigUpdateValues["location_name"]; protected render(): TemplateResult { const canEdit = ["storage", "default"].includes( diff --git a/src/panels/config/core/ha-config-url-form.ts b/src/panels/config/core/ha-config-url-form.ts index 778fa18a66..9a26b83236 100644 --- a/src/panels/config/core/ha-config-url-form.ts +++ b/src/panels/config/core/ha-config-url-form.ts @@ -3,10 +3,10 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -20,13 +20,13 @@ import type { HomeAssistant } from "../../../types"; class ConfigUrlForm extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _working = false; + @state() private _working = false; - @internalProperty() private _external_url?: string; + @state() private _external_url?: string; - @internalProperty() private _internal_url?: string; + @state() private _internal_url?: string; protected render(): TemplateResult { const canEdit = ["storage", "default"].includes( @@ -135,7 +135,7 @@ class ConfigUrlForm extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .row { display: flex; diff --git a/src/panels/config/customize/ha-config-customize.ts b/src/panels/config/customize/ha-config-customize.ts index c1802cc6aa..a79d356836 100644 --- a/src/panels/config/customize/ha-config-customize.ts +++ b/src/panels/config/customize/ha-config-customize.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, html, LitElement, property, @@ -80,7 +80,7 @@ class HaConfigCustomize extends LitElement { this._selectedEntityId = routeSegments.length > 1 ? routeSegments[1] : ""; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` a { color: var(--primary-color); diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index 9e740eea4a..f4844895ea 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -3,7 +3,7 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -111,7 +111,7 @@ class HaConfigDashboard extends LitElement { `; } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/dashboard/ha-config-navigation.ts b/src/panels/config/dashboard/ha-config-navigation.ts index f1b958a4fe..935cc544f1 100644 --- a/src/panels/config/dashboard/ha-config-navigation.ts +++ b/src/panels/config/dashboard/ha-config-navigation.ts @@ -2,7 +2,7 @@ import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -76,7 +76,7 @@ class HaConfigNavigation extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` a { text-decoration: none; diff --git a/src/panels/config/devices/device-detail/ha-device-automation-card.ts b/src/panels/config/devices/device-detail/ha-device-automation-card.ts index b267581048..ed4a1caa13 100644 --- a/src/panels/config/devices/device-detail/ha-device-automation-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-automation-card.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, html, LitElement, property, @@ -86,7 +86,7 @@ export abstract class HaDeviceAutomationCard< showAutomationEditor(this, data); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` h3 { color: var(--primary-text-color); diff --git a/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts b/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts index d374b14860..876289e04d 100644 --- a/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts +++ b/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts @@ -1,8 +1,8 @@ import { - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -29,13 +29,13 @@ import "@material/mwc-button/mwc-button"; export class DialogDeviceAutomation extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _triggers: DeviceTrigger[] = []; + @state() private _triggers: DeviceTrigger[] = []; - @internalProperty() private _conditions: DeviceCondition[] = []; + @state() private _conditions: DeviceCondition[] = []; - @internalProperty() private _actions: DeviceAction[] = []; + @state() private _actions: DeviceAction[] = []; - @internalProperty() private _params?: DeviceAutomationDialogParams; + @state() private _params?: DeviceAutomationDialogParams; public async showDialog(params: DeviceAutomationDialogParams): Promise { this._params = params; @@ -140,7 +140,7 @@ export class DialogDeviceAutomation extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return haStyleDialog; } } diff --git a/src/panels/config/devices/device-detail/ha-device-entities-card.ts b/src/panels/config/devices/device-detail/ha-device-entities-card.ts index 946c46e665..7a779b6065 100644 --- a/src/panels/config/devices/device-detail/ha-device-entities-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-entities-card.ts @@ -3,7 +3,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -173,7 +173,7 @@ export class HaDeviceEntitiesCard extends LitElement { ); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/panels/config/devices/device-detail/ha-device-info-card.ts b/src/panels/config/devices/device-detail/ha-device-info-card.ts index af8110fe2c..bddb19aecb 100644 --- a/src/panels/config/devices/device-detail/ha-device-info-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-info-card.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -94,7 +94,7 @@ export class HaDeviceCard extends LitElement { )})`; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts index d66d736779..3f0a740f93 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -29,13 +29,13 @@ import { MQTTDeviceDebugInfoDialogParams } from "./show-dialog-mqtt-device-debug class DialogMQTTDeviceDebugInfo extends LitElement { public hass!: HomeAssistant; - @internalProperty() private _params?: MQTTDeviceDebugInfoDialogParams; + @state() private _params?: MQTTDeviceDebugInfoDialogParams; - @internalProperty() private _debugInfo?: MQTTDeviceDebugInfo; + @state() private _debugInfo?: MQTTDeviceDebugInfo; - @internalProperty() private _showAsYaml = true; + @state() private _showAsYaml = true; - @internalProperty() private _showDeserialized = true; + @state() private _showDeserialized = true; public async showDialog( params: MQTTDeviceDebugInfoDialogParams @@ -219,7 +219,7 @@ class DialogMQTTDeviceDebugInfo extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts index 2b5c29b052..54ab5b9403 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -46,7 +46,7 @@ export class HaDeviceActionsMqtt extends LitElement { await showMQTTDeviceDebugInfoDialog(this, { device }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts index a820ef9bf3..afea8620fa 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts @@ -1,10 +1,10 @@ import { safeDump } from "js-yaml"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -19,7 +19,7 @@ class MQTTDiscoveryPayload extends LitElement { @property() public summary!: string; - @internalProperty() private _open = false; + @state() private _open = false; protected render(): TemplateResult { return html` @@ -48,7 +48,7 @@ class MQTTDiscoveryPayload extends LitElement { this._open = !this._open; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .expander { cursor: pointer; diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts index 15a8ce0051..9bd2ec167a 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts @@ -1,10 +1,10 @@ import { safeDump } from "js-yaml"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -28,11 +28,11 @@ class MQTTMessages extends LitElement { @property() public summary!: string; - @internalProperty() private _open = false; + @state() private _open = false; - @internalProperty() private _payloadsJson = new WeakMap(); + @state() private _payloadsJson = new WeakMap(); - @internalProperty() private _showTopic = false; + @state() private _showTopic = false; protected firstUpdated(): void { this.messages.forEach((message) => { @@ -133,7 +133,7 @@ class MQTTMessages extends LitElement { this._open = !this._open; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .expander { cursor: pointer; diff --git a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts index 82f770c928..9fe72d2ff2 100644 --- a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts +++ b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts @@ -1,7 +1,7 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -72,7 +72,7 @@ export class HaDeviceActionsOzw extends LitElement { ); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts index f23ce1c636..3fab405b92 100644 --- a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts +++ b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -31,7 +31,7 @@ export class HaDeviceInfoOzw extends LitElement { @property() private ozw_instance = 1; - @internalProperty() private _ozwDevice?: OZWDevice; + @state() private _ozwDevice?: OZWDevice; protected updated(changedProperties: PropertyValues) { if (changedProperties.has("device")) { @@ -85,7 +85,7 @@ export class HaDeviceInfoOzw extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts b/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts index 96253e2bd9..6b4009dd0e 100644 --- a/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts +++ b/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -39,7 +39,7 @@ export class HaDeviceActionsTasmota extends LitElement { await removeTasmotaDeviceEntry(this.hass!, this.device.id); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts index 4d0b380bb2..723b0f4425 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -26,7 +26,7 @@ export class HaDeviceActionsZha extends LitElement { @property() public device!: DeviceRegistryEntry; - @internalProperty() private _zhaDevice?: ZHADevice; + @state() private _zhaDevice?: ZHADevice; protected updated(changedProperties: PropertyValues) { if (changedProperties.has("device")) { @@ -145,7 +145,7 @@ export class HaDeviceActionsZha extends LitElement { history.back(); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts index 5440940f16..6aa0188b2b 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -21,7 +21,7 @@ export class HaDeviceActionsZha extends LitElement { @property() public device!: DeviceRegistryEntry; - @internalProperty() private _zhaDevice?: ZHADevice; + @state() private _zhaDevice?: ZHADevice; protected updated(changedProperties: PropertyValues) { if (changedProperties.has("device")) { @@ -77,7 +77,7 @@ export class HaDeviceActionsZha extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-actions-zwave_js.ts b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-actions-zwave_js.ts index a43d8126f3..6620ac62ad 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-actions-zwave_js.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-actions-zwave_js.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -25,9 +25,9 @@ export class HaDeviceActionsZWaveJS extends LitElement { @property() public device!: DeviceRegistryEntry; - @internalProperty() private _entryId?: string; + @state() private _entryId?: string; - @internalProperty() private _nodeId?: number; + @state() private _nodeId?: number; protected updated(changedProperties: PropertyValues) { if (changedProperties.has("device")) { @@ -70,7 +70,7 @@ export class HaDeviceActionsZWaveJS extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts index ed35383b16..c37856a5c2 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -27,13 +27,13 @@ export class HaDeviceInfoZWaveJS extends LitElement { @property() public device!: DeviceRegistryEntry; - @internalProperty() private _entryId?: string; + @state() private _entryId?: string; - @internalProperty() private _nodeId?: number; + @state() private _nodeId?: number; - @internalProperty() private _homeId?: string; + @state() private _homeId?: string; - @internalProperty() private _node?: ZWaveJSNode; + @state() private _node?: ZWaveJSNode; protected updated(changedProperties: PropertyValues) { if (changedProperties.has("device")) { @@ -95,7 +95,7 @@ export class HaDeviceInfoZWaveJS extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts b/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts index 99bd51dcb7..a6536d8c56 100644 --- a/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts +++ b/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts @@ -5,10 +5,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -27,17 +27,17 @@ import { DeviceRegistryDetailDialogParams } from "./show-dialog-device-registry- class DialogDeviceRegistryDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _nameByUser!: string; + @state() private _nameByUser!: string; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _params?: DeviceRegistryDetailDialogParams; + @state() private _params?: DeviceRegistryDetailDialogParams; - @internalProperty() private _areaId?: string | null; + @state() private _areaId?: string | null; - @internalProperty() private _disabledBy!: string | null; + @state() private _disabledBy!: string | null; - @internalProperty() private _submitting?: boolean; + @state() private _submitting?: boolean; public async showDialog( params: DeviceRegistryDetailDialogParams @@ -159,7 +159,7 @@ class DialogDeviceRegistryDetail extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, haStyleDialog, diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index bf2575ee97..4162a1a737 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -1,10 +1,10 @@ import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -75,7 +75,7 @@ export class HaConfigDevicePage extends LitElement { @property() public route!: Route; - @internalProperty() private _related?: RelatedResult; + @state() private _related?: RelatedResult; private _device = memoizeOne( ( @@ -323,28 +323,28 @@ export class HaConfigDevicePage extends LitElement { ${this._related?.automation?.length ? this._related.automation.map((automation) => { - const state = this.hass.states[automation]; - return state + const entityState = this.hass.states[automation]; + return entityState ? html`
- ${computeStateName(state)} + ${computeStateName(entityState)} - ${!state.attributes.id + ${!entityState.attributes.id ? html` ${this.hass.localize( @@ -402,28 +402,29 @@ export class HaConfigDevicePage extends LitElement { ${ this._related?.scene?.length ? this._related.scene.map((scene) => { - const state = this.hass.states[scene]; - return state + const entityState = this.hass.states[scene]; + return entityState ? html`
- ${computeStateName(state)} + ${computeStateName(entityState)} - ${!state.attributes.id + ${!entityState.attributes.id ? html` ${this._related?.script?.length ? this._related.script.map((script) => { - const state = this.hass.states[script]; - return state + const entityState = this.hass.states[script]; + return entityState ? html` - ${computeStateName(state)} + ${computeStateName(entityState)} @@ -519,8 +520,8 @@ export class HaConfigDevicePage extends LitElement { if (entity.name) { return entity.name; } - const state = this.hass.states[entity.entity_id]; - return state ? computeStateName(state) : null; + const entityState = this.hass.states[entity.entity_id]; + return entityState ? computeStateName(entityState) : null; } private _onImageLoad(ev) { @@ -748,7 +749,7 @@ export class HaConfigDevicePage extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index 67dd2fa2c2..b6b2d2ff0b 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -4,10 +4,10 @@ import { mdiCancel, mdiFilterVariant, mdiPlus } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -68,15 +68,13 @@ export class HaConfigDeviceDashboard extends LitElement { @property() public route!: Route; - @internalProperty() private _searchParms = new URLSearchParams( - window.location.search - ); + @state() private _searchParms = new URLSearchParams(window.location.search); - @internalProperty() private _showDisabled = false; + @state() private _showDisabled = false; - @internalProperty() private _filter = ""; + @state() private _filter = ""; - @internalProperty() private _numHiddenDevices = 0; + @state() private _numHiddenDevices = 0; private _activeFilters = memoizeOne( ( @@ -468,7 +466,7 @@ export class HaConfigDeviceDashboard extends LitElement { this._showDisabled = true; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ css` ha-button-menu { diff --git a/src/panels/config/devices/ha-config-devices.ts b/src/panels/config/devices/ha-config-devices.ts index 82dd2d7720..9252c18420 100644 --- a/src/panels/config/devices/ha-config-devices.ts +++ b/src/panels/config/devices/ha-config-devices.ts @@ -1,10 +1,5 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - customElement, - internalProperty, - property, - PropertyValues, -} from "lit-element"; +import { customElement, state, property, PropertyValues } from "lit-element"; import { AreaRegistryEntry, subscribeAreaRegistry, @@ -49,15 +44,15 @@ class HaConfigDevices extends HassRouterPage { }, }; - @internalProperty() private _configEntries: ConfigEntry[] = []; + @state() private _configEntries: ConfigEntry[] = []; - @internalProperty() + @state() private _entityRegistryEntries: EntityRegistryEntry[] = []; - @internalProperty() + @state() private _deviceRegistryEntries: DeviceRegistryEntry[] = []; - @internalProperty() private _areas: AreaRegistryEntry[] = []; + @state() private _areas: AreaRegistryEntry[] = []; private _unsubs?: UnsubscribeFunc[]; diff --git a/src/panels/config/entities/dialog-entity-editor.ts b/src/panels/config/entities/dialog-entity-editor.ts index c0f4f18ea7..45f5058070 100644 --- a/src/panels/config/entities/dialog-entity-editor.ts +++ b/src/panels/config/entities/dialog-entity-editor.ts @@ -5,10 +5,10 @@ import { mdiClose, mdiTune } from "@mdi/js"; import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -47,18 +47,15 @@ interface Tab { export class DialogEntityEditor extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _params?: EntityRegistryDetailDialogParams; + @state() private _params?: EntityRegistryDetailDialogParams; - @internalProperty() private _entry?: - | EntityRegistryEntry - | ExtEntityRegistryEntry - | null; + @state() private _entry?: EntityRegistryEntry | ExtEntityRegistryEntry | null; - @internalProperty() private _curTab = "tab-settings"; + @state() private _curTab = "tab-settings"; - @internalProperty() private _extraTabs: Tabs = {}; + @state() private _extraTabs: Tabs = {}; - @internalProperty() private _settingsElementTag?: string; + @state() private _settingsElementTag?: string; private _curTabIndex = 0; @@ -256,7 +253,7 @@ export class DialogEntityEditor extends LitElement { this.closeDialog(); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts index dae2b5f42e..d47479811b 100644 --- a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts +++ b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -110,13 +110,13 @@ export class EntityRegistrySettingsHelper extends LitElement { @property() public entry!: ExtEntityRegistryEntry; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _item?: Helper | null; + @state() private _item?: Helper | null; - @internalProperty() private _submitting?: boolean; + @state() private _submitting?: boolean; - @internalProperty() private _componentLoaded?: boolean; + @state() private _componentLoaded?: boolean; @query("ha-registry-basic-editor") private _registryEditor?: HaEntityRegistryBasicEditor; @@ -242,7 +242,7 @@ export class EntityRegistrySettingsHelper extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/entities/entity-registry-basic-editor.ts b/src/panels/config/entities/entity-registry-basic-editor.ts index 1063639aa4..027e9334da 100644 --- a/src/panels/config/entities/entity-registry-basic-editor.ts +++ b/src/panels/config/entities/entity-registry-basic-editor.ts @@ -4,7 +4,7 @@ import { css, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -34,19 +34,19 @@ export class HaEntityRegistryBasicEditor extends SubscribeMixin(LitElement) { @property() public entry!: ExtEntityRegistryEntry; - @internalProperty() private _origEntityId!: string; + @state() private _origEntityId!: string; - @internalProperty() private _entityId!: string; + @state() private _entityId!: string; - @internalProperty() private _areaId?: string | null; + @state() private _areaId?: string | null; - @internalProperty() private _disabledBy!: string | null; + @state() private _disabledBy!: string | null; private _deviceLookup?: Record; - @internalProperty() private _device?: DeviceRegistryEntry; + @state() private _device?: DeviceRegistryEntry; - @internalProperty() private _submitting?: boolean; + @state() private _submitting?: boolean; public async updateEntry(): Promise { this._submitting = true; diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index 6e60b08bfe..4c83b7b795 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -3,10 +3,10 @@ import "@polymer/paper-input/paper-input"; import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -47,23 +47,23 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { @property() public entry!: ExtEntityRegistryEntry; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _icon!: string; + @state() private _icon!: string; - @internalProperty() private _entityId!: string; + @state() private _entityId!: string; - @internalProperty() private _areaId?: string | null; + @state() private _areaId?: string | null; - @internalProperty() private _disabledBy!: string | null; + @state() private _disabledBy!: string | null; private _deviceLookup?: Record; - @internalProperty() private _device?: DeviceRegistryEntry; + @state() private _device?: DeviceRegistryEntry; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _submitting?: boolean; + @state() private _submitting?: boolean; private _origEntityId!: string; @@ -359,7 +359,7 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { this._disabledBy = (ev.target as HaSwitch).checked ? null : "user"; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index d42ef240cf..5f6993e13f 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -15,10 +15,10 @@ import "@polymer/paper-tooltip/paper-tooltip"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -101,31 +101,29 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { @property() public route!: Route; - @internalProperty() private _entities?: EntityRegistryEntry[]; + @state() private _entities?: EntityRegistryEntry[]; - @internalProperty() private _devices?: DeviceRegistryEntry[]; + @state() private _devices?: DeviceRegistryEntry[]; - @internalProperty() private _areas: AreaRegistryEntry[] = []; + @state() private _areas: AreaRegistryEntry[] = []; - @internalProperty() private _stateEntities: StateEntity[] = []; + @state() private _stateEntities: StateEntity[] = []; @property() public _entries?: ConfigEntry[]; - @internalProperty() private _showDisabled = false; + @state() private _showDisabled = false; - @internalProperty() private _showUnavailable = true; + @state() private _showUnavailable = true; - @internalProperty() private _showReadOnly = true; + @state() private _showReadOnly = true; - @internalProperty() private _filter = ""; + @state() private _filter = ""; - @internalProperty() private _numHiddenEntities = 0; + @state() private _numHiddenEntities = 0; - @internalProperty() private _searchParms = new URLSearchParams( - window.location.search - ); + @state() private _searchParms = new URLSearchParams(window.location.search); - @internalProperty() private _selectedEntities: string[] = []; + @state() private _selectedEntities: string[] = []; @query("hass-tabs-subpage-data-table", true) private _dataTable!: HaTabsSubpageDataTable; @@ -847,7 +845,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { this._showUnavailable = true; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/ha-entity-config.ts b/src/panels/config/ha-entity-config.ts index 9fb1d804dd..838523efc9 100644 --- a/src/panels/config/ha-entity-config.ts +++ b/src/panels/config/ha-entity-config.ts @@ -1,7 +1,7 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -103,7 +103,7 @@ export class HaEntityConfig extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/ha-panel-config.ts b/src/panels/config/ha-panel-config.ts index 831bb4682d..34583a8ad8 100644 --- a/src/panels/config/ha-panel-config.ts +++ b/src/panels/config/ha-panel-config.ts @@ -22,12 +22,7 @@ import { import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { PolymerElement } from "@polymer/polymer"; -import { - customElement, - internalProperty, - property, - PropertyValues, -} from "lit-element"; +import { customElement, state, property, PropertyValues } from "lit-element"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; import { listenMediaQuery } from "../../common/dom/media_query"; import { CloudStatus, fetchCloudStatus } from "../../data/cloud"; @@ -316,11 +311,11 @@ class HaPanelConfig extends HassRouterPage { }, }; - @internalProperty() private _wideSidebar = false; + @state() private _wideSidebar = false; - @internalProperty() private _wide = false; + @state() private _wide = false; - @internalProperty() private _cloudStatus?: CloudStatus; + @state() private _cloudStatus?: CloudStatus; private _listeners: Array<() => void> = []; diff --git a/src/panels/config/helpers/dialog-helper-detail.ts b/src/panels/config/helpers/dialog-helper-detail.ts index b4eeed86be..16e85a43f0 100644 --- a/src/panels/config/helpers/dialog-helper-detail.ts +++ b/src/panels/config/helpers/dialog-helper-detail.ts @@ -3,10 +3,10 @@ import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -49,15 +49,15 @@ const HELPERS = { export class DialogHelperDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _item?: Helper; + @state() private _item?: Helper; - @internalProperty() private _opened = false; + @state() private _opened = false; - @internalProperty() private _platform?: string; + @state() private _platform?: string; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _submitting = false; + @state() private _submitting = false; @query(".form") private _form?: HTMLDivElement; @@ -207,7 +207,7 @@ export class DialogHelperDetail extends LitElement { this._error = undefined; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/helpers/forms/ha-counter-form.ts b/src/panels/config/helpers/forms/ha-counter-form.ts index 278d33edd3..460bd0b9d2 100644 --- a/src/panels/config/helpers/forms/ha-counter-form.ts +++ b/src/panels/config/helpers/forms/ha-counter-form.ts @@ -1,10 +1,10 @@ import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -25,19 +25,19 @@ class HaCounterForm extends LitElement { private _item?: Partial; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _icon!: string; + @state() private _icon!: string; - @internalProperty() private _maximum?: number; + @state() private _maximum?: number; - @internalProperty() private _minimum?: number; + @state() private _minimum?: number; - @internalProperty() private _restore?: boolean; + @state() private _restore?: boolean; - @internalProperty() private _initial?: number; + @state() private _initial?: number; - @internalProperty() private _step?: number; + @state() private _step?: number; set item(item: Counter) { this._item = item; @@ -183,7 +183,7 @@ class HaCounterForm extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/helpers/forms/ha-input_boolean-form.ts b/src/panels/config/helpers/forms/ha-input_boolean-form.ts index 90656b861d..18ca1f4741 100644 --- a/src/panels/config/helpers/forms/ha-input_boolean-form.ts +++ b/src/panels/config/helpers/forms/ha-input_boolean-form.ts @@ -1,10 +1,10 @@ import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -23,9 +23,9 @@ class HaInputBooleanForm extends LitElement { private _item?: InputBoolean; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _icon!: string; + @state() private _icon!: string; set item(item: InputBoolean) { this._item = item; @@ -100,7 +100,7 @@ class HaInputBooleanForm extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/helpers/forms/ha-input_datetime-form.ts b/src/panels/config/helpers/forms/ha-input_datetime-form.ts index 09a1efc4e7..03eb3f08c6 100644 --- a/src/panels/config/helpers/forms/ha-input_datetime-form.ts +++ b/src/panels/config/helpers/forms/ha-input_datetime-form.ts @@ -3,10 +3,10 @@ import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -25,11 +25,11 @@ class HaInputDateTimeForm extends LitElement { private _item?: InputDateTime; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _icon!: string; + @state() private _icon!: string; - @internalProperty() private _mode!: "date" | "time" | "datetime"; + @state() private _mode!: "date" | "time" | "datetime"; set item(item: InputDateTime) { this._item = item; @@ -145,7 +145,7 @@ class HaInputDateTimeForm extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/helpers/forms/ha-input_number-form.ts b/src/panels/config/helpers/forms/ha-input_number-form.ts index 0439227315..c049b5790c 100644 --- a/src/panels/config/helpers/forms/ha-input_number-form.ts +++ b/src/panels/config/helpers/forms/ha-input_number-form.ts @@ -3,10 +3,10 @@ import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -25,20 +25,20 @@ class HaInputNumberForm extends LitElement { private _item?: Partial; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _icon!: string; + @state() private _icon!: string; - @internalProperty() private _max?: number; + @state() private _max?: number; - @internalProperty() private _min?: number; + @state() private _min?: number; - @internalProperty() private _mode?: string; + @state() private _mode?: string; - @internalProperty() private _step?: number; + @state() private _step?: number; // eslint-disable-next-line: variable-name - @internalProperty() private _unit_of_measurement?: string; + @state() private _unit_of_measurement?: string; set item(item: InputNumber) { this._item = item; @@ -194,7 +194,7 @@ class HaInputNumberForm extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/helpers/forms/ha-input_select-form.ts b/src/panels/config/helpers/forms/ha-input_select-form.ts index 2aec4aee3a..1aba9c2d23 100644 --- a/src/panels/config/helpers/forms/ha-input_select-form.ts +++ b/src/panels/config/helpers/forms/ha-input_select-form.ts @@ -5,10 +5,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -30,11 +30,11 @@ class HaInputSelectForm extends LitElement { private _item?: InputSelect; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _icon!: string; + @state() private _icon!: string; - @internalProperty() private _options: string[] = []; + @state() private _options: string[] = []; @query("#option_input", true) private _optionInput?: PaperInputElement; @@ -190,7 +190,7 @@ class HaInputSelectForm extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/helpers/forms/ha-input_text-form.ts b/src/panels/config/helpers/forms/ha-input_text-form.ts index 5c738b9dd8..a63d8580eb 100644 --- a/src/panels/config/helpers/forms/ha-input_text-form.ts +++ b/src/panels/config/helpers/forms/ha-input_text-form.ts @@ -3,10 +3,10 @@ import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -25,17 +25,17 @@ class HaInputTextForm extends LitElement { private _item?: InputText; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _icon!: string; + @state() private _icon!: string; - @internalProperty() private _max?: number; + @state() private _max?: number; - @internalProperty() private _min?: number; + @state() private _min?: number; - @internalProperty() private _mode?: string; + @state() private _mode?: string; - @internalProperty() private _pattern?: string; + @state() private _pattern?: string; set item(item: InputText) { this._item = item; @@ -177,7 +177,7 @@ class HaInputTextForm extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/helpers/forms/ha-timer-form.ts b/src/panels/config/helpers/forms/ha-timer-form.ts index 1b81f2d481..e8a83ad32c 100644 --- a/src/panels/config/helpers/forms/ha-timer-form.ts +++ b/src/panels/config/helpers/forms/ha-timer-form.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -22,11 +22,11 @@ class HaTimerForm extends LitElement { private _item?: Timer; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _icon!: string; + @state() private _icon!: string; - @internalProperty() private _duration!: string | number | DurationDict; + @state() private _duration!: string | number | DurationDict; set item(item: Timer) { this._item = item; @@ -111,7 +111,7 @@ class HaTimerForm extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/helpers/ha-config-helpers.ts b/src/panels/config/helpers/ha-config-helpers.ts index 71623d5289..41535926b2 100644 --- a/src/panels/config/helpers/ha-config-helpers.ts +++ b/src/panels/config/helpers/ha-config-helpers.ts @@ -8,7 +8,7 @@ import { HassEntity } from "home-assistant-js-websocket"; import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -43,7 +43,7 @@ export class HaConfigHelpers extends LitElement { @property() public route!: Route; - @internalProperty() private _stateItems: HassEntity[] = []; + @state() private _stateItems: HassEntity[] = []; private _columns = memoize( (narrow, _language): DataTableColumnContainer => { @@ -121,13 +121,13 @@ export class HaConfigHelpers extends LitElement { ); private _getItems = memoize((stateItems: HassEntity[]) => - stateItems.map((state) => ({ - id: state.entity_id, - icon: state.attributes.icon, - name: state.attributes.friendly_name || "", - entity_id: state.entity_id, - editable: state.attributes.editable, - type: computeStateDomain(state), + stateItems.map((entityState) => ({ + id: entityState.entity_id, + icon: entityState.attributes.icon, + name: entityState.attributes.friendly_name || "", + entity_id: entityState.entity_id, + editable: entityState.attributes.editable, + type: computeStateDomain(entityState), })) ); diff --git a/src/panels/config/info/ha-config-info.ts b/src/panels/config/info/ha-config-info.ts index b3ffe78557..7d2911ca45 100644 --- a/src/panels/config/info/ha-config-info.ts +++ b/src/panels/config/info/ha-config-info.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, html, LitElement, property, @@ -161,7 +161,7 @@ class HaConfigInfo extends LitElement { }, 1000); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/info/integrations-card.ts b/src/panels/config/info/integrations-card.ts index 42287dda06..eb0c876148 100644 --- a/src/panels/config/info/integrations-card.ts +++ b/src/panels/config/info/integrations-card.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -27,11 +27,11 @@ class IntegrationsCard extends LitElement { @property({ type: Boolean }) public narrow = false; - @internalProperty() private _manifests?: { + @state() private _manifests?: { [domain: string]: IntegrationManifest; }; - @internalProperty() private _setups?: { + @state() private _setups?: { [domain: string]: IntegrationSetup; }; @@ -152,7 +152,7 @@ class IntegrationsCard extends LitElement { this._setups = setups; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` table { width: 100%; diff --git a/src/panels/config/info/system-health-card.ts b/src/panels/config/info/system-health-card.ts index ebdcf8f4e4..85728fec70 100644 --- a/src/panels/config/info/system-health-card.ts +++ b/src/panels/config/info/system-health-card.ts @@ -6,9 +6,9 @@ import { mdiContentCopy } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -48,7 +48,7 @@ const sortKeys = (a: string, b: string) => { class SystemHealthCard extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _info?: SystemHealthInfo; + @state() private _info?: SystemHealthInfo; protected render(): TemplateResult { if (!this.hass) { @@ -260,7 +260,7 @@ class SystemHealthCard extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` table { width: 100%; diff --git a/src/panels/config/integrations/ha-config-integrations.ts b/src/panels/config/integrations/ha-config-integrations.ts index 3bfe8bb69b..731ece01c0 100644 --- a/src/panels/config/integrations/ha-config-integrations.ts +++ b/src/panels/config/integrations/ha-config-integrations.ts @@ -6,10 +6,10 @@ import Fuse from "fuse.js"; import type { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -114,31 +114,31 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { @property() public route!: Route; - @internalProperty() private _configEntries?: ConfigEntryExtended[]; + @state() private _configEntries?: ConfigEntryExtended[]; @property() private _configEntriesInProgress: DataEntryFlowProgressExtended[] = []; - @internalProperty() + @state() private _entityRegistryEntries: EntityRegistryEntry[] = []; - @internalProperty() + @state() private _deviceRegistryEntries: DeviceRegistryEntry[] = []; - @internalProperty() + @state() private _manifests: Record = {}; private _extraFetchedManifests?: Set; - @internalProperty() private _showIgnored = false; + @state() private _showIgnored = false; - @internalProperty() private _showDisabled = false; + @state() private _showDisabled = false; - @internalProperty() private _searchParms = new URLSearchParams( + @state() private _searchParms = new URLSearchParams( window.location.hash.substring(1) ); - @internalProperty() private _filter?: string; + @state() private _filter?: string; public hassSubscribe(): UnsubscribeFunc[] { return [ @@ -624,7 +624,7 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/ha-integration-card.ts b/src/panels/config/integrations/ha-integration-card.ts index 44cd2866c7..e35512b06f 100644 --- a/src/panels/config/integrations/ha-integration-card.ts +++ b/src/panels/config/integrations/ha-integration-card.ts @@ -7,7 +7,7 @@ import "@polymer/paper-tooltip/paper-tooltip"; import { mdiAlertCircle, mdiDotsVertical, mdiOpenInNew } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -581,7 +581,7 @@ export class HaIntegrationCard extends LitElement { fireEvent(this, "entry-updated", { entry: newEntry }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, haStyleScrollbar, diff --git a/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts index a7e971bfca..827e6aef6b 100644 --- a/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts @@ -2,10 +2,10 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -25,9 +25,9 @@ class HaPanelDevMqtt extends LitElement { @property({ type: Boolean }) public narrow!: boolean; - @internalProperty() private topic = ""; + @state() private topic = ""; - @internalProperty() private payload = ""; + @state() private payload = ""; private inited = false; @@ -123,7 +123,7 @@ class HaPanelDevMqtt extends LitElement { showOptionsFlowDialog(this, configEntry!); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts index 532b8f7873..22b3ab4a54 100644 --- a/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts @@ -2,10 +2,10 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -19,11 +19,11 @@ import { HomeAssistant } from "../../../../../types"; class MqttSubscribeCard extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _topic = ""; + @state() private _topic = ""; - @internalProperty() private _subscribed?: () => void; + @state() private _subscribed?: () => void; - @internalProperty() private _messages: Array<{ + @state() private _messages: Array<{ id: number; message: MQTTMessage; payload: string; @@ -129,7 +129,7 @@ class MqttSubscribeCard extends LitElement { ]; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` form { display: block; diff --git a/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts b/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts index f041c1c370..1f8faf19bb 100644 --- a/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts +++ b/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -26,17 +26,17 @@ import { OZWRefreshNodeDialogParams } from "./show-dialog-ozw-refresh-node"; class DialogOZWRefreshNode extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _node_id?: number; + @state() private _node_id?: number; - @internalProperty() private _ozw_instance = 1; + @state() private _ozw_instance = 1; - @internalProperty() private _nodeMetaData?: OZWDeviceMetaData; + @state() private _nodeMetaData?: OZWDeviceMetaData; - @internalProperty() private _node?: OZWDevice; + @state() private _node?: OZWDevice; - @internalProperty() private _active = false; + @state() private _active = false; - @internalProperty() private _complete = false; + @state() private _complete = false; private _refreshDevicesTimeoutHandle?: number; @@ -234,7 +234,7 @@ class DialogOZWRefreshNode extends LitElement { this._node = undefined; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts index dba134523b..8856c3a24c 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts @@ -4,10 +4,10 @@ import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -44,7 +44,7 @@ class OZWConfigDashboard extends LitElement { @property() public configEntryId?: string; - @internalProperty() private _instances?: OZWInstance[]; + @state() private _instances?: OZWInstance[]; protected firstUpdated() { this._fetchData(); @@ -159,7 +159,7 @@ class OZWConfigDashboard extends LitElement { } } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts index 655d1fae01..10f5e38d97 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts @@ -2,10 +2,10 @@ import "@material/mwc-button/mwc-button"; import { mdiCheckCircle, mdiCircle, mdiCloseCircle } from "@mdi/js"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -44,13 +44,13 @@ class OZWNetworkDashboard extends LitElement { @property() public ozwInstance?: number; - @internalProperty() private _network?: OZWInstance; + @state() private _network?: OZWInstance; - @internalProperty() private _statistics?: OZWNetworkStatistics; + @state() private _statistics?: OZWNetworkStatistics; - @internalProperty() private _status = "unknown"; + @state() private _status = "unknown"; - @internalProperty() private _icon = mdiCircle; + @state() private _icon = mdiCircle; protected firstUpdated() { if (!this.ozwInstance) { @@ -172,7 +172,7 @@ class OZWNetworkDashboard extends LitElement { `; } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts index 1983aba1a2..da9f5175a3 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { mdiAlert, mdiCheck } from "@mdi/js"; import { - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -46,7 +46,7 @@ class OZWNetworkNodes extends LitElement { @property() public ozwInstance = 0; - @internalProperty() private _nodes: OZWDevice[] = []; + @state() private _nodes: OZWDevice[] = []; private _columns = memoizeOne( (narrow: boolean): DataTableColumnContainer => ({ @@ -127,7 +127,7 @@ class OZWNetworkNodes extends LitElement { navigate(this, `/config/ozw/network/${this.ozwInstance}/node/${nodeId}`); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return haStyle; } } diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts index d495a45d76..ec55e61569 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -45,13 +45,13 @@ class OZWNodeConfig extends LitElement { @property() public nodeId?; - @internalProperty() private _node?: OZWDevice; + @state() private _node?: OZWDevice; - @internalProperty() private _metadata?: OZWDeviceMetaDataResponse; + @state() private _metadata?: OZWDeviceMetaDataResponse; - @internalProperty() private _config?: OZWDeviceConfig[]; + @state() private _config?: OZWDeviceConfig[]; - @internalProperty() private _error?: string; + @state() private _error?: string; protected firstUpdated() { if (!this.ozwInstance) { @@ -221,7 +221,7 @@ class OZWNodeConfig extends LitElement { }); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts index ff13a68f2f..b8a6bcf5bd 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -43,11 +43,11 @@ class OZWNodeDashboard extends LitElement { @property() public nodeId?; - @internalProperty() private _node?: OZWDevice; + @state() private _node?: OZWDevice; - @internalProperty() private _metadata?: OZWDeviceMetaDataResponse; + @state() private _metadata?: OZWDeviceMetaDataResponse; - @internalProperty() private _not_found = false; + @state() private _not_found = false; protected firstUpdated() { if (!this.ozwInstance) { @@ -189,7 +189,7 @@ class OZWNodeDashboard extends LitElement { }); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts index 3632eb748f..8af5413706 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts @@ -1,8 +1,8 @@ import { - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -33,13 +33,13 @@ import "./zha-group-binding"; class DialogZHACluster extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _device?: ZHADevice; + @state() private _device?: ZHADevice; - @internalProperty() private _selectedCluster?: Cluster; + @state() private _selectedCluster?: Cluster; - @internalProperty() private _bindableDevices: ZHADevice[] = []; + @state() private _bindableDevices: ZHADevice[] = []; - @internalProperty() private _groups: ZHAGroup[] = []; + @state() private _groups: ZHAGroup[] = []; public async showDialog( params: ZHADeviceZigbeeInfoDialogParams @@ -132,7 +132,7 @@ class DialogZHACluster extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return haStyleDialog; } } diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-children.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-children.ts index 135776a74a..b8330b5826 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-children.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-children.ts @@ -1,8 +1,8 @@ import { - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -33,9 +33,9 @@ export interface DeviceRowData extends DataTableRowData { class DialogZHADeviceChildren extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _device: ZHADevice | undefined; + @state() private _device: ZHADevice | undefined; - @internalProperty() private _devices: Map | undefined; + @state() private _devices: Map | undefined; private _deviceChildren = memoizeOne( ( @@ -132,7 +132,7 @@ class DialogZHADeviceChildren extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return haStyleDialog; } } diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts index d0fc98269f..17bb63f3f8 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts @@ -1,8 +1,8 @@ import { - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -17,7 +17,7 @@ import { ZHADeviceZigbeeInfoDialogParams } from "./show-dialog-zha-device-zigbee class DialogZHADeviceZigbeeInfo extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _signature: any; + @state() private _signature: any; public async showDialog( params: ZHADeviceZigbeeInfoDialogParams @@ -59,7 +59,7 @@ class DialogZHADeviceZigbeeInfo extends LitElement { this._signature = undefined; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return haStyleDialog; } } diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts index e32e984729..1e82acbb8d 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -34,22 +34,22 @@ import { createCloseHeading } from "../../../../../components/ha-dialog"; class DialogZHAReconfigureDevice extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _status?: string; + @state() private _status?: string; - @internalProperty() private _stages?: string[]; + @state() private _stages?: string[]; - @internalProperty() private _clusterConfigurationStatuses?: Map< + @state() private _clusterConfigurationStatuses?: Map< number, ClusterConfigurationStatus > = new Map(); - @internalProperty() private _params: + @state() private _params: | ZHAReconfigureDeviceDialogParams | undefined = undefined; - @internalProperty() private _allSuccessful = true; + @state() private _allSuccessful = true; - @internalProperty() private _showDetails = false; + @state() private _showDetails = false; private _subscribed?: Promise; @@ -397,7 +397,7 @@ class DialogZHAReconfigureDevice extends LitElement { this._showDetails = !this._showDetails; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts index eceb2fa034..c68bba9760 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts @@ -3,10 +3,10 @@ import { IronAutogrowTextareaElement } from "@polymer/iron-autogrow-textarea"; import "@polymer/paper-input/paper-textarea"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -36,20 +36,17 @@ class ZHAAddDevicesPage extends LitElement { @property() public route?: Route; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _discoveredDevices: Record< - string, - ZHADevice - > = {}; + @state() private _discoveredDevices: Record = {}; - @internalProperty() private _formattedEvents = ""; + @state() private _formattedEvents = ""; - @internalProperty() private _active = false; + @state() private _active = false; - @internalProperty() private _showHelp = false; + @state() private _showHelp = false; - @internalProperty() private _showLogs = false; + @state() private _showLogs = false; private _ieeeAddress?: string; @@ -217,7 +214,7 @@ class ZHAAddDevicesPage extends LitElement { ); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts index 81765c1810..840d2ebea3 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts @@ -3,10 +3,10 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -38,9 +38,9 @@ export class ZHAAddGroupPage extends LitElement { @property({ type: Array }) public deviceEndpoints: ZHADeviceEndpoint[] = []; - @internalProperty() private _processingAdd = false; + @state() private _processingAdd = false; - @internalProperty() private _groupName = ""; + @state() private _groupName = ""; @query("zha-device-endpoint-data-table", true) private _zhaDevicesDataTable!: ZHADeviceEndpointDataTable; @@ -155,7 +155,7 @@ export class ZHAAddGroupPage extends LitElement { this._groupName = target.value || ""; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ css` .header { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts b/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts index 2ef7ed2784..69e3c2f120 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts @@ -5,9 +5,9 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -46,15 +46,15 @@ export class ZHAClusterAttributes extends LitElement { @property() public selectedCluster?: Cluster; - @internalProperty() private _attributes: Attribute[] = []; + @state() private _attributes: Attribute[] = []; - @internalProperty() private _selectedAttributeIndex = -1; + @state() private _selectedAttributeIndex = -1; - @internalProperty() private _attributeValue?: any = ""; + @state() private _attributeValue?: any = ""; - @internalProperty() private _manufacturerCodeOverride?: string | number; + @state() private _manufacturerCodeOverride?: string | number; - @internalProperty() + @state() private _setAttributeServiceData?: SetAttributeServiceData; protected updated(changedProperties: PropertyValues): void { @@ -273,7 +273,7 @@ export class ZHAClusterAttributes extends LitElement { this._attributeValue = ""; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts b/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts index f66f398148..bae849aff9 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts @@ -4,9 +4,9 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -41,15 +41,15 @@ export class ZHAClusterCommands extends LitElement { @property() public selectedCluster?: Cluster; - @internalProperty() private _showHelp = false; + @state() private _showHelp = false; - @internalProperty() private _commands: Command[] = []; + @state() private _commands: Command[] = []; - @internalProperty() private _selectedCommandIndex = -1; + @state() private _selectedCommandIndex = -1; - @internalProperty() private _manufacturerCodeOverride?: number; + @state() private _manufacturerCodeOverride?: number; - @internalProperty() + @state() private _issueClusterCommandServiceData?: IssueCommandServiceData; protected updated(changedProperties: PropertyValues): void { @@ -205,7 +205,7 @@ export class ZHAClusterCommands extends LitElement { this._issueClusterCommandServiceData = this._computeIssueClusterCommandServiceData(); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts b/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts index 9761d1b0b6..46b4c6caea 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts @@ -3,9 +3,9 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -45,9 +45,9 @@ export class ZHAClusters extends LitElement { @property() public showHelp = false; - @internalProperty() private _selectedClusterIndex = -1; + @state() private _selectedClusterIndex = -1; - @internalProperty() private _clusters: Cluster[] = []; + @state() private _clusters: Cluster[] = []; protected updated(changedProperties: PropertyValues): void { if (changedProperties.has("selectedDevice")) { @@ -132,7 +132,7 @@ export class ZHAClusters extends LitElement { this.showHelp = !this.showHelp; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts index fd67ae4c04..d8241f67a9 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts @@ -4,7 +4,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -169,7 +169,7 @@ class ZHAConfigDashboard extends LitElement { schema.name; } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts index 41d269f69c..5cbd2a947e 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts @@ -4,10 +4,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -31,13 +31,13 @@ export class ZHADeviceBindingControl extends LitElement { @property() public selectedDevice?: ZHADevice; - @internalProperty() private _showHelp = false; + @state() private _showHelp = false; - @internalProperty() private _bindTargetIndex = -1; + @state() private _bindTargetIndex = -1; - @internalProperty() private bindableDevices: ZHADevice[] = []; + @state() private bindableDevices: ZHADevice[] = []; - @internalProperty() private _deviceToBind?: ZHADevice; + @state() private _deviceToBind?: ZHADevice; protected updated(changedProperties: PropertyValues): void { if (changedProperties.has("selectedDevice")) { @@ -142,7 +142,7 @@ export class ZHADeviceBindingControl extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts index 763bb5d49a..eeae2aa242 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts @@ -3,12 +3,12 @@ import "@polymer/paper-listbox/paper-listbox"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, property, - internalProperty, + state, TemplateResult, } from "lit-element"; import { fireEvent } from "../../../../../common/dom/fire_event"; @@ -43,7 +43,7 @@ class ZHADeviceCard extends SubscribeMixin(LitElement) { @property({ type: Boolean }) public narrow?: boolean; - @internalProperty() private _entities: EntityRegistryEntry[] = []; + @state() private _entities: EntityRegistryEntry[] = []; private _deviceEntities = memoizeOne( ( @@ -206,7 +206,7 @@ class ZHADeviceCard extends SubscribeMixin(LitElement) { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts index 2b09a8220a..d0d79c8dd3 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -156,7 +156,7 @@ export class ZHADeviceEndpointDataTable extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ css` .table-cell-text { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts index d3422dd828..4721363bc6 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts @@ -2,10 +2,10 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -36,7 +36,7 @@ class ZHADevicePairingStatusCard extends LitElement { @property({ type: Boolean }) public narrow?: boolean; - @internalProperty() private _showHelp = false; + @state() private _showHelp = false; protected render(): TemplateResult { if (!this.hass || !this.device) { @@ -102,7 +102,7 @@ class ZHADevicePairingStatusCard extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts b/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts index 449db0795a..571d5c7101 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts @@ -4,10 +4,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -45,15 +45,15 @@ export class ZHAGroupBindingControl extends LitElement { @property() public selectedDevice?: ZHADevice; - @internalProperty() private _showHelp = false; + @state() private _showHelp = false; - @internalProperty() private _bindTargetIndex = -1; + @state() private _bindTargetIndex = -1; - @internalProperty() private groups: ZHAGroup[] = []; + @state() private groups: ZHAGroup[] = []; - @internalProperty() private _selectedClusters: string[] = []; + @state() private _selectedClusters: string[] = []; - @internalProperty() private _clusters: Cluster[] = []; + @state() private _clusters: Cluster[] = []; private _groupToBind?: ZHAGroup; @@ -250,7 +250,7 @@ export class ZHAGroupBindingControl extends LitElement { ); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts index e56c145673..2a52714a02 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts @@ -1,10 +1,10 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -46,16 +46,16 @@ export class ZHAGroupPage extends LitElement { @property({ type: Array }) public deviceEndpoints: ZHADeviceEndpoint[] = []; - @internalProperty() private _processingAdd = false; + @state() private _processingAdd = false; - @internalProperty() private _processingRemove = false; + @state() private _processingRemove = false; - @internalProperty() + @state() private _filteredDeviceEndpoints: ZHADeviceEndpoint[] = []; - @internalProperty() private _selectedDevicesToAdd: string[] = []; + @state() private _selectedDevicesToAdd: string[] = []; - @internalProperty() private _selectedDevicesToRemove: string[] = []; + @state() private _selectedDevicesToRemove: string[] = []; @query("#addMembers", true) private _zhaAddMembersDataTable!: ZHADeviceEndpointDataTable; @@ -285,7 +285,7 @@ export class ZHAGroupPage extends LitElement { navigate(this, `/config/zha/groups`, true); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ css` hass-subpage { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts b/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts index ce1e02415a..b11428b9fa 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts @@ -2,7 +2,7 @@ import "@material/mwc-button"; import { mdiPlus } from "@mdi/js"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -144,7 +144,7 @@ export class ZHAGroupsDashboard extends LitElement { navigate(this, `/config/zha/group/${groupId}`); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts index c1937537c1..ac195ca760 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -47,19 +47,19 @@ export class ZHANetworkVisualizationPage extends LitElement { @query("#visualization", true) private _visualization?: HTMLElement; - @internalProperty() + @state() private _devices: Map = new Map(); - @internalProperty() + @state() private _devicesByDeviceId: Map = new Map(); - @internalProperty() + @state() private _nodes: Node[] = []; - @internalProperty() + @state() private _network?: Network; - @internalProperty() + @state() private _filter?: string; private _autoZoom = true; @@ -361,7 +361,7 @@ export class ZHANetworkVisualizationPage extends LitElement { this._autoZoom = (ev.target as HaCheckbox).checked; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ css` .header { diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts index 5ea9be159f..114c146bdf 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts @@ -6,12 +6,12 @@ import "../../../../../components/ha-circular-progress"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, property, - internalProperty, + state, TemplateResult, } from "lit-element"; import "../../../../../components/buttons/ha-call-api-button"; @@ -51,19 +51,19 @@ export class ZwaveMigration extends LitElement { @property({ type: Boolean }) public isWide!: boolean; - @internalProperty() private _networkStatus?: ZWaveNetworkStatus; + @state() private _networkStatus?: ZWaveNetworkStatus; - @internalProperty() private _step = 0; + @state() private _step = 0; - @internalProperty() private _stoppingNetwork = false; + @state() private _stoppingNetwork = false; - @internalProperty() private _migrationConfig?: ZWaveMigrationConfig; + @state() private _migrationConfig?: ZWaveMigrationConfig; - @internalProperty() private _migrationData?: OZWMigrationData; + @state() private _migrationData?: OZWMigrationData; - @internalProperty() private _migratedZwaveEntities?: string[]; + @state() private _migratedZwaveEntities?: string[]; - @internalProperty() private _deviceNameLookup: { [id: string]: string } = {}; + @state() private _deviceNameLookup: { [id: string]: string } = {}; private _unsub?: Promise; @@ -461,7 +461,7 @@ export class ZwaveMigration extends LitElement { this._networkStatus = await fetchNetworkStatus(this.hass!); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts index b9860c0589..e162edacc9 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts @@ -1,10 +1,10 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -35,11 +35,11 @@ export class ZwaveNetwork extends LitElement { @property() public isWide!: boolean; - @internalProperty() private _showHelp = false; + @state() private _showHelp = false; - @internalProperty() private _networkStatus?: ZWaveNetworkStatus; + @state() private _networkStatus?: ZWaveNetworkStatus; - @internalProperty() private _unsubs: Array> = []; + @state() private _unsubs: Array> = []; public disconnectedCallback(): void { this._unsubscribe(); @@ -239,7 +239,7 @@ export class ZwaveNetwork extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts index 343cc3b479..4bc1542a51 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts @@ -4,10 +4,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -34,13 +34,13 @@ export class ZwaveNodeConfig extends LitElement { @property() public selectedNode = -1; - @internalProperty() private _configItem?: ZWaveConfigItem; + @state() private _configItem?: ZWaveConfigItem; - @internalProperty() private _wakeupInput = -1; + @state() private _wakeupInput = -1; - @internalProperty() private _selectedConfigParameter = -1; + @state() private _selectedConfigParameter = -1; - @internalProperty() private _selectedConfigValue: number | string = -1; + @state() private _selectedConfigValue: number | string = -1; protected render(): TemplateResult { return html` @@ -107,9 +107,9 @@ export class ZwaveNodeConfig extends LitElement { @iron-select=${this._selectedConfigParameterChanged} > ${this.config.map( - (state) => html` + (entityState) => html` - ${state.key}: ${state.value.label} + ${entityState.key}: ${entityState.value.label} ` )} @@ -135,8 +135,8 @@ export class ZwaveNodeConfig extends LitElement { @iron-select=${this._configValueSelectChanged} > ${this._configItem.value.data_items.map( - (state) => html` - ${state} + (entityState) => html` + ${entityState} ` )} @@ -218,7 +218,7 @@ export class ZwaveNodeConfig extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts index 9d2ee97f3e..719a57a493 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts @@ -3,10 +3,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -23,7 +23,7 @@ export class ZwaveValues extends LitElement { @property() public values: ZWaveValue[] = []; - @internalProperty() private _selectedValue = -1; + @state() private _selectedValue = -1; protected render(): TemplateResult { return html` @@ -54,7 +54,7 @@ export class ZwaveValues extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts index fa9f30869e..484b240212 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts @@ -3,12 +3,12 @@ import { mdiCheckCircle, mdiCloseCircle } from "@mdi/js"; import "../../../../../components/ha-switch"; import "../../../../../components/ha-formfield"; import { - CSSResult, + CSSResultGroup, customElement, html, LitElement, property, - internalProperty, + state, TemplateResult, css, } from "lit-element"; @@ -28,13 +28,13 @@ export interface ZWaveJSAddNodeDevice { class DialogZWaveJSAddNode extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private entry_id?: string; + @state() private entry_id?: string; - @internalProperty() private _use_secure_inclusion = false; + @state() private _use_secure_inclusion = false; - @internalProperty() private _status = ""; + @state() private _status = ""; - @internalProperty() private _device?: ZWaveJSAddNodeDevice; + @state() private _device?: ZWaveJSAddNodeDevice; private _addNodeTimeoutHandle?: number; @@ -252,7 +252,7 @@ class DialogZWaveJSAddNode extends LitElement { fireEvent(this, "dialog-closed", { dialog: this.localName }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-reinterview-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-reinterview-node.ts index 7dfc9a999a..f15acf8846 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-reinterview-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-reinterview-node.ts @@ -6,7 +6,7 @@ import { html, LitElement, property, - internalProperty, + state, TemplateResult, css, } from "lit-element"; @@ -23,13 +23,13 @@ import { reinterviewNode } from "../../../../../data/zwave_js"; class DialogZWaveJSReinterviewNode extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private entry_id?: string; + @state() private entry_id?: string; - @internalProperty() private node_id?: number; + @state() private node_id?: number; - @internalProperty() private _status?: string; + @state() private _status?: string; - @internalProperty() private _stages?: string[]; + @state() private _stages?: string[]; private _subscribed?: Promise; diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts index a319ad8ce9..5c575d41e2 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts @@ -1,11 +1,11 @@ import "@material/mwc-button/mwc-button"; import { - CSSResult, + CSSResultGroup, customElement, html, LitElement, property, - internalProperty, + state, TemplateResult, css, } from "lit-element"; @@ -27,11 +27,11 @@ export interface ZWaveJSRemovedNode { class DialogZWaveJSRemoveNode extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private entry_id?: string; + @state() private entry_id?: string; - @internalProperty() private _status = ""; + @state() private _status = ""; - @internalProperty() private _node?: ZWaveJSRemovedNode; + @state() private _node?: ZWaveJSRemovedNode; private _removeNodeTimeoutHandle?: number; @@ -213,7 +213,7 @@ class DialogZWaveJSRemoveNode extends LitElement { fireEvent(this, "dialog-closed", { dialog: this.localName }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts index eb53eeafba..5e082e90e7 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts @@ -3,10 +3,10 @@ import "@material/mwc-icon-button/mwc-icon-button"; import { mdiCheckCircle, mdiCircle, mdiRefresh } from "@mdi/js"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -49,15 +49,15 @@ class ZWaveJSConfigDashboard extends LitElement { @property() public configEntryId?: string; - @internalProperty() private _network?: ZWaveJSNetwork; + @state() private _network?: ZWaveJSNetwork; - @internalProperty() private _nodes?: ZWaveJSNode[]; + @state() private _nodes?: ZWaveJSNode[]; - @internalProperty() private _status = "unknown"; + @state() private _status = "unknown"; - @internalProperty() private _icon = mdiCircle; + @state() private _icon = mdiCircle; - @internalProperty() private _dataCollectionOptIn?: boolean; + @state() private _dataCollectionOptIn?: boolean; protected firstUpdated() { if (this.hass) { @@ -328,7 +328,7 @@ class ZWaveJSConfigDashboard extends LitElement { this.shadowRoot!.removeChild(a); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts index b51a9d8163..d8efb4ed06 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts @@ -6,7 +6,7 @@ import { customElement, LitElement, CSSResultArray, - internalProperty, + state, query, } from "lit-element"; import "@polymer/paper-listbox/paper-listbox"; @@ -33,7 +33,7 @@ class ZWaveJSLogs extends SubscribeMixin(LitElement) { @property() public configEntryId!: string; - @internalProperty() private _logConfig?: ZWaveJSLogConfig; + @state() private _logConfig?: ZWaveJSLogConfig; @query("textarea", true) private _textarea?: HTMLTextAreaElement; diff --git a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts index bc850d348f..47a81f57e7 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts @@ -12,10 +12,10 @@ import "@material/mwc-button/mwc-button"; import "@material/mwc-icon-button/mwc-icon-button"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -91,14 +91,11 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) { @property({ type: Array }) private _deviceRegistryEntries?: DeviceRegistryEntry[]; - @internalProperty() private _config?: ZWaveJSNodeConfigParams; + @state() private _config?: ZWaveJSNodeConfigParams; - @internalProperty() private _results: Record< - string, - ZWaveJSSetConfigParamResult - > = {}; + @state() private _results: Record = {}; - @internalProperty() private _error?: string; + @state() private _error?: string; public connectedCallback(): void { super.connectedCallback(); @@ -294,8 +291,8 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) { @iron-select=${this._dropdownSelected} > ${Object.entries(item.metadata.states).map( - ([key, state]) => html` - ${state} + ([key, entityState]) => html` + ${entityState} ` )} @@ -428,7 +425,7 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) { ); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/logs/dialog-system-log-detail.ts b/src/panels/config/logs/dialog-system-log-detail.ts index db8a33c244..2eed2d9224 100644 --- a/src/panels/config/logs/dialog-system-log-detail.ts +++ b/src/panels/config/logs/dialog-system-log-detail.ts @@ -3,9 +3,9 @@ import { mdiClose, mdiContentCopy, mdiPackageVariant } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -34,9 +34,9 @@ import { formatSystemLogTime } from "./util"; class DialogSystemLogDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _params?: SystemLogDetailDialogParams; + @state() private _params?: SystemLogDetailDialogParams; - @internalProperty() private _manifest?: IntegrationManifest; + @state() private _manifest?: IntegrationManifest; public async showDialog(params: SystemLogDetailDialogParams): Promise { this._params = params; @@ -197,7 +197,7 @@ class DialogSystemLogDetail extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/logs/error-log-card.ts b/src/panels/config/logs/error-log-card.ts index 2dd3fc9ceb..1f10e7a5a1 100644 --- a/src/panels/config/logs/error-log-card.ts +++ b/src/panels/config/logs/error-log-card.ts @@ -1,9 +1,9 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -15,7 +15,7 @@ import { HomeAssistant } from "../../../types"; class ErrorLogCard extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _errorHTML!: TemplateResult[] | string; + @state() private _errorHTML!: TemplateResult[] | string; protected render(): TemplateResult { return html` @@ -47,7 +47,7 @@ class ErrorLogCard extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .error-log-intro { text-align: center; diff --git a/src/panels/config/logs/ha-config-logs.ts b/src/panels/config/logs/ha-config-logs.ts index a8c822ccd1..a2166e3ba4 100644 --- a/src/panels/config/logs/ha-config-logs.ts +++ b/src/panels/config/logs/ha-config-logs.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -54,7 +54,7 @@ export class HaConfigLogs extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/logs/system-log-card.ts b/src/panels/config/logs/system-log-card.ts index 3cc184b8be..61d03b3da9 100644 --- a/src/panels/config/logs/system-log-card.ts +++ b/src/panels/config/logs/system-log-card.ts @@ -2,10 +2,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -32,7 +32,7 @@ export class SystemLogCard extends LitElement { public loaded = false; - @internalProperty() private _items?: LoggedError[]; + @state() private _items?: LoggedError[]; public async fetchData(): Promise { this._items = undefined; @@ -154,7 +154,7 @@ export class SystemLogCard extends LitElement { showSystemLogDetailDialog(this, { item }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { padding-top: 16px; diff --git a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts index 3ed55ea16d..5748d93f78 100644 --- a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts +++ b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -31,22 +31,22 @@ import { LovelaceDashboardDetailsDialogParams } from "./show-dialog-lovelace-das export class DialogLovelaceDashboardDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _params?: LovelaceDashboardDetailsDialogParams; + @state() private _params?: LovelaceDashboardDetailsDialogParams; - @internalProperty() private _urlPath!: LovelaceDashboard["url_path"]; + @state() private _urlPath!: LovelaceDashboard["url_path"]; - @internalProperty() private _showInSidebar!: boolean; + @state() private _showInSidebar!: boolean; - @internalProperty() private _icon!: string; + @state() private _icon!: string; - @internalProperty() private _title!: string; + @state() private _title!: string; - @internalProperty() + @state() private _requireAdmin!: LovelaceDashboard["require_admin"]; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _submitting = false; + @state() private _submitting = false; public async showDialog( params: LovelaceDashboardDetailsDialogParams @@ -322,7 +322,7 @@ export class DialogLovelaceDashboardDetail extends LitElement { this._params = undefined; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts index e40fbcd9db..2eef3839fe 100644 --- a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts +++ b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts @@ -3,7 +3,7 @@ import "@polymer/paper-tooltip/paper-tooltip"; import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -46,7 +46,7 @@ export class HaConfigLovelaceDashboards extends LitElement { @property() public route!: Route; - @internalProperty() private _dashboards: LovelaceDashboard[] = []; + @state() private _dashboards: LovelaceDashboard[] = []; private _columns = memoize( (narrow: boolean, _language, dashboards): DataTableColumnContainer => { diff --git a/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts b/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts index ff4df8eb82..48836d8a46 100644 --- a/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts +++ b/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts @@ -4,10 +4,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -41,15 +41,15 @@ const detectResourceType = (url: string) => { export class DialogLovelaceResourceDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _params?: LovelaceResourceDetailsDialogParams; + @state() private _params?: LovelaceResourceDetailsDialogParams; - @internalProperty() private _url!: LovelaceResource["url"]; + @state() private _url!: LovelaceResource["url"]; - @internalProperty() private _type?: LovelaceResource["type"]; + @state() private _type?: LovelaceResource["type"]; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _submitting = false; + @state() private _submitting = false; public async showDialog( params: LovelaceResourceDetailsDialogParams @@ -236,7 +236,7 @@ export class DialogLovelaceResourceDetail extends LitElement { this._params = undefined; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts index 68a64a4b65..8366b52051 100644 --- a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts +++ b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts @@ -6,7 +6,7 @@ import "@polymer/paper-listbox/paper-listbox"; import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -49,7 +49,7 @@ export class HaConfigLovelaceRescources extends LitElement { @property() public route!: Route; - @internalProperty() private _resources: LovelaceResource[] = []; + @state() private _resources: LovelaceResource[] = []; private _columns = memoize( (_language): DataTableColumnContainer => ({ diff --git a/src/panels/config/person/dialog-person-detail.ts b/src/panels/config/person/dialog-person-detail.ts index 9d83ae4d9a..d9fb7f3dca 100644 --- a/src/panels/config/person/dialog-person-detail.ts +++ b/src/panels/config/person/dialog-person-detail.ts @@ -2,9 +2,9 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -50,25 +50,25 @@ const cropOptions: CropOptions = { class DialogPersonDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _userId?: string; + @state() private _userId?: string; - @internalProperty() private _user?: User; + @state() private _user?: User; - @internalProperty() private _isAdmin?: boolean; + @state() private _isAdmin?: boolean; - @internalProperty() private _deviceTrackers!: string[]; + @state() private _deviceTrackers!: string[]; - @internalProperty() private _picture!: string | null; + @state() private _picture!: string | null; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _params?: PersonDetailDialogParams; + @state() private _params?: PersonDetailDialogParams; - @internalProperty() private _submitting = false; + @state() private _submitting = false; - @internalProperty() private _personExists = false; + @state() private _personExists = false; private _deviceTrackersAvailable = memoizeOne((hass) => Object.keys(hass.states).some( @@ -438,7 +438,7 @@ class DialogPersonDetail extends LitElement { this._params = undefined; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/person/ha-config-person.ts b/src/panels/config/person/ha-config-person.ts index 697627e09f..3452320425 100644 --- a/src/panels/config/person/ha-config-person.ts +++ b/src/panels/config/person/ha-config-person.ts @@ -3,9 +3,9 @@ import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -47,9 +47,9 @@ class HaConfigPerson extends LitElement { @property() public route!: Route; - @internalProperty() private _storageItems?: Person[]; + @state() private _storageItems?: Person[]; - @internalProperty() private _configItems?: Person[]; + @state() private _configItems?: Person[]; private _usersLoad?: Promise; @@ -265,7 +265,7 @@ class HaConfigPerson extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` a { color: var(--primary-color); diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts index cdecf87ec2..846f209485 100644 --- a/src/panels/config/scene/ha-scene-dashboard.ts +++ b/src/panels/config/scene/ha-scene-dashboard.ts @@ -10,10 +10,10 @@ import { import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -52,9 +52,9 @@ class HaSceneDashboard extends LitElement { @property() private _activeFilters?: string[]; - @internalProperty() private _filteredScenes?: string[] | null; + @state() private _filteredScenes?: string[] | null; - @internalProperty() private _filterValue?; + @state() private _filterValue?; private _scenes = memoizeOne( (scenes: SceneEntity[], filteredScenes?: string[] | null) => { @@ -252,7 +252,7 @@ class HaSceneDashboard extends LitElement { }); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/scene/ha-scene-editor.ts b/src/panels/config/scene/ha-scene-editor.ts index 0fd4d9dcd1..545a5d12b8 100644 --- a/src/panels/config/scene/ha-scene-editor.ts +++ b/src/panels/config/scene/ha-scene-editor.ts @@ -5,10 +5,10 @@ import "@polymer/paper-item/paper-item-body"; import { HassEvent } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -89,29 +89,29 @@ export class HaSceneEditor extends SubscribeMixin( @property() public showAdvanced!: boolean; - @internalProperty() private _dirty = false; + @state() private _dirty = false; - @internalProperty() private _errors?: string; + @state() private _errors?: string; - @internalProperty() private _config?: SceneConfig; + @state() private _config?: SceneConfig; - @internalProperty() private _entities: string[] = []; + @state() private _entities: string[] = []; - @internalProperty() private _devices: string[] = []; + @state() private _devices: string[] = []; - @internalProperty() + @state() private _deviceRegistryEntries: DeviceRegistryEntry[] = []; - @internalProperty() + @state() private _entityRegistryEntries: EntityRegistryEntry[] = []; - @internalProperty() private _scene?: SceneEntity; + @state() private _scene?: SceneEntity; private _storedStates: SceneEntities = {}; private _unsubscribeEvents?: () => void; - @internalProperty() private _deviceEntityLookup: DeviceEntitiesLookup = {}; + @state() private _deviceEntityLookup: DeviceEntitiesLookup = {}; private _activateContextId?: string; @@ -686,9 +686,9 @@ export class HaSceneEditor extends SubscribeMixin( private _calculateStates(): SceneEntities { const output: SceneEntities = {}; this._entities.forEach((entityId) => { - const state = this._getCurrentState(entityId); - if (state) { - output[entityId] = state; + const entityState = this._getCurrentState(entityId); + if (entityState) { + output[entityId] = entityState; } }); return output; @@ -698,11 +698,11 @@ export class HaSceneEditor extends SubscribeMixin( if (entityId in this._storedStates) { return; } - const state = this._getCurrentState(entityId); - if (!state) { + const entityState = this._getCurrentState(entityId); + if (!entityState) { return; } - this._storedStates[entityId] = state; + this._storedStates[entityId] = entityState; } private _getCurrentState(entityId: string) { @@ -736,7 +736,7 @@ export class HaSceneEditor extends SubscribeMixin( this._saveScene(); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index e59a8b7429..bd11dc5bba 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -13,9 +13,9 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; import { PaperListboxElement } from "@polymer/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -69,17 +69,17 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { @property() public narrow!: boolean; - @internalProperty() private _config?: ScriptConfig; + @state() private _config?: ScriptConfig; - @internalProperty() private _entityId?: string; + @state() private _entityId?: string; - @internalProperty() private _idError = false; + @state() private _idError = false; - @internalProperty() private _dirty = false; + @state() private _dirty = false; - @internalProperty() private _errors?: string; + @state() private _errors?: string; - @internalProperty() private _mode: "gui" | "yaml" = "gui"; + @state() private _mode: "gui" | "yaml" = "gui"; @query("ha-yaml-editor", true) private _editor?: HaYamlEditor; @@ -681,7 +681,7 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { this._saveScript(); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index bd38f62599..aa2e527815 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -9,10 +9,10 @@ import { import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -50,9 +50,9 @@ class HaScriptPicker extends LitElement { @property() private _activeFilters?: string[]; - @internalProperty() private _filteredScripts?: string[] | null; + @state() private _filteredScripts?: string[] | null; - @internalProperty() private _filterValue?; + @state() private _filterValue?; private _scripts = memoizeOne( (scripts: HassEntity[], filteredScripts?: string[] | null) => { @@ -268,7 +268,7 @@ class HaScriptPicker extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/server_control/ha-config-server-control.ts b/src/panels/config/server_control/ha-config-server-control.ts index f63cfab076..8eb165aa71 100644 --- a/src/panels/config/server_control/ha-config-server-control.ts +++ b/src/panels/config/server_control/ha-config-server-control.ts @@ -4,10 +4,10 @@ import "@polymer/app-layout/app-toolbar/app-toolbar"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -35,9 +35,9 @@ export class HaConfigServerControl extends LitElement { @property() public showAdvanced!: boolean; - @internalProperty() private _validating = false; + @state() private _validating = false; - @internalProperty() private _reloadableDomains: string[] = []; + @state() private _reloadableDomains: string[] = []; private _validateLog = ""; @@ -242,7 +242,7 @@ export class HaConfigServerControl extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/config/tags/dialog-tag-detail.ts b/src/panels/config/tags/dialog-tag-detail.ts index 3a8655fd6c..0f7f551110 100644 --- a/src/panels/config/tags/dialog-tag-detail.ts +++ b/src/panels/config/tags/dialog-tag-detail.ts @@ -2,10 +2,10 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -28,17 +28,17 @@ class DialogTagDetail implements HassDialog { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _id?: string; + @state() private _id?: string; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _params?: TagDetailDialogParams; + @state() private _params?: TagDetailDialogParams; - @internalProperty() private _submitting = false; + @state() private _submitting = false; - @internalProperty() private _qrCode?: TemplateResult; + @state() private _qrCode?: TemplateResult; public showDialog(params: TagDetailDialogParams): void { this._params = params; @@ -252,7 +252,7 @@ class DialogTagDetail this._qrCode = html``; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/tags/ha-config-tags.ts b/src/panels/config/tags/ha-config-tags.ts index d543b5c6af..9c138eabe3 100644 --- a/src/panels/config/tags/ha-config-tags.ts +++ b/src/panels/config/tags/ha-config-tags.ts @@ -9,7 +9,7 @@ import { import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -57,9 +57,9 @@ export class HaConfigTags extends SubscribeMixin(LitElement) { @property() public route!: Route; - @internalProperty() private _tags: Tag[] = []; + @state() private _tags: Tag[] = []; - @internalProperty() private _canWriteTags = false; + @state() private _canWriteTags = false; private _columns = memoizeOne( ( diff --git a/src/panels/config/tags/tag-image.ts b/src/panels/config/tags/tag-image.ts index 7392b935cb..eae822f0b7 100644 --- a/src/panels/config/tags/tag-image.ts +++ b/src/panels/config/tags/tag-image.ts @@ -1,7 +1,7 @@ import { mdiNfcVariant } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -52,7 +52,7 @@ export class HaTagImage extends LitElement {
`; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .image { height: 100%; diff --git a/src/panels/config/users/dialog-add-user.ts b/src/panels/config/users/dialog-add-user.ts index b18bfc7a7e..850157a63f 100644 --- a/src/panels/config/users/dialog-add-user.ts +++ b/src/panels/config/users/dialog-add-user.ts @@ -2,10 +2,10 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -33,24 +33,24 @@ import { AddUserDialogParams } from "./show-dialog-add-user"; export class DialogAddUser extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _loading = false; + @state() private _loading = false; // Error message when can't talk to server etc - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _params?: AddUserDialogParams; + @state() private _params?: AddUserDialogParams; - @internalProperty() private _name?: string; + @state() private _name?: string; - @internalProperty() private _username?: string; + @state() private _username?: string; - @internalProperty() private _password?: string; + @state() private _password?: string; - @internalProperty() private _passwordConfirm?: string; + @state() private _passwordConfirm?: string; - @internalProperty() private _isAdmin?: boolean; + @state() private _isAdmin?: boolean; - @internalProperty() private _allowChangeName = true; + @state() private _allowChangeName = true; public showDialog(params: AddUserDialogParams) { this._params = params; @@ -264,7 +264,7 @@ export class DialogAddUser extends LitElement { this._close(); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/users/dialog-user-detail.ts b/src/panels/config/users/dialog-user-detail.ts index 7882b5ba16..864aaef4c4 100644 --- a/src/panels/config/users/dialog-user-detail.ts +++ b/src/panels/config/users/dialog-user-detail.ts @@ -3,10 +3,10 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -34,17 +34,17 @@ import { UserDetailDialogParams } from "./show-dialog-user-detail"; class DialogUserDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _isAdmin?: boolean; + @state() private _isAdmin?: boolean; - @internalProperty() private _isActive?: boolean; + @state() private _isActive?: boolean; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _params?: UserDetailDialogParams; + @state() private _params?: UserDetailDialogParams; - @internalProperty() private _submitting = false; + @state() private _submitting = false; public async showDialog(params: UserDetailDialogParams): Promise { this._params = params; @@ -295,7 +295,7 @@ class DialogUserDetail extends LitElement { this._params = undefined; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/zone/dialog-zone-detail.ts b/src/panels/config/zone/dialog-zone-detail.ts index d06e6bce0e..380d6ed767 100644 --- a/src/panels/config/zone/dialog-zone-detail.ts +++ b/src/panels/config/zone/dialog-zone-detail.ts @@ -2,9 +2,9 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -30,23 +30,23 @@ import { ZoneDetailDialogParams } from "./show-dialog-zone-detail"; class DialogZoneDetail extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _name!: string; + @state() private _name!: string; - @internalProperty() private _icon!: string; + @state() private _icon!: string; - @internalProperty() private _latitude!: number; + @state() private _latitude!: number; - @internalProperty() private _longitude!: number; + @state() private _longitude!: number; - @internalProperty() private _passive!: boolean; + @state() private _passive!: boolean; - @internalProperty() private _radius!: number; + @state() private _radius!: number; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _params?: ZoneDetailDialogParams; + @state() private _params?: ZoneDetailDialogParams; - @internalProperty() private _submitting = false; + @state() private _submitting = false; public showDialog(params: ZoneDetailDialogParams): void { this._params = params; @@ -282,7 +282,7 @@ class DialogZoneDetail extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/zone/ha-config-zone.ts b/src/panels/config/zone/ha-config-zone.ts index 0e1972f69e..328ff27072 100644 --- a/src/panels/config/zone/ha-config-zone.ts +++ b/src/panels/config/zone/ha-config-zone.ts @@ -8,10 +8,10 @@ import "@polymer/paper-tooltip/paper-tooltip"; import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -62,13 +62,13 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { @property() public route!: Route; - @internalProperty() private _storageItems?: Zone[]; + @state() private _storageItems?: Zone[]; - @internalProperty() private _stateItems?: HassEntity[]; + @state() private _stateItems?: HassEntity[]; - @internalProperty() private _activeEntry = ""; + @state() private _activeEntry = ""; - @internalProperty() private _canEditCore = false; + @state() private _canEditCore = false; @query("ha-locations-editor") private _map?: HaLocationsEditor; @@ -76,22 +76,25 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { private _getZones = memoizeOne( (storageItems: Zone[], stateItems: HassEntity[]): MarkerLocation[] => { - const stateLocations: MarkerLocation[] = stateItems.map((state) => ({ - id: state.entity_id, - icon: state.attributes.icon, - name: state.attributes.friendly_name || state.entity_id, - latitude: state.attributes.latitude, - longitude: state.attributes.longitude, - radius: state.attributes.radius, - radius_color: - state.entity_id === "zone.home" - ? homeRadiusColor - : state.attributes.passive - ? passiveRadiusColor - : defaultRadiusColor, - location_editable: state.entity_id === "zone.home" && this._canEditCore, - radius_editable: false, - })); + const stateLocations: MarkerLocation[] = stateItems.map( + (entityState) => ({ + id: entityState.entity_id, + icon: entityState.attributes.icon, + name: entityState.attributes.friendly_name || entityState.entity_id, + latitude: entityState.attributes.latitude, + longitude: entityState.attributes.longitude, + radius: entityState.attributes.radius, + radius_color: + entityState.entity_id === "zone.home" + ? homeRadiusColor + : entityState.attributes.passive + ? passiveRadiusColor + : defaultRadiusColor, + location_editable: + entityState.entity_id === "zone.home" && this._canEditCore, + radius_editable: false, + }) + ); const storageLocations: MarkerLocation[] = storageItems.map((zone) => ({ ...zone, radius_color: zone.passive ? passiveRadiusColor : defaultRadiusColor, @@ -161,22 +164,26 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { ` )} ${this._stateItems.map( - (state) => html` + (stateObject) => html` - + - ${state.attributes.friendly_name || state.entity_id} + ${stateObject.attributes.friendly_name || + stateObject.entity_id}
- ${state.entity_id === "zone.home" + ${stateObject.entity_id === "zone.home" ? this.hass.localize( `ui.panel.config.zone.${ this.narrow @@ -462,7 +469,7 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` hass-loading-screen { --app-header-background-color: var(--sidebar-background-color); diff --git a/src/panels/custom/ha-panel-custom.ts b/src/panels/custom/ha-panel-custom.ts index e000a4c7dd..0956624db4 100644 --- a/src/panels/custom/ha-panel-custom.ts +++ b/src/panels/custom/ha-panel-custom.ts @@ -1,4 +1,4 @@ -import { property, PropertyValues, UpdatingElement } from "lit-element"; +import { property, PropertyValues, ReactiveElement } from "lit-element"; import { navigate } from "../../common/navigate"; import { CustomPanelInfo } from "../../data/panel_custom"; import { HomeAssistant, Route } from "../../types"; @@ -15,7 +15,7 @@ declare global { } } -export class HaPanelCustom extends UpdatingElement { +export class HaPanelCustom extends ReactiveElement { @property({ attribute: false }) public hass!: HomeAssistant; @property() public narrow!: boolean; @@ -26,6 +26,10 @@ export class HaPanelCustom extends UpdatingElement { private _setProperties?: (props: Record) => void | undefined; + protected createRenderRoot() { + return this; + } + // Since navigate fires events on `window`, we need to expose this as a function // to allow custom panels to forward their location changes to the main window // instead of their iframe window. diff --git a/src/panels/developer-tools/event/event-subscribe-card.ts b/src/panels/developer-tools/event/event-subscribe-card.ts index 58a8fc27a7..3bdc41acbc 100644 --- a/src/panels/developer-tools/event/event-subscribe-card.ts +++ b/src/panels/developer-tools/event/event-subscribe-card.ts @@ -3,10 +3,10 @@ import "@polymer/paper-input/paper-input"; import { HassEvent } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -20,11 +20,11 @@ import { HomeAssistant } from "../../../types"; class EventSubscribeCard extends LitElement { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _eventType = ""; + @state() private _eventType = ""; - @internalProperty() private _subscribed?: () => void; + @state() private _subscribed?: () => void; - @internalProperty() private _events: Array<{ + @state() private _events: Array<{ id: number; event: HassEvent; }> = []; @@ -118,7 +118,7 @@ class EventSubscribeCard extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` form { display: block; diff --git a/src/panels/developer-tools/ha-panel-developer-tools.ts b/src/panels/developer-tools/ha-panel-developer-tools.ts index 3ad8fe9887..5ff7069cd6 100644 --- a/src/panels/developer-tools/ha-panel-developer-tools.ts +++ b/src/panels/developer-tools/ha-panel-developer-tools.ts @@ -3,7 +3,7 @@ import "@polymer/app-layout/app-toolbar/app-toolbar"; import "@polymer/paper-tabs/paper-tab"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -94,7 +94,7 @@ class PanelDeveloperTools extends LitElement { return this.route.path.substr(1); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/developer-tools/service/developer-tools-service.ts b/src/panels/developer-tools/service/developer-tools-service.ts index a7b3451a14..882dfab821 100644 --- a/src/panels/developer-tools/service/developer-tools-service.ts +++ b/src/panels/developer-tools/service/developer-tools-service.ts @@ -3,9 +3,9 @@ import { ERR_CONNECTION_LOST } from "home-assistant-js-websocket"; import { safeLoad } from "js-yaml"; import { css, - CSSResultArray, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, query, @@ -42,7 +42,7 @@ class HaPanelDevService extends LitElement { @property({ type: Boolean }) public narrow!: boolean; - @internalProperty() private _uiAvailable = true; + @state() private _uiAvailable = true; @LocalStorage("panel-dev-service-state-service-data", true) private _serviceData?: ServiceAction = { service: "", target: {}, data: {} }; @@ -381,7 +381,7 @@ class HaPanelDevService extends LitElement { this._yamlEditor?.setValue(this._serviceData); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/developer-tools/template/developer-tools-template.ts b/src/panels/developer-tools/template/developer-tools-template.ts index 9ec9c1c4ad..5b344be5d8 100644 --- a/src/panels/developer-tools/template/developer-tools-template.ts +++ b/src/panels/developer-tools/template/developer-tools-template.ts @@ -2,10 +2,10 @@ import "@material/mwc-button/mwc-button"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, } from "lit-element"; @@ -48,13 +48,13 @@ class HaPanelDevTemplate extends LitElement { @property() public narrow!: boolean; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _rendering = false; + @state() private _rendering = false; - @internalProperty() private _templateResult?: RenderTemplateResult; + @state() private _templateResult?: RenderTemplateResult; - @internalProperty() private _unsubRenderTemplate?: Promise; + @state() private _unsubRenderTemplate?: Promise; private _template = ""; @@ -240,7 +240,7 @@ class HaPanelDevTemplate extends LitElement { `; } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/history/ha-panel-history.ts b/src/panels/history/ha-panel-history.ts index ba0fc03517..59b89758c4 100644 --- a/src/panels/history/ha-panel-history.ts +++ b/src/panels/history/ha-panel-history.ts @@ -1,12 +1,6 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; -import { - css, - internalProperty, - LitElement, - property, - PropertyValues, -} from "lit-element"; +import { css, state, LitElement, property, PropertyValues } from "lit-element"; import { html } from "lit-html"; import { computeRTL } from "../../common/util/compute_rtl"; import "../../components/entity/ha-entity-picker"; @@ -37,7 +31,7 @@ class HaPanelHistory extends LitElement { @property({ reflect: true, type: Boolean }) rtl = false; - @internalProperty() private _ranges?: DateRangePickerRanges; + @state() private _ranges?: DateRangePickerRanges; public constructor() { super(); diff --git a/src/panels/logbook/ha-logbook.ts b/src/panels/logbook/ha-logbook.ts index cb77b90a92..f87af09c26 100644 --- a/src/panels/logbook/ha-logbook.ts +++ b/src/panels/logbook/ha-logbook.ts @@ -1,6 +1,6 @@ import { css, - CSSResultArray, + CSSResultGroup, customElement, eventOptions, html, @@ -254,7 +254,7 @@ class HaLogbook extends LitElement { }); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, haStyleScrollbar, diff --git a/src/panels/logbook/ha-panel-logbook.ts b/src/panels/logbook/ha-panel-logbook.ts index d8278a5877..b08497a2a9 100644 --- a/src/panels/logbook/ha-panel-logbook.ts +++ b/src/panels/logbook/ha-panel-logbook.ts @@ -5,7 +5,7 @@ import { css, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -49,13 +49,13 @@ export class HaPanelLogbook extends LitElement { @property({ reflect: true, type: Boolean }) rtl = false; - @internalProperty() private _ranges?: DateRangePickerRanges; + @state() private _ranges?: DateRangePickerRanges; private _fetchUserDone?: Promise; - @internalProperty() private _userIdToName = {}; + @state() private _userIdToName = {}; - @internalProperty() private _traceContexts: TraceContexts = {}; + @state() private _traceContexts: TraceContexts = {}; public constructor() { super(); diff --git a/src/panels/lovelace/badges/hui-entity-filter-badge.ts b/src/panels/lovelace/badges/hui-entity-filter-badge.ts index 71ec50e8fc..b89135e7e1 100644 --- a/src/panels/lovelace/badges/hui-entity-filter-badge.ts +++ b/src/panels/lovelace/badges/hui-entity-filter-badge.ts @@ -1,9 +1,4 @@ -import { - internalProperty, - property, - PropertyValues, - UpdatingElement, -} from "lit-element"; +import { state, property, PropertyValues, ReactiveElement } from "lit-element"; import { HomeAssistant } from "../../../types"; import { evaluateFilter } from "../common/evaluate-filter"; import { processConfigEntities } from "../common/process-config-entities"; @@ -12,10 +7,10 @@ import { EntityFilterEntityConfig } from "../entity-rows/types"; import { LovelaceBadge } from "../types"; import { EntityFilterBadgeConfig } from "./types"; -class EntityFilterBadge extends UpdatingElement implements LovelaceBadge { +class EntityFilterBadge extends ReactiveElement implements LovelaceBadge { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _config?: EntityFilterBadgeConfig; + @state() private _config?: EntityFilterBadgeConfig; private _elements?: LovelaceBadge[]; @@ -50,6 +45,10 @@ class EntityFilterBadge extends UpdatingElement implements LovelaceBadge { this._config = config; } + protected createRenderRoot() { + return this; + } + protected shouldUpdate(changedProperties: PropertyValues): boolean { if ( changedProperties.has("_config") || diff --git a/src/panels/lovelace/badges/hui-error-badge.ts b/src/panels/lovelace/badges/hui-error-badge.ts index abb18344ab..e80abd8379 100644 --- a/src/panels/lovelace/badges/hui-error-badge.ts +++ b/src/panels/lovelace/badges/hui-error-badge.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -27,7 +27,7 @@ export const createErrorBadgeConfig = (error) => ({ export class HuiErrorBadge extends LitElement implements LovelaceBadge { public hass?: HomeAssistant; - @internalProperty() private _config?: ErrorBadgeConfig; + @state() private _config?: ErrorBadgeConfig; public setConfig(config: ErrorBadgeConfig): void { this._config = config; @@ -47,7 +47,7 @@ export class HuiErrorBadge extends LitElement implements LovelaceBadge { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { --ha-label-badge-color: var(--label-badge-red, #fce588); diff --git a/src/panels/lovelace/badges/hui-state-label-badge.ts b/src/panels/lovelace/badges/hui-state-label-badge.ts index c95258ba0c..d94354c3a2 100644 --- a/src/panels/lovelace/badges/hui-state-label-badge.ts +++ b/src/panels/lovelace/badges/hui-state-label-badge.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -59,7 +59,7 @@ export class HuiStateLabelBadge extends LitElement implements LovelaceBadge { handleAction(this, this.hass!, this._config!, ev.detail.action!); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-state-label-badge:focus { outline: none; diff --git a/src/panels/lovelace/cards/hui-alarm-panel-card.ts b/src/panels/lovelace/cards/hui-alarm-panel-card.ts index d78203fe15..8d20bf51a2 100644 --- a/src/panels/lovelace/cards/hui-alarm-panel-card.ts +++ b/src/panels/lovelace/cards/hui-alarm-panel-card.ts @@ -2,10 +2,10 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -70,7 +70,7 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: AlarmPanelCardConfig; + @state() private _config?: AlarmPanelCardConfig; @query("#alarmCode") private _input?: PaperInputElement; @@ -173,13 +173,13 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard { ? this._config.states! : ["disarm"] ).map( - (state) => html` + (stateAction) => html` - ${this._actionDisplay(state)} + ${this._actionDisplay(stateAction)} ` )} @@ -226,22 +226,22 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard { `; } - private _stateIconLabel(state: string): string { - const stateLabel = state.split("_").pop(); + private _stateIconLabel(entityState: string): string { + const stateLabel = entityState.split("_").pop(); return stateLabel === "disarmed" || stateLabel === "triggered" || !stateLabel ? "" - : this._stateDisplay(state); + : this._stateDisplay(entityState); } - private _actionDisplay(state: string): string { - return this.hass!.localize(`ui.card.alarm_control_panel.${state}`); + private _actionDisplay(entityState: string): string { + return this.hass!.localize(`ui.card.alarm_control_panel.${entityState}`); } - private _stateDisplay(state: string): string { + private _stateDisplay(entityState: string): string { return this.hass!.localize( - `component.alarm_control_panel.state._.${state}` + `component.alarm_control_panel.state._.${entityState}` ); } @@ -269,7 +269,7 @@ class HuiAlarmPanelCard extends LitElement implements LovelaceCard { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { padding-bottom: 16px; diff --git a/src/panels/lovelace/cards/hui-button-card.ts b/src/panels/lovelace/cards/hui-button-card.ts index f8ed4453a7..4f6af27840 100644 --- a/src/panels/lovelace/cards/hui-button-card.ts +++ b/src/panels/lovelace/cards/hui-button-card.ts @@ -4,11 +4,11 @@ import { RippleHandlers } from "@material/mwc-ripple/ripple-handlers"; import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, eventOptions, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -71,11 +71,11 @@ export class HuiButtonCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: ButtonCardConfig; + @state() private _config?: ButtonCardConfig; @queryAsync("mwc-ripple") private _ripple!: Promise; - @internalProperty() private _shouldRenderRipple = false; + @state() private _shouldRenderRipple = false; public getCardSize(): number { return ( @@ -247,7 +247,7 @@ export class HuiButtonCard extends LitElement implements LovelaceCard { this._rippleHandlers.endFocus(); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { cursor: pointer; diff --git a/src/panels/lovelace/cards/hui-calendar-card.ts b/src/panels/lovelace/cards/hui-calendar-card.ts index ae3280920f..48e31d5f8c 100644 --- a/src/panels/lovelace/cards/hui-calendar-card.ts +++ b/src/panels/lovelace/cards/hui-calendar-card.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -62,13 +62,13 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public _events: CalendarEvent[] = []; - @internalProperty() private _config?: CalendarCardConfig; + @state() private _config?: CalendarCardConfig; - @internalProperty() private _calendars: Calendar[] = []; + @state() private _calendars: Calendar[] = []; - @internalProperty() private _narrow = false; + @state() private _narrow = false; - @internalProperty() private _veryNarrow = false; + @state() private _veryNarrow = false; @query("ha-full-calendar", true) private _calendar?: HAFullCalendar; @@ -204,7 +204,7 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard { this._resizeObserver.observe(card); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { position: relative; diff --git a/src/panels/lovelace/cards/hui-empty-state-card.ts b/src/panels/lovelace/cards/hui-empty-state-card.ts index dce740668b..b56c23201b 100644 --- a/src/panels/lovelace/cards/hui-empty-state-card.ts +++ b/src/panels/lovelace/cards/hui-empty-state-card.ts @@ -1,7 +1,7 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -54,7 +54,7 @@ export class HuiEmptyStateCard extends LitElement implements LovelaceCard { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .content { margin-top: -1em; diff --git a/src/panels/lovelace/cards/hui-entities-card.ts b/src/panels/lovelace/cards/hui-entities-card.ts index 09cf5f7574..92d05914d6 100644 --- a/src/panels/lovelace/cards/hui-entities-card.ts +++ b/src/panels/lovelace/cards/hui-entities-card.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, PropertyValues, TemplateResult, @@ -55,7 +55,7 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard { return { type: "entities", entities: foundEntities }; } - @internalProperty() private _config?: EntitiesCardConfig; + @state() private _config?: EntitiesCardConfig; private _hass?: HomeAssistant; @@ -223,7 +223,7 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { height: 100%; diff --git a/src/panels/lovelace/cards/hui-entity-card.ts b/src/panels/lovelace/cards/hui-entity-card.ts index 7c8c1b9a36..7bb0479984 100644 --- a/src/panels/lovelace/cards/hui-entity-card.ts +++ b/src/panels/lovelace/cards/hui-entity-card.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -62,7 +62,7 @@ export class HuiEntityCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityCardConfig; + @state() private _config?: EntityCardConfig; private _footerElement?: HuiErrorCard | LovelaceHeaderFooter; @@ -185,7 +185,7 @@ export class HuiEntityCard extends LitElement implements LovelaceCard { fireEvent(this, "hass-more-info", { entityId: this._config!.entity }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { height: 100%; diff --git a/src/panels/lovelace/cards/hui-entity-filter-card.ts b/src/panels/lovelace/cards/hui-entity-filter-card.ts index f6bcdb4307..517b08a13b 100644 --- a/src/panels/lovelace/cards/hui-entity-filter-card.ts +++ b/src/panels/lovelace/cards/hui-entity-filter-card.ts @@ -1,9 +1,4 @@ -import { - internalProperty, - property, - PropertyValues, - UpdatingElement, -} from "lit-element"; +import { state, property, PropertyValues, ReactiveElement } from "lit-element"; import { LovelaceCardConfig } from "../../../data/lovelace"; import { HomeAssistant } from "../../../types"; import { computeCardSize } from "../common/compute-card-size"; @@ -15,7 +10,7 @@ import { EntityFilterEntityConfig } from "../entity-rows/types"; import { LovelaceCard } from "../types"; import { EntityFilterCardConfig } from "./types"; -class EntityFilterCard extends UpdatingElement implements LovelaceCard { +class EntityFilterCard extends ReactiveElement implements LovelaceCard { public static getStubConfig( hass: HomeAssistant, entities: string[], @@ -46,7 +41,7 @@ class EntityFilterCard extends UpdatingElement implements LovelaceCard { @property() public editMode = false; - @internalProperty() private _config?: EntityFilterCardConfig; + @state() private _config?: EntityFilterCardConfig; private _element?: LovelaceCard; @@ -92,6 +87,10 @@ class EntityFilterCard extends UpdatingElement implements LovelaceCard { this._element = this._createCardElement(this._baseCardConfig); } + protected createRenderRoot() { + return this; + } + protected shouldUpdate(changedProps: PropertyValues): boolean { if (this._element) { this._element.hass = this.hass; diff --git a/src/panels/lovelace/cards/hui-error-card.ts b/src/panels/lovelace/cards/hui-error-card.ts index 1e9b0fc779..14f1ceabae 100644 --- a/src/panels/lovelace/cards/hui-error-card.ts +++ b/src/panels/lovelace/cards/hui-error-card.ts @@ -1,10 +1,10 @@ import { safeDump } from "js-yaml"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -16,7 +16,7 @@ import { ErrorCardConfig } from "./types"; export class HuiErrorCard extends LitElement implements LovelaceCard { public hass?: HomeAssistant; - @internalProperty() private _config?: ErrorCardConfig; + @state() private _config?: ErrorCardConfig; public getCardSize(): number { return 4; @@ -46,7 +46,7 @@ export class HuiErrorCard extends LitElement implements LovelaceCard { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/panels/lovelace/cards/hui-gauge-card.ts b/src/panels/lovelace/cards/hui-gauge-card.ts index 770706a861..a6bcf33024 100644 --- a/src/panels/lovelace/cards/hui-gauge-card.ts +++ b/src/panels/lovelace/cards/hui-gauge-card.ts @@ -1,10 +1,10 @@ import { HassEntity } from "home-assistant-js-websocket/dist/types"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -63,7 +63,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: GaugeCardConfig; + @state() private _config?: GaugeCardConfig; public getCardSize(): number { return 4; @@ -95,7 +95,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { `; } - const state = Number(stateObj.state); + const entityState = Number(stateObj.state); if (stateObj.state === UNAVAILABLE) { return html` @@ -109,7 +109,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { `; } - if (isNaN(state)) { + if (isNaN(entityState)) { return html` ${this.hass.localize( @@ -135,7 +135,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { .unit_of_measurement || ""} style=${styleMap({ - "--gauge-color": this._computeSeverity(state), + "--gauge-color": this._computeSeverity(entityState), })} >
@@ -206,7 +206,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { fireEvent(this, "hass-more-info", { entityId: this._config!.entity }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { cursor: pointer; diff --git a/src/panels/lovelace/cards/hui-glance-card.ts b/src/panels/lovelace/cards/hui-glance-card.ts index e59d0dd4ac..88ed26415d 100644 --- a/src/panels/lovelace/cards/hui-glance-card.ts +++ b/src/panels/lovelace/cards/hui-glance-card.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -64,7 +64,7 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: GlanceCardConfig; + @state() private _config?: GlanceCardConfig; private _configEntities?: GlanceConfigEntity[]; @@ -184,7 +184,7 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { height: 100%; diff --git a/src/panels/lovelace/cards/hui-grid-card.ts b/src/panels/lovelace/cards/hui-grid-card.ts index b7880b2f6d..b2033890fd 100644 --- a/src/panels/lovelace/cards/hui-grid-card.ts +++ b/src/panels/lovelace/cards/hui-grid-card.ts @@ -1,4 +1,4 @@ -import { css, CSSResult } from "lit-element"; +import { css, CSSResultGroup } from "lit-element"; import { computeCardSize } from "../common/compute-card-size"; import { HuiStackCard } from "./hui-stack-card"; import { GridCardConfig } from "./types"; @@ -64,7 +64,7 @@ class HuiGridCard extends HuiStackCard { this.toggleAttribute("square", this.square); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ super.sharedStyles, css` diff --git a/src/panels/lovelace/cards/hui-history-graph-card.ts b/src/panels/lovelace/cards/hui-history-graph-card.ts index d034811e07..69b230718f 100644 --- a/src/panels/lovelace/cards/hui-history-graph-card.ts +++ b/src/panels/lovelace/cards/hui-history-graph-card.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -36,9 +36,9 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _stateHistory?: HistoryResult; + @state() private _stateHistory?: HistoryResult; - @internalProperty() private _config?: HistoryGraphCardConfig; + @state() private _config?: HistoryGraphCardConfig; private _configEntities?: EntityConfig[]; @@ -169,7 +169,7 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { height: 100%; diff --git a/src/panels/lovelace/cards/hui-horizontal-stack-card.ts b/src/panels/lovelace/cards/hui-horizontal-stack-card.ts index efe402d52d..6f3b18bb82 100644 --- a/src/panels/lovelace/cards/hui-horizontal-stack-card.ts +++ b/src/panels/lovelace/cards/hui-horizontal-stack-card.ts @@ -1,4 +1,4 @@ -import { css, CSSResult } from "lit-element"; +import { css, CSSResultGroup } from "lit-element"; import { computeCardSize } from "../common/compute-card-size"; import { HuiStackCard } from "./hui-stack-card"; @@ -19,7 +19,7 @@ class HuiHorizontalStackCard extends HuiStackCard { return Math.max(...results); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ super.sharedStyles, css` diff --git a/src/panels/lovelace/cards/hui-humidifier-card.ts b/src/panels/lovelace/cards/hui-humidifier-card.ts index db983222df..c6c5651f01 100644 --- a/src/panels/lovelace/cards/hui-humidifier-card.ts +++ b/src/panels/lovelace/cards/hui-humidifier-card.ts @@ -2,10 +2,10 @@ import "@thomasloven/round-slider"; import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -54,9 +54,9 @@ export class HuiHumidifierCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: HumidifierCardConfig; + @state() private _config?: HumidifierCardConfig; - @internalProperty() private _setHum?: number; + @state() private _setHum?: number; public getCardSize(): number { return 6; @@ -268,7 +268,7 @@ export class HuiHumidifierCard extends LitElement implements LovelaceCard { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/panels/lovelace/cards/hui-iframe-card.ts b/src/panels/lovelace/cards/hui-iframe-card.ts index 30a226848d..fe97a15281 100644 --- a/src/panels/lovelace/cards/hui-iframe-card.ts +++ b/src/panels/lovelace/cards/hui-iframe-card.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -84,7 +84,7 @@ export class HuiIframeCard extends LitElement implements LovelaceCard { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host([ispanel]) ha-card { width: 100%; diff --git a/src/panels/lovelace/cards/hui-light-card.ts b/src/panels/lovelace/cards/hui-light-card.ts index bd493d84fc..9f75785bcc 100644 --- a/src/panels/lovelace/cards/hui-light-card.ts +++ b/src/panels/lovelace/cards/hui-light-card.ts @@ -2,10 +2,10 @@ import { mdiDotsVertical } from "@mdi/js"; import "@thomasloven/round-slider"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -60,7 +60,7 @@ export class HuiLightCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: LightCardConfig; + @state() private _config?: LightCardConfig; private _brightnessTimout?: number; @@ -254,7 +254,7 @@ export class HuiLightCard extends LitElement implements LovelaceCard { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { height: 100%; diff --git a/src/panels/lovelace/cards/hui-logbook-card.ts b/src/panels/lovelace/cards/hui-logbook-card.ts index 29e7adbee8..077d30bd09 100644 --- a/src/panels/lovelace/cards/hui-logbook-card.ts +++ b/src/panels/lovelace/cards/hui-logbook-card.ts @@ -1,9 +1,9 @@ import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -55,13 +55,13 @@ export class HuiLogbookCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: LogbookCardConfig; + @state() private _config?: LogbookCardConfig; - @internalProperty() private _logbookEntries?: LogbookEntry[]; + @state() private _logbookEntries?: LogbookEntry[]; - @internalProperty() private _persons = {}; + @state() private _persons = {}; - @internalProperty() private _configEntities?: EntityConfig[]; + @state() private _configEntities?: EntityConfig[]; private _lastLogbookDate?: Date; @@ -266,7 +266,7 @@ export class HuiLogbookCard extends LitElement implements LovelaceCard { }); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ css` ha-card { diff --git a/src/panels/lovelace/cards/hui-map-card.ts b/src/panels/lovelace/cards/hui-map-card.ts index 9683445600..8f94a5c32a 100644 --- a/src/panels/lovelace/cards/hui-map-card.ts +++ b/src/panels/lovelace/cards/hui-map-card.ts @@ -11,7 +11,7 @@ import { } from "leaflet"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -653,7 +653,7 @@ class HuiMapCard extends LitElement implements LovelaceCard { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { overflow: hidden; diff --git a/src/panels/lovelace/cards/hui-markdown-card.ts b/src/panels/lovelace/cards/hui-markdown-card.ts index 8aaedc76a9..36b81354ca 100644 --- a/src/panels/lovelace/cards/hui-markdown-card.ts +++ b/src/panels/lovelace/cards/hui-markdown-card.ts @@ -1,10 +1,10 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -39,11 +39,11 @@ export class HuiMarkdownCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: MarkdownCardConfig; + @state() private _config?: MarkdownCardConfig; - @internalProperty() private _templateResult?: RenderTemplateResult; + @state() private _templateResult?: RenderTemplateResult; - @internalProperty() private _unsubRenderTemplate?: Promise; + @state() private _unsubRenderTemplate?: Promise; public getCardSize(): number { return this._config === undefined @@ -166,7 +166,7 @@ export class HuiMarkdownCard extends LitElement implements LovelaceCard { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { height: 100%; diff --git a/src/panels/lovelace/cards/hui-media-control-card.ts b/src/panels/lovelace/cards/hui-media-control-card.ts index c1fd6788d9..ad34cdf56f 100644 --- a/src/panels/lovelace/cards/hui-media-control-card.ts +++ b/src/panels/lovelace/cards/hui-media-control-card.ts @@ -4,10 +4,10 @@ import "@polymer/paper-progress/paper-progress"; import type { PaperProgressElement } from "@polymer/paper-progress/paper-progress"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -75,21 +75,21 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _config?: MediaControlCardConfig; + @state() private _config?: MediaControlCardConfig; - @internalProperty() private _foregroundColor?: string; + @state() private _foregroundColor?: string; - @internalProperty() private _backgroundColor?: string; + @state() private _backgroundColor?: string; - @internalProperty() private _narrow = false; + @state() private _narrow = false; - @internalProperty() private _veryNarrow = false; + @state() private _veryNarrow = false; - @internalProperty() private _cardHeight = 0; + @state() private _cardHeight = 0; @query("paper-progress") private _progressBar?: PaperProgressElement; - @internalProperty() private _marqueeActive = false; + @state() private _marqueeActive = false; private _progressInterval?: number; @@ -172,17 +172,20 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard { width: `${this._cardHeight}px`, }; - const state = stateObj.state; + const entityState = stateObj.state; - const isOffState = state === "off"; + const isOffState = entityState === "off"; const isUnavailable = - UNAVAILABLE_STATES.includes(state) || - (state === "off" && !supportsFeature(stateObj, SUPPORT_TURN_ON)); + UNAVAILABLE_STATES.includes(entityState) || + (entityState === "off" && !supportsFeature(stateObj, SUPPORT_TURN_ON)); const hasNoImage = !this._image; const controls = computeMediaControls(stateObj); const showControls = controls && - (!this._veryNarrow || isOffState || state === "idle" || state === "on"); + (!this._veryNarrow || + isOffState || + entityState === "idle" || + entityState === "on"); const mediaDescription = computeMediaDescription(stateObj); @@ -552,7 +555,7 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { overflow: hidden; diff --git a/src/panels/lovelace/cards/hui-picture-card.ts b/src/panels/lovelace/cards/hui-picture-card.ts index 6da862a137..7c7bab7aa7 100644 --- a/src/panels/lovelace/cards/hui-picture-card.ts +++ b/src/panels/lovelace/cards/hui-picture-card.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -107,7 +107,7 @@ export class HuiPictureCard extends LitElement implements LovelaceCard { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { overflow: hidden; diff --git a/src/panels/lovelace/cards/hui-picture-elements-card.ts b/src/panels/lovelace/cards/hui-picture-elements-card.ts index 0905c84f0f..3b3cb165df 100644 --- a/src/panels/lovelace/cards/hui-picture-elements-card.ts +++ b/src/panels/lovelace/cards/hui-picture-elements-card.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -22,7 +22,7 @@ import { PictureElementsCardConfig } from "./types"; class HuiPictureElementsCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _elements?: LovelaceElement[]; + @state() private _elements?: LovelaceElement[]; public static getStubConfig( hass: HomeAssistant, @@ -54,7 +54,7 @@ class HuiPictureElementsCard extends LitElement implements LovelaceCard { }; } - @internalProperty() private _config?: PictureElementsCardConfig; + @state() private _config?: PictureElementsCardConfig; public getCardSize(): number { return 4; @@ -138,7 +138,7 @@ class HuiPictureElementsCard extends LitElement implements LovelaceCard { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` #root { position: relative; diff --git a/src/panels/lovelace/cards/hui-picture-entity-card.ts b/src/panels/lovelace/cards/hui-picture-entity-card.ts index 0329de6ba8..92a87b8b6f 100644 --- a/src/panels/lovelace/cards/hui-picture-entity-card.ts +++ b/src/panels/lovelace/cards/hui-picture-entity-card.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -59,7 +59,7 @@ class HuiPictureEntityCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: PictureEntityCardConfig; + @state() private _config?: PictureEntityCardConfig; public getCardSize(): number { return 3; @@ -122,7 +122,7 @@ class HuiPictureEntityCard extends LitElement implements LovelaceCard { } const name = this._config.name || computeStateName(stateObj); - const state = computeStateDisplay( + const entityState = computeStateDisplay( this.hass!.localize, stateObj, this.hass.locale @@ -133,13 +133,13 @@ class HuiPictureEntityCard extends LitElement implements LovelaceCard { footer = html` `; } else if (this._config.show_name) { footer = html``; } else if (this._config.show_state) { - footer = html``; + footer = html``; } return html` @@ -174,7 +174,7 @@ class HuiPictureEntityCard extends LitElement implements LovelaceCard { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { min-height: 75px; diff --git a/src/panels/lovelace/cards/hui-picture-glance-card.ts b/src/panels/lovelace/cards/hui-picture-glance-card.ts index 20e06a2108..d07fc5eebd 100644 --- a/src/panels/lovelace/cards/hui-picture-glance-card.ts +++ b/src/panels/lovelace/cards/hui-picture-glance-card.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -66,7 +66,7 @@ class HuiPictureGlanceCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: PictureGlanceCardConfig; + @state() private _config?: PictureGlanceCardConfig; private _entitiesDialog?: PictureGlanceEntityConfig[]; @@ -287,7 +287,7 @@ class HuiPictureGlanceCard extends LitElement implements LovelaceCard { handleAction(this, this.hass!, config, ev.detail.action!); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { position: relative; diff --git a/src/panels/lovelace/cards/hui-plant-status-card.ts b/src/panels/lovelace/cards/hui-plant-status-card.ts index 9019fcd8b7..7c4bd05bdb 100644 --- a/src/panels/lovelace/cards/hui-plant-status-card.ts +++ b/src/panels/lovelace/cards/hui-plant-status-card.ts @@ -1,10 +1,10 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -58,7 +58,7 @@ class HuiPlantStatusCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: PlantStatusCardConfig; + @state() private _config?: PlantStatusCardConfig; public getCardSize(): number { return 3; @@ -159,7 +159,7 @@ class HuiPlantStatusCard extends LitElement implements LovelaceCard { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { height: 100%; diff --git a/src/panels/lovelace/cards/hui-safe-mode-card.ts b/src/panels/lovelace/cards/hui-safe-mode-card.ts index ccf58d78ae..fc0b083a08 100644 --- a/src/panels/lovelace/cards/hui-safe-mode-card.ts +++ b/src/panels/lovelace/cards/hui-safe-mode-card.ts @@ -1,7 +1,7 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -42,7 +42,7 @@ export class HuiSafeModeCard extends LitElement implements LovelaceCard { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { --ha-card-header-color: var(--primary-color); diff --git a/src/panels/lovelace/cards/hui-shopping-list-card.ts b/src/panels/lovelace/cards/hui-shopping-list-card.ts index ea0af2a6d1..9edd46344b 100644 --- a/src/panels/lovelace/cards/hui-shopping-list-card.ts +++ b/src/panels/lovelace/cards/hui-shopping-list-card.ts @@ -4,10 +4,10 @@ import { PaperInputElement } from "@polymer/paper-input/paper-input"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -50,15 +50,15 @@ class HuiShoppingListCard @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: ShoppingListCardConfig; + @state() private _config?: ShoppingListCardConfig; - @internalProperty() private _uncheckedItems?: ShoppingListItem[]; + @state() private _uncheckedItems?: ShoppingListItem[]; - @internalProperty() private _checkedItems?: ShoppingListItem[]; + @state() private _checkedItems?: ShoppingListItem[]; - @internalProperty() private _reordering = false; + @state() private _reordering = false; - @internalProperty() private _renderEmptySortable = false; + @state() private _renderEmptySortable = false; private _sortable?; @@ -348,7 +348,7 @@ class HuiShoppingListCard }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-card { padding: 16px; diff --git a/src/panels/lovelace/cards/hui-stack-card.ts b/src/panels/lovelace/cards/hui-stack-card.ts index 2262eea996..47bbc7933b 100644 --- a/src/panels/lovelace/cards/hui-stack-card.ts +++ b/src/panels/lovelace/cards/hui-stack-card.ts @@ -1,8 +1,8 @@ import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -32,7 +32,7 @@ export abstract class HuiStackCard @property() protected _cards?: LovelaceCard[]; - @internalProperty() protected _config?: T; + @state() protected _config?: T; public getCardSize(): number | Promise { return 1; @@ -81,7 +81,7 @@ export abstract class HuiStackCard `; } - static get sharedStyles(): CSSResult { + static get sharedStyles(): CSSResultGroup { return css` .card-header { color: var(--ha-card-header-color, --primary-text-color); diff --git a/src/panels/lovelace/cards/hui-starting-card.ts b/src/panels/lovelace/cards/hui-starting-card.ts index d7f90b2b2f..ad08ee6747 100644 --- a/src/panels/lovelace/cards/hui-starting-card.ts +++ b/src/panels/lovelace/cards/hui-starting-card.ts @@ -2,7 +2,7 @@ import "@material/mwc-button/mwc-button"; import { STATE_NOT_RUNNING } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -53,7 +53,7 @@ export class HuiStartingCard extends LitElement implements LovelaceCard { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/panels/lovelace/cards/hui-thermostat-card.ts b/src/panels/lovelace/cards/hui-thermostat-card.ts index 50012c5573..30abc46264 100644 --- a/src/panels/lovelace/cards/hui-thermostat-card.ts +++ b/src/panels/lovelace/cards/hui-thermostat-card.ts @@ -3,10 +3,10 @@ import "@thomasloven/round-slider"; import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -74,9 +74,9 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: ThermostatCardConfig; + @state() private _config?: ThermostatCardConfig; - @internalProperty() private _setTemp?: number | number[]; + @state() private _setTemp?: number | number[]; @query("ha-card") private _card?: HaCard; @@ -421,7 +421,7 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/panels/lovelace/cards/hui-vertical-stack-card.ts b/src/panels/lovelace/cards/hui-vertical-stack-card.ts index dfb01c4a84..dbd9ea53ac 100644 --- a/src/panels/lovelace/cards/hui-vertical-stack-card.ts +++ b/src/panels/lovelace/cards/hui-vertical-stack-card.ts @@ -1,4 +1,4 @@ -import { css, CSSResult } from "lit-element"; +import { css, CSSResultGroup } from "lit-element"; import { computeCardSize } from "../common/compute-card-size"; import { HuiStackCard } from "./hui-stack-card"; @@ -19,7 +19,7 @@ class HuiVerticalStackCard extends HuiStackCard { return results.reduce((partial_sum, a) => partial_sum + a, 0); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ super.sharedStyles, css` diff --git a/src/panels/lovelace/cards/hui-weather-forecast-card.ts b/src/panels/lovelace/cards/hui-weather-forecast-card.ts index af35cb18e3..5a1d7865f9 100644 --- a/src/panels/lovelace/cards/hui-weather-forecast-card.ts +++ b/src/panels/lovelace/cards/hui-weather-forecast-card.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -74,7 +74,7 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: WeatherForecastCardConfig; + @state() private _config?: WeatherForecastCardConfig; @property({ type: Boolean, reflect: true, attribute: "veryverynarrow" }) private _veryVeryNarrow = false; @@ -390,7 +390,7 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard { this._veryVeryNarrow = card.offsetWidth < 245; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ weatherSVGStyles, css` diff --git a/src/panels/lovelace/common/directives/action-handler-directive.ts b/src/panels/lovelace/common/directives/action-handler-directive.ts index 3b0ea378c8..234471d17e 100644 --- a/src/panels/lovelace/common/directives/action-handler-directive.ts +++ b/src/panels/lovelace/common/directives/action-handler-directive.ts @@ -1,6 +1,14 @@ +/* eslint-disable max-classes-per-file */ import "@material/mwc-ripple"; import type { Ripple } from "@material/mwc-ripple"; -import { directive, PropertyPart } from "lit-html"; +import { noChange } from "lit-html"; +import { + AttributePart, + directive, + Directive, + DirectiveParameters, + // eslint-disable-next-line import/extensions +} from "lit-html/directive.js"; import { fireEvent } from "../../../../common/dom/fire_event"; import { deepEqual } from "../../../../common/util/deep-equal"; import { @@ -15,7 +23,7 @@ const isTouch = interface ActionHandler extends HTMLElement { holdTime: number; - bind(element: Element, options): void; + bind(element: Element, options?: ActionHandlerOptions): void; } interface ActionHandlerElement extends HTMLElement { actionHandler?: { @@ -90,7 +98,10 @@ class ActionHandler extends HTMLElement implements ActionHandler { }); } - public bind(element: ActionHandlerElement, options: ActionHandlerOptions) { + public bind( + element: ActionHandlerElement, + options: ActionHandlerOptions = {} + ) { if ( element.actionHandler && deepEqual(options, element.actionHandler.options) @@ -240,7 +251,7 @@ const getActionHandler = (): ActionHandler => { export const actionHandlerBind = ( element: ActionHandlerElement, - options: ActionHandlerOptions + options?: ActionHandlerOptions ) => { const actionhandler: ActionHandler = getActionHandler(); if (!actionhandler) { @@ -250,7 +261,12 @@ export const actionHandlerBind = ( }; export const actionHandler = directive( - (options: ActionHandlerOptions = {}) => (part: PropertyPart) => { - actionHandlerBind(part.committer.element as ActionHandlerElement, options); + class extends Directive { + update(part: AttributePart, [options]: DirectiveParameters) { + actionHandlerBind(part.element as ActionHandlerElement, options); + return noChange; + } + + render(_options?: ActionHandlerOptions) {} } ); diff --git a/src/panels/lovelace/components/hui-action-editor.ts b/src/panels/lovelace/components/hui-action-editor.ts index d523877435..60e5af1cda 100644 --- a/src/panels/lovelace/components/hui-action-editor.ts +++ b/src/panels/lovelace/components/hui-action-editor.ts @@ -6,7 +6,7 @@ import "@polymer/paper-listbox/paper-listbox"; import type { PaperListboxElement } from "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -209,7 +209,7 @@ export class HuiActionEditor extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .dropdown { display: flex; diff --git a/src/panels/lovelace/components/hui-buttons-base.ts b/src/panels/lovelace/components/hui-buttons-base.ts index 919b5058e8..dce093d045 100644 --- a/src/panels/lovelace/components/hui-buttons-base.ts +++ b/src/panels/lovelace/components/hui-buttons-base.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -82,7 +82,7 @@ export class HuiButtonsBase extends LitElement { handleAction(this, this._hass!, config, ev.detail.action!); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/panels/lovelace/components/hui-card-options.ts b/src/panels/lovelace/components/hui-card-options.ts index c627c3b838..656640391b 100644 --- a/src/panels/lovelace/components/hui-card-options.ts +++ b/src/panels/lovelace/components/hui-card-options.ts @@ -5,7 +5,7 @@ import "@material/mwc-list/mwc-list-item"; import { mdiArrowDown, mdiArrowUp, mdiDotsVertical } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -113,7 +113,7 @@ export class HuiCardOptions extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host(:hover) { outline: 2px solid var(--primary-color); diff --git a/src/panels/lovelace/components/hui-conditional-base.ts b/src/panels/lovelace/components/hui-conditional-base.ts index 46446558df..5b9cb1cd71 100644 --- a/src/panels/lovelace/components/hui-conditional-base.ts +++ b/src/panels/lovelace/components/hui-conditional-base.ts @@ -2,7 +2,7 @@ import { customElement, property, PropertyValues, - UpdatingElement, + ReactiveElement, } from "lit-element"; import { HomeAssistant } from "../../../types"; import { ConditionalCardConfig } from "../cards/types"; @@ -14,7 +14,7 @@ import { ConditionalRowConfig, LovelaceRow } from "../entity-rows/types"; import { LovelaceCard } from "../types"; @customElement("hui-conditional-base") -export class HuiConditionalBase extends UpdatingElement { +export class HuiConditionalBase extends ReactiveElement { @property({ attribute: false }) public hass?: HomeAssistant; @property() public editMode?: boolean; @@ -23,6 +23,10 @@ export class HuiConditionalBase extends UpdatingElement { protected _element?: LovelaceCard | LovelaceRow; + protected createRenderRoot() { + return this; + } + protected validateConfig( config: ConditionalCardConfig | ConditionalRowConfig ): void { diff --git a/src/panels/lovelace/components/hui-entities-toggle.ts b/src/panels/lovelace/components/hui-entities-toggle.ts index 6af1483d66..db28bc76f6 100644 --- a/src/panels/lovelace/components/hui-entities-toggle.ts +++ b/src/panels/lovelace/components/hui-entities-toggle.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -22,7 +22,7 @@ class HuiEntitiesToggle extends LitElement { @property({ attribute: false }) protected hass?: HomeAssistant; - @internalProperty() private _toggleEntities?: string[]; + @state() private _toggleEntities?: string[]; public updated(changedProperties: PropertyValues): void { super.updated(changedProperties); @@ -54,7 +54,7 @@ class HuiEntitiesToggle extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { width: 38px; diff --git a/src/panels/lovelace/components/hui-entity-editor.ts b/src/panels/lovelace/components/hui-entity-editor.ts index 25df30a13e..79e844f9e0 100644 --- a/src/panels/lovelace/components/hui-entity-editor.ts +++ b/src/panels/lovelace/components/hui-entity-editor.ts @@ -1,10 +1,10 @@ import { mdiDrag } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -32,9 +32,9 @@ export class HuiEntityEditor extends LitElement { @property() protected label?: string; - @internalProperty() private _attached = false; + @state() private _attached = false; - @internalProperty() private _renderEmptySortable = false; + @state() private _renderEmptySortable = false; private _sortable?: Sortable; @@ -181,7 +181,7 @@ export class HuiEntityEditor extends LitElement { fireEvent(this, "entities-changed", { entities: newConfigEntities }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ sortableStyles, css` diff --git a/src/panels/lovelace/components/hui-generic-entity-row.ts b/src/panels/lovelace/components/hui-generic-entity-row.ts index 2449ddf277..c752061414 100644 --- a/src/panels/lovelace/components/hui-generic-entity-row.ts +++ b/src/panels/lovelace/components/hui-generic-entity-row.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, html, LitElement, property, @@ -156,7 +156,7 @@ class HuiGenericEntityRow extends LitElement { handleAction(this, this.hass!, this.config!, ev.detail.action!); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/panels/lovelace/components/hui-graph-base.ts b/src/panels/lovelace/components/hui-graph-base.ts index 5aff518758..dfac5001b3 100644 --- a/src/panels/lovelace/components/hui-graph-base.ts +++ b/src/panels/lovelace/components/hui-graph-base.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -17,7 +17,7 @@ import { getPath } from "../common/graph/get-path"; export class HuiGraphBase extends LitElement { @property() public coordinates?: any; - @internalProperty() private _path?: string; + @state() private _path?: string; protected render(): TemplateResult { return html` @@ -59,7 +59,7 @@ export class HuiGraphBase extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/panels/lovelace/components/hui-image.ts b/src/panels/lovelace/components/hui-image.ts index 9cfe450762..c9a6fc66f3 100644 --- a/src/panels/lovelace/components/hui-image.ts +++ b/src/panels/lovelace/components/hui-image.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -50,9 +50,9 @@ export class HuiImage extends LitElement { @property() public darkModeFilter?: string; - @internalProperty() private _loadError?: boolean; + @state() private _loadError?: boolean; - @internalProperty() private _cameraImageSrc?: string; + @state() private _cameraImageSrc?: string; @query("img") private _image!: HTMLImageElement; @@ -78,7 +78,7 @@ export class HuiImage extends LitElement { } const ratio = this.aspectRatio ? parseAspectRatio(this.aspectRatio) : null; const stateObj = this.entity ? this.hass.states[this.entity] : undefined; - const state = stateObj ? stateObj.state : UNAVAILABLE; + const entityState = stateObj ? stateObj.state : UNAVAILABLE; // Figure out image source to use let imageSrc: string | undefined; @@ -93,7 +93,7 @@ export class HuiImage extends LitElement { imageSrc = this._cameraImageSrc; } } else if (this.stateImage) { - const stateImage = this.stateImage[state]; + const stateImage = this.stateImage[entityState]; if (stateImage) { imageSrc = stateImage; @@ -118,12 +118,12 @@ export class HuiImage extends LitElement { filter += this.darkModeFilter; } - if (this.stateFilter && this.stateFilter[state]) { - filter += this.stateFilter[state]; + if (this.stateFilter && this.stateFilter[entityState]) { + filter += this.stateFilter[entityState]; } if (!filter && this.entity) { - const isOff = !stateObj || STATES_OFF.includes(state); + const isOff = !stateObj || STATES_OFF.includes(entityState); filter = isOff && imageFallback ? DEFAULT_FILTER : ""; } @@ -237,7 +237,7 @@ export class HuiImage extends LitElement { ); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` img { display: block; diff --git a/src/panels/lovelace/components/hui-input-list-editor.ts b/src/panels/lovelace/components/hui-input-list-editor.ts index 1f56afd279..9abd746444 100644 --- a/src/panels/lovelace/components/hui-input-list-editor.ts +++ b/src/panels/lovelace/components/hui-input-list-editor.ts @@ -1,7 +1,7 @@ import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -97,7 +97,7 @@ export class HuiInputListEditor extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-icon-button { --mdc-icon-button-size: 24px; diff --git a/src/panels/lovelace/components/hui-marquee.ts b/src/panels/lovelace/components/hui-marquee.ts index 29bd5bd0da..93782397c7 100644 --- a/src/panels/lovelace/components/hui-marquee.ts +++ b/src/panels/lovelace/components/hui-marquee.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -66,7 +66,7 @@ class HuiMarquee extends LitElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/panels/lovelace/components/hui-theme-select-editor.ts b/src/panels/lovelace/components/hui-theme-select-editor.ts index ce5d9200aa..43e7a7c0cb 100644 --- a/src/panels/lovelace/components/hui-theme-select-editor.ts +++ b/src/panels/lovelace/components/hui-theme-select-editor.ts @@ -4,7 +4,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -55,7 +55,7 @@ export class HuiThemeSelectEditor extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` paper-dropdown-menu { width: 100%; diff --git a/src/panels/lovelace/components/hui-timestamp-display.ts b/src/panels/lovelace/components/hui-timestamp-display.ts index 04663d12ae..19c73c37dc 100644 --- a/src/panels/lovelace/components/hui-timestamp-display.ts +++ b/src/panels/lovelace/components/hui-timestamp-display.ts @@ -1,7 +1,7 @@ import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -32,7 +32,7 @@ class HuiTimestampDisplay extends LitElement { @property() public format?: TimestampRenderingFormats; - @internalProperty() private _relative?: string; + @state() private _relative?: string; private _connected?: boolean; diff --git a/src/panels/lovelace/components/hui-views-list.ts b/src/panels/lovelace/components/hui-views-list.ts index 7307369601..7604d0bf16 100644 --- a/src/panels/lovelace/components/hui-views-list.ts +++ b/src/panels/lovelace/components/hui-views-list.ts @@ -2,10 +2,10 @@ import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -24,9 +24,9 @@ declare global { @customElement("hui-views-list") class HuiViewsList extends LitElement { - @internalProperty() private lovelaceConfig?: LovelaceConfig | undefined; + @state() private lovelaceConfig?: LovelaceConfig | undefined; - @internalProperty() private selected?: number | undefined; + @state() private selected?: number | undefined; protected render(): TemplateResult { if (!this.lovelaceConfig) { @@ -67,7 +67,7 @@ class HuiViewsList extends LitElement { fireEvent(this, "view-selected", { view }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` paper-listbox { padding-top: 0; diff --git a/src/panels/lovelace/components/hui-warning-element.ts b/src/panels/lovelace/components/hui-warning-element.ts index bd3b1ad45e..43ee7c7079 100644 --- a/src/panels/lovelace/components/hui-warning-element.ts +++ b/src/panels/lovelace/components/hui-warning-element.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -17,7 +17,7 @@ export class HuiWarningElement extends LitElement { return html` `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-icon { color: #fce588; diff --git a/src/panels/lovelace/components/hui-warning.ts b/src/panels/lovelace/components/hui-warning.ts index 96b9dab9ea..7be082b5e4 100644 --- a/src/panels/lovelace/components/hui-warning.ts +++ b/src/panels/lovelace/components/hui-warning.ts @@ -1,7 +1,7 @@ import { STATE_NOT_RUNNING } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -27,7 +27,7 @@ export class HuiWarning extends LitElement { return html` `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts index 75c9a95bc5..a032ee1ffd 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts @@ -3,10 +3,10 @@ import "@material/mwc-tab/mwc-tab"; import Fuse from "fuse.js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -50,17 +50,17 @@ interface CardElement { export class HuiCardPicker extends LitElement { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _cards: CardElement[] = []; + @state() private _cards: CardElement[] = []; public lovelace?: LovelaceConfig; public cardPicked?: (cardConf: LovelaceCardConfig) => void; - @internalProperty() private _filter = ""; + @state() private _filter = ""; - @internalProperty() private _width?: number; + @state() private _width?: number; - @internalProperty() private _height?: number; + @state() private _height?: number; private _unusedEntities?: string[]; @@ -333,7 +333,7 @@ export class HuiCardPicker extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ css` search-input { diff --git a/src/panels/lovelace/editor/card-editor/hui-card-preview.ts b/src/panels/lovelace/editor/card-editor/hui-card-preview.ts index 9cb7882655..66bacbe61d 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-preview.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-preview.ts @@ -1,5 +1,5 @@ import "@polymer/paper-input/paper-textarea"; -import { property, PropertyValues, UpdatingElement } from "lit-element"; +import { property, PropertyValues, ReactiveElement } from "lit-element"; import { computeRTL } from "../../../../common/util/compute_rtl"; import { LovelaceCardConfig } from "../../../../data/lovelace"; import { HomeAssistant } from "../../../../types"; @@ -7,7 +7,7 @@ import { createCardElement } from "../../create-element/create-card-element"; import { createErrorCardConfig } from "../../create-element/create-element-base"; import { LovelaceCard } from "../../types"; -export class HuiCardPreview extends UpdatingElement { +export class HuiCardPreview extends ReactiveElement { @property({ attribute: false }) public hass?: HomeAssistant; @property() public config?: LovelaceCardConfig; @@ -28,6 +28,10 @@ export class HuiCardPreview extends UpdatingElement { }); } + protected createRenderRoot() { + return this; + } + protected update(changedProperties: PropertyValues) { super.update(changedProperties); diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts index a1790a9e95..56f0b173d3 100644 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts @@ -2,10 +2,10 @@ import "@material/mwc-tab-bar/mwc-tab-bar"; import "@material/mwc-tab/mwc-tab"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -45,13 +45,13 @@ export class HuiCreateDialogCard implements HassDialog { @property({ attribute: false }) protected hass!: HomeAssistant; - @internalProperty() private _params?: CreateCardDialogParams; + @state() private _params?: CreateCardDialogParams; - @internalProperty() private _viewConfig!: LovelaceViewConfig; + @state() private _viewConfig!: LovelaceViewConfig; - @internalProperty() private _selectedEntities: string[] = []; + @state() private _selectedEntities: string[] = []; - @internalProperty() private _currTabIndex = 0; + @state() private _currTabIndex = 0; public async showDialog(params: CreateCardDialogParams): Promise { this._params = params; @@ -151,7 +151,7 @@ export class HuiCreateDialogCard ev.stopPropagation(); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts index 28f006e32d..6dded9ea6c 100644 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-delete-card.ts @@ -2,10 +2,10 @@ import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import deepFreeze from "deep-freeze"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -24,9 +24,9 @@ import type { DeleteCardDialogParams } from "./show-delete-card-dialog"; export class HuiDialogDeleteCard extends LitElement { @property() protected hass!: HomeAssistant; - @internalProperty() private _params?: DeleteCardDialogParams; + @state() private _params?: DeleteCardDialogParams; - @internalProperty() private _cardConfig?: LovelaceCardConfig; + @state() private _cardConfig?: LovelaceCardConfig; @query("ha-paper-dialog", true) private _dialog!: HaPaperDialog; @@ -72,7 +72,7 @@ export class HuiDialogDeleteCard extends LitElement { `; } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts index 83da1e44ae..ac497b42a1 100755 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts @@ -2,10 +2,10 @@ import { mdiHelpCircle } from "@mdi/js"; import deepFreeze from "deep-freeze"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -55,26 +55,26 @@ export class HuiDialogEditCard @property({ type: Boolean, reflect: true }) public large = false; - @internalProperty() private _params?: EditCardDialogParams; + @state() private _params?: EditCardDialogParams; - @internalProperty() private _cardConfig?: LovelaceCardConfig; + @state() private _cardConfig?: LovelaceCardConfig; - @internalProperty() private _viewConfig!: LovelaceViewConfig; + @state() private _viewConfig!: LovelaceViewConfig; - @internalProperty() private _saving = false; + @state() private _saving = false; - @internalProperty() private _error?: string; + @state() private _error?: string; - @internalProperty() private _guiModeAvailable? = true; + @state() private _guiModeAvailable? = true; @query("hui-card-element-editor") private _cardEditorEl?: HuiCardElementEditor; - @internalProperty() private _GUImode = true; + @state() private _GUImode = true; - @internalProperty() private _documentationURL?: string; + @state() private _documentationURL?: string; - @internalProperty() private _dirty = false; + @state() private _dirty = false; public async showDialog(params: EditCardDialogParams): Promise { this._params = params; @@ -353,7 +353,7 @@ export class HuiDialogEditCard this.closeDialog(); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts index a8e2d4bfc4..ed4b56428f 100755 --- a/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts +++ b/src/panels/lovelace/editor/card-editor/hui-dialog-suggest-card.ts @@ -2,10 +2,10 @@ import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import deepFreeze from "deep-freeze"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -28,11 +28,11 @@ import { SuggestCardDialogParams } from "./show-suggest-card-dialog"; export class HuiDialogSuggestCard extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _params?: SuggestCardDialogParams; + @state() private _params?: SuggestCardDialogParams; - @internalProperty() private _cardConfig?: LovelaceCardConfig[]; + @state() private _cardConfig?: LovelaceCardConfig[]; - @internalProperty() private _saving = false; + @state() private _saving = false; @query("ha-yaml-editor") private _yamlEditor?: HaYamlEditor; @@ -123,7 +123,7 @@ export class HuiDialogSuggestCard extends LitElement { `; } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/lovelace/editor/card-editor/hui-entity-picker-table.ts b/src/panels/lovelace/editor/card-editor/hui-entity-picker-table.ts index e38c05a6d0..dc95e6afc2 100644 --- a/src/panels/lovelace/editor/card-editor/hui-entity-picker-table.ts +++ b/src/panels/lovelace/editor/card-editor/hui-entity-picker-table.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -136,7 +136,7 @@ export class HuiEntityPickerTable extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-data-table { --data-table-border-width: 0; diff --git a/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts index 895d668ac5..96be619150 100644 --- a/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-alarm-panel-card-editor.ts @@ -3,10 +3,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -38,7 +38,7 @@ export class HuiAlarmPanelCardEditor implements LovelaceCardEditor { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: AlarmPanelCardConfig; + @state() private _config?: AlarmPanelCardConfig; public setConfig(config: AlarmPanelCardConfig): void { assert(config, cardConfigStruct); @@ -94,9 +94,9 @@ export class HuiAlarmPanelCardEditor @value-changed="${this._valueChanged}" > Used States ${this._states.map( - (state, index) => html` + (entityState, index) => html`
- ${state} + ${entityState} - ${states.map((state) => html` ${state} `)} + ${states.map( + (entityState) => html` ${entityState} ` + )} { @property({ attribute: false }) protected hass!: HomeAssistant; - @internalProperty() private _params?: CreateHeaderFooterDialogParams; + @state() private _params?: CreateHeaderFooterDialogParams; public async showDialog( params: CreateHeaderFooterDialogParams @@ -117,7 +117,7 @@ export class HuiCreateDialogHeaderFooter this.closeDialog(); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/lovelace/editor/header-footer-editor/hui-header-footer-editor.ts b/src/panels/lovelace/editor/header-footer-editor/hui-header-footer-editor.ts index dc064f7ddd..033d0fef1b 100644 --- a/src/panels/lovelace/editor/header-footer-editor/hui-header-footer-editor.ts +++ b/src/panels/lovelace/editor/header-footer-editor/hui-header-footer-editor.ts @@ -4,7 +4,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -110,7 +110,7 @@ export class HuiHeaderFooterEditor extends LitElement { fireEvent(this, "value-changed", { value: "" }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { font-size: 16px; diff --git a/src/panels/lovelace/editor/hui-dialog-save-config.ts b/src/panels/lovelace/editor/hui-dialog-save-config.ts index acf32993e4..c6d89e63b6 100644 --- a/src/panels/lovelace/editor/hui-dialog-save-config.ts +++ b/src/panels/lovelace/editor/hui-dialog-save-config.ts @@ -3,10 +3,10 @@ import "@material/mwc-icon-button/mwc-icon-button"; import { mdiHelpCircle } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -33,11 +33,11 @@ const EMPTY_CONFIG: LovelaceConfig = { views: [{ title: "Home" }] }; export class HuiSaveConfig extends LitElement implements HassDialog { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _params?: SaveDialogParams; + @state() private _params?: SaveDialogParams; - @internalProperty() private _emptyConfig = false; + @state() private _emptyConfig = false; - @internalProperty() private _saving: boolean; + @state() private _saving: boolean; public constructor() { super(); @@ -201,7 +201,7 @@ export class HuiSaveConfig extends LitElement implements HassDialog { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/lovelace/editor/hui-element-editor.ts b/src/panels/lovelace/editor/hui-element-editor.ts index d87c072e00..2173dd0716 100644 --- a/src/panels/lovelace/editor/hui-element-editor.ts +++ b/src/panels/lovelace/editor/hui-element-editor.ts @@ -2,9 +2,9 @@ import "@material/mwc-button"; import { safeDump, safeLoad } from "js-yaml"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -55,25 +55,25 @@ export abstract class HuiElementEditor extends LitElement { @property({ attribute: false }) public lovelace?: LovelaceConfig; - @internalProperty() private _yaml?: string; + @state() private _yaml?: string; - @internalProperty() private _config?: T; + @state() private _config?: T; - @internalProperty() private _configElement?: LovelaceGenericElementEditor; + @state() private _configElement?: LovelaceGenericElementEditor; - @internalProperty() private _configElementType?: string; + @state() private _configElementType?: string; - @internalProperty() private _guiMode = true; + @state() private _guiMode = true; // Error: Configuration broken - do not save - @internalProperty() private _errors?: string[]; + @state() private _errors?: string[]; // Warning: GUI editor can't handle configuration - ok to save - @internalProperty() private _warnings?: string[]; + @state() private _warnings?: string[]; - @internalProperty() private _guiSupported?: boolean; + @state() private _guiSupported?: boolean; - @internalProperty() private _loading = false; + @state() private _loading = false; @query("ha-code-editor") _yamlEditor?: HaCodeEditor; @@ -351,7 +351,7 @@ export abstract class HuiElementEditor extends LitElement { ev.stopPropagation(); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/panels/lovelace/editor/hui-entities-card-row-editor.ts b/src/panels/lovelace/editor/hui-entities-card-row-editor.ts index e093fcc0c2..ab8374bf8f 100644 --- a/src/panels/lovelace/editor/hui-entities-card-row-editor.ts +++ b/src/panels/lovelace/editor/hui-entities-card-row-editor.ts @@ -2,10 +2,10 @@ import "@material/mwc-icon-button"; import { mdiClose, mdiDrag, mdiPencil } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -41,9 +41,9 @@ export class HuiEntitiesCardRowEditor extends LitElement { @property() protected label?: string; - @internalProperty() private _attached = false; + @state() private _attached = false; - @internalProperty() private _renderEmptySortable = false; + @state() private _renderEmptySortable = false; private _sortable?: Sortable; @@ -250,7 +250,7 @@ export class HuiEntitiesCardRowEditor extends LitElement { }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ sortableStyles, css` diff --git a/src/panels/lovelace/editor/hui-sub-element-editor.ts b/src/panels/lovelace/editor/hui-sub-element-editor.ts index c382ed0570..8af704b9e6 100644 --- a/src/panels/lovelace/editor/hui-sub-element-editor.ts +++ b/src/panels/lovelace/editor/hui-sub-element-editor.ts @@ -3,10 +3,10 @@ import "@material/mwc-icon-button"; import { mdiArrowLeft } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, query, @@ -34,9 +34,9 @@ export class HuiSubElementEditor extends LitElement { @property({ attribute: false }) public config!: SubElementEditorConfig; - @internalProperty() private _guiModeAvailable = true; + @state() private _guiModeAvailable = true; - @internalProperty() private _guiMode = true; + @state() private _guiMode = true; @query(".editor") private _editorElement?: HuiElementEditor< LovelaceRowConfig | LovelaceHeaderFooterConfig @@ -109,7 +109,7 @@ export class HuiSubElementEditor extends LitElement { this._guiModeAvailable = ev.detail.guiModeAvailable; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .header { display: flex; diff --git a/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts b/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts index 219824378f..ccf3a8e9ad 100644 --- a/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts +++ b/src/panels/lovelace/editor/lovelace-editor/hui-dialog-edit-lovelace.ts @@ -2,10 +2,10 @@ import "@material/mwc-button"; import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -24,7 +24,7 @@ import { fireEvent } from "../../../../common/dom/fire_event"; export class HuiDialogEditLovelace extends LitElement { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _lovelace?: Lovelace; + @state() private _lovelace?: Lovelace; private _config?: LovelaceConfig; @@ -135,7 +135,7 @@ export class HuiDialogEditLovelace extends LitElement { return JSON.stringify(this._config) !== JSON.stringify(lovelaceConfig); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts b/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts index dff6c618a4..c91d53df54 100644 --- a/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts +++ b/src/panels/lovelace/editor/lovelace-editor/hui-lovelace-editor.ts @@ -1,6 +1,6 @@ import "@polymer/paper-input/paper-input"; import { - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -72,7 +72,7 @@ export class HuiLovelaceEditor extends LitElement { fireEvent(this, "lovelace-config-changed", { config: newConfig }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return configElementStyle; } } diff --git a/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts b/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts index 55cedc9626..e0b9c0b95c 100644 --- a/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts +++ b/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts @@ -1,10 +1,10 @@ import "@polymer/paper-item/paper-item"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -27,13 +27,13 @@ import type { SelectViewDialogParams } from "./show-select-view-dialog"; export class HuiDialogSelectView extends LitElement { public hass!: HomeAssistant; - @internalProperty() private _params?: SelectViewDialogParams; + @state() private _params?: SelectViewDialogParams; - @internalProperty() private _dashboards: LovelaceDashboard[] = []; + @state() private _dashboards: LovelaceDashboard[] = []; - @internalProperty() private _urlPath?: string | null; + @state() private _urlPath?: string | null; - @internalProperty() private _config?: LovelaceConfig; + @state() private _config?: LovelaceConfig; public showDialog(params: SelectViewDialogParams): void { this._config = params.lovelaceConfig; @@ -138,7 +138,7 @@ export class HuiDialogSelectView extends LitElement { this.closeDialog(); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts b/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts index 9a74ed6958..6042780053 100644 --- a/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts +++ b/src/panels/lovelace/editor/unused-entities/hui-unused-entities.ts @@ -1,10 +1,10 @@ import { mdiPlus } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -33,9 +33,9 @@ export class HuiUnusedEntities extends LitElement { @property({ type: Boolean }) public narrow?: boolean; - @internalProperty() private _unusedEntities: string[] = []; + @state() private _unusedEntities: string[] = []; - @internalProperty() private _selectedEntities: string[] = []; + @state() private _selectedEntities: string[] = []; private get _config(): LovelaceConfig { return this.lovelace.config; @@ -153,7 +153,7 @@ export class HuiUnusedEntities extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { background: var(--lovelace-background); diff --git a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts index 5041bd3b60..6a6f46a86a 100644 --- a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts +++ b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts @@ -3,10 +3,10 @@ import "@polymer/paper-tabs/paper-tab"; import "@polymer/paper-tabs/paper-tabs"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -44,17 +44,17 @@ import { EditViewDialogParams } from "./show-edit-view-dialog"; export class HuiDialogEditView extends LitElement { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _params?: EditViewDialogParams; + @state() private _params?: EditViewDialogParams; - @internalProperty() private _config?: LovelaceViewConfig; + @state() private _config?: LovelaceViewConfig; - @internalProperty() private _badges?: LovelaceBadgeConfig[]; + @state() private _badges?: LovelaceBadgeConfig[]; - @internalProperty() private _cards?: LovelaceCardConfig[]; + @state() private _cards?: LovelaceCardConfig[]; - @internalProperty() private _saving = false; + @state() private _saving = false; - @internalProperty() private _curTab?: string; + @state() private _curTab?: string; private _curTabIndex = 0; @@ -347,7 +347,7 @@ export class HuiDialogEditView extends LitElement { return this._params!.viewIndex === undefined; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/lovelace/editor/view-editor/hui-view-editor.ts b/src/panels/lovelace/editor/view-editor/hui-view-editor.ts index 9ea6d9bc21..dec02719ee 100644 --- a/src/panels/lovelace/editor/view-editor/hui-view-editor.ts +++ b/src/panels/lovelace/editor/view-editor/hui-view-editor.ts @@ -1,10 +1,10 @@ import "@polymer/paper-input/paper-input"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -35,7 +35,7 @@ export class HuiViewEditor extends LitElement { @property() public isNew!: boolean; - @internalProperty() private _config!: LovelaceViewConfig; + @state() private _config!: LovelaceViewConfig; private _suggestedPath = false; @@ -181,7 +181,7 @@ export class HuiViewEditor extends LitElement { fireEvent(this, "view-config-changed", { config }); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ configElementStyle, css` diff --git a/src/panels/lovelace/editor/view-editor/hui-view-visibility-editor.ts b/src/panels/lovelace/editor/view-editor/hui-view-visibility-editor.ts index bed9698288..74010608a5 100644 --- a/src/panels/lovelace/editor/view-editor/hui-view-visibility-editor.ts +++ b/src/panels/lovelace/editor/view-editor/hui-view-visibility-editor.ts @@ -2,10 +2,10 @@ import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -40,9 +40,9 @@ export class HuiViewVisibilityEditor extends LitElement { @property() public _config!: LovelaceViewConfig; - @internalProperty() private _users!: User[]; + @state() private _users!: User[]; - @internalProperty() private _visible!: boolean | ShowViewConfig[]; + @state() private _visible!: boolean | ShowViewConfig[]; private _sortedUsers = memoizeOne((users: User[]) => users.sort((a, b) => compare(a.name, b.name)) @@ -134,7 +134,7 @@ export class HuiViewVisibilityEditor extends LitElement { fireEvent(this, "view-visibility-changed", { visible: this._visible }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/panels/lovelace/elements/hui-icon-element.ts b/src/panels/lovelace/elements/hui-icon-element.ts index 5c934ce593..bf28c07ea4 100644 --- a/src/panels/lovelace/elements/hui-icon-element.ts +++ b/src/panels/lovelace/elements/hui-icon-element.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -21,7 +21,7 @@ import { IconElementConfig, LovelaceElement } from "./types"; export class HuiIconElement extends LitElement implements LovelaceElement { public hass?: HomeAssistant; - @internalProperty() private _config?: IconElementConfig; + @state() private _config?: IconElementConfig; public setConfig(config: IconElementConfig): void { if (!config.icon) { @@ -56,7 +56,7 @@ export class HuiIconElement extends LitElement implements LovelaceElement { handleAction(this, this.hass!, this._config!, ev.detail.action!); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { cursor: pointer; diff --git a/src/panels/lovelace/elements/hui-image-element.ts b/src/panels/lovelace/elements/hui-image-element.ts index ab4d328d71..30452b0a6c 100644 --- a/src/panels/lovelace/elements/hui-image-element.ts +++ b/src/panels/lovelace/elements/hui-image-element.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -22,7 +22,7 @@ import { ImageElementConfig, LovelaceElement } from "./types"; export class HuiImageElement extends LitElement implements LovelaceElement { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: ImageElementConfig; + @state() private _config?: ImageElementConfig; public setConfig(config: ImageElementConfig): void { if (!config) { @@ -66,7 +66,7 @@ export class HuiImageElement extends LitElement implements LovelaceElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host(.clickable) { cursor: pointer; diff --git a/src/panels/lovelace/elements/hui-service-button-element.ts b/src/panels/lovelace/elements/hui-service-button-element.ts index 3c0b880e45..6d43e889ba 100644 --- a/src/panels/lovelace/elements/hui-service-button-element.ts +++ b/src/panels/lovelace/elements/hui-service-button-element.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -17,7 +17,7 @@ export class HuiServiceButtonElement implements LovelaceElement { public hass?: HomeAssistant; - @internalProperty() private _config?: ServiceButtonElementConfig; + @state() private _config?: ServiceButtonElementConfig; private _domain?: string; @@ -57,7 +57,7 @@ export class HuiServiceButtonElement `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-call-service-button { color: var(--primary-color); diff --git a/src/panels/lovelace/elements/hui-state-badge-element.ts b/src/panels/lovelace/elements/hui-state-badge-element.ts index 7677e45e57..7ec9f40313 100644 --- a/src/panels/lovelace/elements/hui-state-badge-element.ts +++ b/src/panels/lovelace/elements/hui-state-badge-element.ts @@ -1,7 +1,7 @@ import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -26,7 +26,7 @@ export class HuiStateBadgeElement implements LovelaceElement { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: StateBadgeElementConfig; + @state() private _config?: StateBadgeElementConfig; public setConfig(config: StateBadgeElementConfig): void { if (!config.entity) { diff --git a/src/panels/lovelace/elements/hui-state-icon-element.ts b/src/panels/lovelace/elements/hui-state-icon-element.ts index 7ec7fdcdf4..56865680a3 100644 --- a/src/panels/lovelace/elements/hui-state-icon-element.ts +++ b/src/panels/lovelace/elements/hui-state-icon-element.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -26,7 +26,7 @@ import { LovelaceElement, StateIconElementConfig } from "./types"; export class HuiStateIconElement extends LitElement implements LovelaceElement { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: StateIconElementConfig; + @state() private _config?: StateIconElementConfig; public setConfig(config: StateIconElementConfig): void { if (!config.entity) { @@ -77,7 +77,7 @@ export class HuiStateIconElement extends LitElement implements LovelaceElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { cursor: pointer; diff --git a/src/panels/lovelace/elements/hui-state-label-element.ts b/src/panels/lovelace/elements/hui-state-label-element.ts index 8b78064d82..d8d0b454ca 100644 --- a/src/panels/lovelace/elements/hui-state-label-element.ts +++ b/src/panels/lovelace/elements/hui-state-label-element.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -26,7 +26,7 @@ import { LovelaceElement, StateLabelElementConfig } from "./types"; class HuiStateLabelElement extends LitElement implements LovelaceElement { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: StateLabelElementConfig; + @state() private _config?: StateLabelElementConfig; public setConfig(config: StateLabelElementConfig): void { if (!config.entity) { @@ -95,7 +95,7 @@ class HuiStateLabelElement extends LitElement implements LovelaceElement { handleAction(this, this.hass!, this._config!, ev.detail.action!); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { cursor: pointer; diff --git a/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts b/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts index f4c44a5633..383b139228 100644 --- a/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-climate-entity-row.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -20,7 +20,7 @@ import { EntityConfig, LovelaceRow } from "./types"; class HuiClimateEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityConfig; + @state() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config || !config.entity) { @@ -59,7 +59,7 @@ class HuiClimateEntityRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-climate-state { text-align: right; diff --git a/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts b/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts index 4fe7860a95..0c1d0cd969 100644 --- a/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-cover-entity-row.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -22,7 +22,7 @@ import { EntityConfig, LovelaceRow } from "./types"; class HuiCoverEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityConfig; + @state() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config) { @@ -69,7 +69,7 @@ class HuiCoverEntityRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-cover-controls, ha-cover-tilt-controls { diff --git a/src/panels/lovelace/entity-rows/hui-group-entity-row.ts b/src/panels/lovelace/entity-rows/hui-group-entity-row.ts index 89e9813c3a..29c01c3441 100644 --- a/src/panels/lovelace/entity-rows/hui-group-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-group-entity-row.ts @@ -1,7 +1,7 @@ import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -21,7 +21,7 @@ import { EntityConfig, LovelaceRow } from "./types"; class HuiGroupEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityConfig; + @state() private _config?: EntityConfig; private _computeCanToggle(hass: HomeAssistant, entityIds: string[]): boolean { return entityIds.some((entityId) => { diff --git a/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts index fbc6ce31ff..1bca3bf3d3 100644 --- a/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-datetime-entity-row.ts @@ -1,7 +1,7 @@ import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -24,7 +24,7 @@ import type { EntityConfig, LovelaceRow } from "./types"; class HuiInputDatetimeEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityConfig; + @state() private _config?: EntityConfig; @query("paper-time-input") private _timeInputEl?: PaperTimeInput; diff --git a/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts index 92583cffbc..e8256b3f2f 100644 --- a/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-number-entity-row.ts @@ -1,10 +1,10 @@ import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -25,7 +25,7 @@ import { EntityConfig, LovelaceRow } from "./types"; class HuiInputNumberEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityConfig; + @state() private _config?: EntityConfig; private _loaded?: boolean; @@ -120,7 +120,7 @@ class HuiInputNumberEntityRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .flex { display: flex; diff --git a/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts index aa2ca5c4dc..ebc2606dab 100644 --- a/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-select-entity-row.ts @@ -2,10 +2,10 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -39,7 +39,7 @@ import { LovelaceRow } from "./types"; class HuiInputSelectEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntitiesCardEntityConfig; + @state() private _config?: EntitiesCardEntityConfig; public setConfig(config: EntitiesCardEntityConfig): void { if (!config || !config.entity) { @@ -136,7 +136,7 @@ class HuiInputSelectEntityRow extends LitElement implements LovelaceRow { handleAction(this, this.hass!, this._config!, ev.detail.action!); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts b/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts index 38d6e8058e..1ff1550174 100644 --- a/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-input-text-entity-row.ts @@ -1,10 +1,10 @@ import { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -22,7 +22,7 @@ import { EntityConfig, LovelaceRow } from "./types"; class HuiInputTextEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityConfig; + @state() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config) { @@ -83,7 +83,7 @@ class HuiInputTextEntityRow extends LitElement implements LovelaceRow { ev.target.blur(); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { cursor: pointer; diff --git a/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts b/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts index f8b8b66291..ad30ff2349 100644 --- a/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-lock-entity-row.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -21,7 +21,7 @@ import { EntityConfig, LovelaceRow } from "./types"; class HuiLockEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityConfig; + @state() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config) { @@ -64,7 +64,7 @@ class HuiLockEntityRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` mwc-button { margin-right: -0.57em; diff --git a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts index e86402dab3..95ab9a1186 100644 --- a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts @@ -1,10 +1,10 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -42,11 +42,11 @@ import type { EntityConfig, LovelaceRow } from "./types"; class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityConfig; + @state() private _config?: EntityConfig; - @internalProperty() private _narrow?: boolean = false; + @state() private _narrow?: boolean = false; - @internalProperty() private _veryNarrow?: boolean = false; + @state() private _veryNarrow?: boolean = false; private _resizeObserver?: ResizeObserver; @@ -91,11 +91,11 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow { `; } - const state = stateObj.state; + const entityState = stateObj.state; const buttons = html` ${!this._narrow && - state === "playing" && + entityState === "playing" && supportsFeature(stateObj, SUPPORT_PREVIOUS_TRACK) ? html` ` : ""} - ${(state === "playing" && + ${(entityState === "playing" && (supportsFeature(stateObj, SUPPORT_PAUSE) || supportsFeature(stateObj, SUPPORT_STOP))) || - ((state === "paused" || state === "idle") && + ((entityState === "paused" || entityState === "idle") && supportsFeature(stateObj, SUPPORT_PLAY)) || - (state === "on" && + (entityState === "on" && (supportsFeature(stateObj, SUPPORT_PLAY) || supportsFeature(stateObj, SUPPORT_PAUSE))) ? html` @@ -119,7 +119,8 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow { > ` : ""} - ${state === "playing" && supportsFeature(stateObj, SUPPORT_NEXT_TRACK) + ${entityState === "playing" && + supportsFeature(stateObj, SUPPORT_NEXT_TRACK) ? html`
${supportsFeature(stateObj, SUPPORT_TURN_ON) && - state === "off" && - !UNAVAILABLE_STATES.includes(state) + entityState === "off" && + !UNAVAILABLE_STATES.includes(entityState) ? html` ${(supportsFeature(stateObj, SUPPORT_VOLUME_SET) || supportsFeature(stateObj, SUPPORT_VOLUME_BUTTONS)) && - ![UNAVAILABLE, UNKNOWN, "off"].includes(state) + ![UNAVAILABLE, UNKNOWN, "off"].includes(entityState) ? html`
@@ -308,7 +309,7 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/panels/lovelace/entity-rows/hui-number-entity-row.ts b/src/panels/lovelace/entity-rows/hui-number-entity-row.ts index 40e748ec76..5854a7d0c7 100644 --- a/src/panels/lovelace/entity-rows/hui-number-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-number-entity-row.ts @@ -1,12 +1,12 @@ import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, property, - internalProperty, + state, PropertyValues, TemplateResult, } from "lit-element"; @@ -25,7 +25,7 @@ import { computeStateDisplay } from "../../../common/entity/compute_state_displa class HuiNumberEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityConfig; + @state() private _config?: EntityConfig; private _loaded?: boolean; @@ -120,7 +120,7 @@ class HuiNumberEntityRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .flex { display: flex; diff --git a/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts b/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts index e0eec27805..f0013e74c3 100644 --- a/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-scene-entity-row.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -23,7 +23,7 @@ import { ActionRowConfig, LovelaceRow } from "./types"; class HuiSceneEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _config?: ActionRowConfig; + @state() private _config?: ActionRowConfig; public setConfig(config: ActionRowConfig): void { if (!config) { @@ -65,7 +65,7 @@ class HuiSceneEntityRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` mwc-button { margin-right: -0.57em; diff --git a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts index 3be834a4b0..5eb34cfb82 100644 --- a/src/panels/lovelace/entity-rows/hui-script-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-script-entity-row.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -22,7 +22,7 @@ import { ActionRowConfig, LovelaceRow } from "./types"; class HuiScriptEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: ActionRowConfig; + @state() private _config?: ActionRowConfig; public setConfig(config: ActionRowConfig): void { if (!config) { @@ -78,7 +78,7 @@ class HuiScriptEntityRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` mwc-button:last-child { margin-right: -0.57em; diff --git a/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts b/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts index 758c8570e3..5987344bdd 100644 --- a/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-sensor-entity-row.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -33,7 +33,7 @@ interface SensorEntityConfig extends EntitiesCardEntityConfig { class HuiSensorEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: SensorEntityConfig; + @state() private _config?: SensorEntityConfig; public setConfig(config: SensorEntityConfig): void { if (!config) { @@ -95,7 +95,7 @@ class HuiSensorEntityRow extends LitElement implements LovelaceRow { handleAction(this, this.hass!, this._config!, ev.detail.action); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` div { text-align: right; diff --git a/src/panels/lovelace/entity-rows/hui-text-entity-row.ts b/src/panels/lovelace/entity-rows/hui-text-entity-row.ts index 1fb732ca5c..68762e39b5 100644 --- a/src/panels/lovelace/entity-rows/hui-text-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-text-entity-row.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -28,7 +28,7 @@ import { LovelaceRow } from "./types"; class HuiTextEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntitiesCardEntityConfig; + @state() private _config?: EntitiesCardEntityConfig; public setConfig(config: EntitiesCardEntityConfig): void { if (!config) { @@ -87,7 +87,7 @@ class HuiTextEntityRow extends LitElement implements LovelaceRow { handleAction(this, this.hass!, this._config!, ev.detail.action); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` div { text-align: right; diff --git a/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts b/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts index 448ccc4574..f6238c4e87 100644 --- a/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-timer-entity-row.ts @@ -2,7 +2,7 @@ import { HassEntity } from "home-assistant-js-websocket"; import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -20,9 +20,9 @@ import { EntityConfig } from "./types"; class HuiTimerEntityRow extends LitElement { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityConfig; + @state() private _config?: EntityConfig; - @internalProperty() private _timeRemaining?: number; + @state() private _timeRemaining?: number; private _interval?: number; diff --git a/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts b/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts index 08fb08f86f..0daf0c4088 100644 --- a/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-toggle-entity-row.ts @@ -1,7 +1,7 @@ import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -20,7 +20,7 @@ import { EntityConfig, LovelaceRow } from "./types"; class HuiToggleEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntityConfig; + @state() private _config?: EntityConfig; public setConfig(config: EntityConfig): void { if (!config) { diff --git a/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts b/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts index 1d4a23f185..c7693c9526 100644 --- a/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-weather-entity-row.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -41,7 +41,7 @@ import type { LovelaceRow } from "./types"; class HuiWeatherEntityRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: EntitiesCardEntityConfig; + @state() private _config?: EntitiesCardEntityConfig; public setConfig(config: EntitiesCardEntityConfig): void { if (!config?.entity) { @@ -133,7 +133,7 @@ class HuiWeatherEntityRow extends LitElement implements LovelaceRow { handleAction(this, this.hass!, this._config!, ev.detail.action!); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ weatherSVGStyles, css` diff --git a/src/panels/lovelace/ha-panel-lovelace.ts b/src/panels/lovelace/ha-panel-lovelace.ts index 43aa5c8d45..9b5e0b6769 100644 --- a/src/panels/lovelace/ha-panel-lovelace.ts +++ b/src/panels/lovelace/ha-panel-lovelace.ts @@ -1,12 +1,6 @@ import "@material/mwc-button"; import deepFreeze from "deep-freeze"; -import { - html, - internalProperty, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, state, LitElement, property, TemplateResult } from "lit-element"; import { constructUrlCurrentPath } from "../../common/url/construct-url"; import { addSearchParam, @@ -53,11 +47,12 @@ class LovelacePanel extends LitElement { @property() public route?: Route; @property() - private _state?: "loading" | "loaded" | "error" | "yaml-editor" = "loading"; + private _panelState?: "loading" | "loaded" | "error" | "yaml-editor" = + "loading"; - @internalProperty() private _errorMsg?: string; + @state() private _errorMsg?: string; - @internalProperty() private lovelace?: Lovelace; + @state() private lovelace?: Lovelace; private _ignoreNextUpdateEvent = false; @@ -86,7 +81,7 @@ class LovelacePanel extends LitElement { } else if (this.lovelace && this.lovelace.mode === "generated") { // When lovelace is generated, we re-generate each time a user goes // to the states panel to make sure new entities are shown. - this._state = "loading"; + this._panelState = "loading"; this._regenerateConfig(); } else if (this._fetchConfigOnConnect) { // Config was changed when we were not at the lovelace panel @@ -103,9 +98,9 @@ class LovelacePanel extends LitElement { } protected render(): TemplateResult | void { - const state = this._state!; + const panelState = this._panelState!; - if (state === "loaded") { + if (panelState === "loaded") { return html` { // If we use a strategy for dashboard, we cannot show the edit UI diff --git a/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts b/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts index 2d237225c4..14ca1a81d3 100644 --- a/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts @@ -1,7 +1,7 @@ import { customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -23,7 +23,7 @@ export class HuiButtonsHeaderFooter @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _configEntities?: EntityConfig[]; + @state() private _configEntities?: EntityConfig[]; public getCardSize(): number { return 3; diff --git a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts index f86d2645c1..93eff825be 100644 --- a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts @@ -1,10 +1,10 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -62,7 +62,7 @@ export class HuiGraphHeaderFooter @property() protected _config?: GraphHeaderFooterConfig; - @internalProperty() private _coordinates?: number[][]; + @state() private _coordinates?: number[][]; private _date?: Date; @@ -202,7 +202,7 @@ export class HuiGraphHeaderFooter this._fetching = false; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` ha-circular-progress { position: absolute; diff --git a/src/panels/lovelace/header-footer/hui-picture-header-footer.ts b/src/panels/lovelace/header-footer/hui-picture-header-footer.ts index 5a6ccfd350..19d01504e4 100644 --- a/src/panels/lovelace/header-footer/hui-picture-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-picture-header-footer.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -80,7 +80,7 @@ export class HuiPictureHeaderFooter `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` img.clickable { cursor: pointer; diff --git a/src/panels/lovelace/hui-editor.ts b/src/panels/lovelace/hui-editor.ts index d0e6dc2004..1b62dc23ee 100644 --- a/src/panels/lovelace/hui-editor.ts +++ b/src/panels/lovelace/hui-editor.ts @@ -5,10 +5,10 @@ import "@polymer/app-layout/app-toolbar/app-toolbar"; import { safeDump, safeLoad } from "js-yaml"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -47,9 +47,9 @@ class LovelaceFullConfigEditor extends LitElement { @property() public closeEditor?: () => void; - @internalProperty() private _saving?: boolean; + @state() private _saving?: boolean; - @internalProperty() private _changed?: boolean; + @state() private _changed?: boolean; protected render(): TemplateResult | void { return html` @@ -136,7 +136,7 @@ class LovelaceFullConfigEditor extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 199c979e66..5afeadc87f 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -24,9 +24,9 @@ import "@polymer/paper-tabs/paper-tab"; import "@polymer/paper-tabs/paper-tabs"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -85,7 +85,7 @@ class HUIRoot extends LitElement { @property() public route?: { path: string; prefix: string }; - @internalProperty() private _curView?: number | "hass-unused-entities"; + @state() private _curView?: number | "hass-unused-entities"; @query("ha-app-layout", true) private _appLayout!: haAppLayout; @@ -853,7 +853,7 @@ class HUIRoot extends LitElement { fireEvent(this, "iron-resize"); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/lovelace/special-rows/hui-attribute-row.ts b/src/panels/lovelace/special-rows/hui-attribute-row.ts index ce215b0f2e..2f3a317b58 100644 --- a/src/panels/lovelace/special-rows/hui-attribute-row.ts +++ b/src/panels/lovelace/special-rows/hui-attribute-row.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -22,7 +22,7 @@ import { AttributeRowConfig, LovelaceRow } from "../entity-rows/types"; class HuiAttributeRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _config?: AttributeRowConfig; + @state() private _config?: AttributeRowConfig; public setConfig(config: AttributeRowConfig): void { if (!config) { @@ -81,7 +81,7 @@ class HuiAttributeRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` div { text-align: right; diff --git a/src/panels/lovelace/special-rows/hui-button-row.ts b/src/panels/lovelace/special-rows/hui-button-row.ts index 8622503329..a32c417721 100644 --- a/src/panels/lovelace/special-rows/hui-button-row.ts +++ b/src/panels/lovelace/special-rows/hui-button-row.ts @@ -1,10 +1,10 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -24,7 +24,7 @@ import { ButtonRowConfig, LovelaceRow } from "../entity-rows/types"; export class HuiButtonRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; - @internalProperty() private _config?: ButtonRowConfig; + @state() private _config?: ButtonRowConfig; public setConfig(config: ButtonRowConfig): void { if (!config) { @@ -81,7 +81,7 @@ export class HuiButtonRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/panels/lovelace/special-rows/hui-buttons-row.ts b/src/panels/lovelace/special-rows/hui-buttons-row.ts index 58ed5f4a84..23ea52aa56 100644 --- a/src/panels/lovelace/special-rows/hui-buttons-row.ts +++ b/src/panels/lovelace/special-rows/hui-buttons-row.ts @@ -1,7 +1,7 @@ import { customElement, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -25,7 +25,7 @@ export class HuiButtonsRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass?: HomeAssistant; - @internalProperty() private _configEntities?: EntityConfig[]; + @state() private _configEntities?: EntityConfig[]; public setConfig(config: ButtonsRowConfig): void { this._configEntities = processConfigEntities(config.entities).map( diff --git a/src/panels/lovelace/special-rows/hui-cast-row.ts b/src/panels/lovelace/special-rows/hui-cast-row.ts index 851b4430d0..7021658174 100644 --- a/src/panels/lovelace/special-rows/hui-cast-row.ts +++ b/src/panels/lovelace/special-rows/hui-cast-row.ts @@ -1,10 +1,10 @@ import "@material/mwc-button/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -24,11 +24,11 @@ import { CastConfig, LovelaceRow } from "../entity-rows/types"; class HuiCastRow extends LitElement implements LovelaceRow { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _config?: CastConfig; + @state() private _config?: CastConfig; - @internalProperty() private _castManager?: CastManager | null; + @state() private _castManager?: CastManager | null; - @internalProperty() private _noHTTPS = false; + @state() private _noHTTPS = false; public setConfig(config: CastConfig): void { if (!config || config.view === undefined || config.view === null) { @@ -129,7 +129,7 @@ class HuiCastRow extends LitElement implements LovelaceRow { ); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/panels/lovelace/special-rows/hui-divider-row.ts b/src/panels/lovelace/special-rows/hui-divider-row.ts index 9949fa53d1..3763f21257 100644 --- a/src/panels/lovelace/special-rows/hui-divider-row.ts +++ b/src/panels/lovelace/special-rows/hui-divider-row.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -15,7 +15,7 @@ import { DividerConfig, LovelaceRow } from "../entity-rows/types"; class HuiDividerRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; - @internalProperty() private _config?: DividerConfig; + @state() private _config?: DividerConfig; public setConfig(config): void { if (!config) { @@ -33,7 +33,7 @@ class HuiDividerRow extends LitElement implements LovelaceRow { return html`
`; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` div { height: 1px; diff --git a/src/panels/lovelace/special-rows/hui-section-row.ts b/src/panels/lovelace/special-rows/hui-section-row.ts index 4052921bb6..045256a6ab 100644 --- a/src/panels/lovelace/special-rows/hui-section-row.ts +++ b/src/panels/lovelace/special-rows/hui-section-row.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -15,7 +15,7 @@ import { LovelaceRow, SectionConfig } from "../entity-rows/types"; class HuiSectionRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; - @internalProperty() private _config?: SectionConfig; + @state() private _config?: SectionConfig; public setConfig(config: SectionConfig): void { if (!config) { @@ -38,7 +38,7 @@ class HuiSectionRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` .label { color: var(--section-header-text-color, var(--primary-text-color)); diff --git a/src/panels/lovelace/special-rows/hui-text-row.ts b/src/panels/lovelace/special-rows/hui-text-row.ts index 6f12ce2eec..1e43ab303d 100644 --- a/src/panels/lovelace/special-rows/hui-text-row.ts +++ b/src/panels/lovelace/special-rows/hui-text-row.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -12,7 +12,7 @@ import { LovelaceRow, TextConfig } from "../entity-rows/types"; @customElement("hui-text-row") class HuiTextRow extends LitElement implements LovelaceRow { - @internalProperty() private _config?: TextConfig; + @state() private _config?: TextConfig; public setConfig(config: TextConfig): void { if (!config || !config.name || !config.text) { @@ -34,7 +34,7 @@ class HuiTextRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: flex; diff --git a/src/panels/lovelace/special-rows/hui-weblink-row.ts b/src/panels/lovelace/special-rows/hui-weblink-row.ts index 6cdf9cc983..d475d8c4e5 100644 --- a/src/panels/lovelace/special-rows/hui-weblink-row.ts +++ b/src/panels/lovelace/special-rows/hui-weblink-row.ts @@ -1,9 +1,9 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, TemplateResult, } from "lit-element"; @@ -16,7 +16,7 @@ import { LovelaceRow, WeblinkConfig } from "../entity-rows/types"; class HuiWeblinkRow extends LitElement implements LovelaceRow { public hass?: HomeAssistant; - @internalProperty() private _config?: WeblinkConfig; + @state() private _config?: WeblinkConfig; public setConfig(config: WeblinkConfig): void { if (!config || !config.url) { @@ -48,7 +48,7 @@ class HuiWeblinkRow extends LitElement implements LovelaceRow { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` a { display: flex; diff --git a/src/panels/lovelace/views/hui-masonry-view.ts b/src/panels/lovelace/views/hui-masonry-view.ts index c29130e46a..b99f4d9b16 100644 --- a/src/panels/lovelace/views/hui-masonry-view.ts +++ b/src/panels/lovelace/views/hui-masonry-view.ts @@ -1,9 +1,9 @@ import { mdiPlus } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -61,7 +61,7 @@ export class MasonryView extends LitElement implements LovelaceViewElement { @property({ attribute: false }) public badges: LovelaceBadge[] = []; - @internalProperty() private _columns?: number; + @state() private _columns?: number; private _createColumnsIteration = 0; @@ -260,7 +260,7 @@ export class MasonryView extends LitElement implements LovelaceViewElement { ); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/panels/lovelace/views/hui-panel-view.ts b/src/panels/lovelace/views/hui-panel-view.ts index 23898074aa..450e54c353 100644 --- a/src/panels/lovelace/views/hui-panel-view.ts +++ b/src/panels/lovelace/views/hui-panel-view.ts @@ -1,9 +1,9 @@ import { mdiPlus } from "@mdi/js"; import { css, - CSSResult, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -37,10 +37,7 @@ export class PanelView extends LitElement implements LovelaceViewElement { LovelaceCard | HuiErrorCard > = []; - @internalProperty() private _card?: - | LovelaceCard - | HuiWarning - | HuiCardOptions; + @state() private _card?: LovelaceCard | HuiWarning | HuiCardOptions; public setConfig(_config: LovelaceViewConfig): void {} @@ -138,7 +135,7 @@ export class PanelView extends LitElement implements LovelaceViewElement { } } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/panels/lovelace/views/hui-view.ts b/src/panels/lovelace/views/hui-view.ts index 938662e24a..ca81631685 100644 --- a/src/panels/lovelace/views/hui-view.ts +++ b/src/panels/lovelace/views/hui-view.ts @@ -1,9 +1,9 @@ import { customElement, - internalProperty, + state, property, PropertyValues, - UpdatingElement, + ReactiveElement, } from "lit-element"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import "../../../components/entity/ha-state-label-badge"; @@ -39,7 +39,7 @@ declare global { } @customElement("hui-view") -export class HUIView extends UpdatingElement { +export class HUIView extends ReactiveElement { @property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public lovelace!: Lovelace; @@ -48,9 +48,9 @@ export class HUIView extends UpdatingElement { @property({ type: Number }) public index!: number; - @internalProperty() private _cards: Array = []; + @state() private _cards: Array = []; - @internalProperty() private _badges: LovelaceBadge[] = []; + @state() private _badges: LovelaceBadge[] = []; private _layoutElementType?: string; @@ -89,6 +89,10 @@ export class HUIView extends UpdatingElement { return element; } + protected createRenderRoot() { + return this; + } + protected updated(changedProperties: PropertyValues): void { super.updated(changedProperties); diff --git a/src/panels/media-browser/ha-panel-media-browser.ts b/src/panels/media-browser/ha-panel-media-browser.ts index fd2cebb721..10d51ee00b 100644 --- a/src/panels/media-browser/ha-panel-media-browser.ts +++ b/src/panels/media-browser/ha-panel-media-browser.ts @@ -3,7 +3,7 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -129,7 +129,7 @@ class PanelMediaBrowser extends LitElement { }); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/media-browser/hui-dialog-select-media-player.ts b/src/panels/media-browser/hui-dialog-select-media-player.ts index 46865415da..5d587206d1 100644 --- a/src/panels/media-browser/hui-dialog-select-media-player.ts +++ b/src/panels/media-browser/hui-dialog-select-media-player.ts @@ -4,7 +4,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -81,7 +81,7 @@ export class HuiDialogSelectMediaPlayer extends LitElement { this.closeDialog(); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/media-browser/hui-dialog-web-browser-play-media.ts b/src/panels/media-browser/hui-dialog-web-browser-play-media.ts index 9a68172b11..df945275ad 100644 --- a/src/panels/media-browser/hui-dialog-web-browser-play-media.ts +++ b/src/panels/media-browser/hui-dialog-web-browser-play-media.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -91,7 +91,7 @@ export class HuiDialogWebBrowserPlayMedia extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/my/ha-panel-my.ts b/src/panels/my/ha-panel-my.ts index 9beeb01c87..f64c58fd7b 100644 --- a/src/panels/my/ha-panel-my.ts +++ b/src/panels/my/ha-panel-my.ts @@ -1,10 +1,4 @@ -import { - customElement, - html, - internalProperty, - LitElement, - property, -} from "lit-element"; +import { customElement, html, state, LitElement, property } from "lit-element"; import { sanitizeUrl } from "@braintree/sanitize-url"; import { navigate } from "../../common/navigate"; import { HomeAssistant, Route } from "../../types"; @@ -167,7 +161,7 @@ class HaPanelMy extends LitElement { @property() public route!: Route; - @internalProperty() public _error?: string; + @state() public _error?: string; connectedCallback() { super.connectedCallback(); diff --git a/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts b/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts index bb3aa67587..6f81e6c8d9 100644 --- a/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts +++ b/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts @@ -1,9 +1,9 @@ import "@material/mwc-button"; import { css, - CSSResult, + CSSResultGroup, customElement, - internalProperty, + state, LitElement, property, } from "lit-element"; @@ -26,21 +26,21 @@ let instance = 0; class HaMfaModuleSetupFlow extends LitElement { @property() public hass!: HomeAssistant; - @internalProperty() private _dialogClosedCallback?: (params: { + @state() private _dialogClosedCallback?: (params: { flowFinished: boolean; }) => void; - @internalProperty() private _instance?: number; + @state() private _instance?: number; - @internalProperty() private _loading = false; + @state() private _loading = false; - @internalProperty() private _opened = false; + @state() private _opened = false; - @internalProperty() private _stepData: any = {}; + @state() private _stepData: any = {}; - @internalProperty() private _step?: DataEntryFlowStep; + @state() private _step?: DataEntryFlowStep; - @internalProperty() private _errorMessage?: string; + @state() private _errorMessage?: string; public showDialog({ continueFlowId, mfaModuleId, dialogClosedCallback }) { this._instance = instance++; @@ -151,7 +151,7 @@ class HaMfaModuleSetupFlow extends LitElement { `; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/profile/ha-advanced-mode-row.ts b/src/panels/profile/ha-advanced-mode-row.ts index 4f5744e52a..67fabfa082 100644 --- a/src/panels/profile/ha-advanced-mode-row.ts +++ b/src/panels/profile/ha-advanced-mode-row.ts @@ -1,6 +1,6 @@ import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -55,7 +55,7 @@ class AdvancedModeRow extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` a { color: var(--primary-color); diff --git a/src/panels/profile/ha-change-password-card.ts b/src/panels/profile/ha-change-password-card.ts index a54cb4eff3..775b59f1ba 100644 --- a/src/panels/profile/ha-change-password-card.ts +++ b/src/panels/profile/ha-change-password-card.ts @@ -3,10 +3,10 @@ import "@polymer/paper-dialog/paper-dialog"; import "@polymer/paper-input/paper-input"; import { css, - CSSResult, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -21,17 +21,17 @@ import type { HomeAssistant } from "../../types"; class HaChangePasswordCard extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @internalProperty() private _loading = false; + @state() private _loading = false; - @internalProperty() private _statusMsg?: string; + @state() private _statusMsg?: string; - @internalProperty() private _errorMsg?: string; + @state() private _errorMsg?: string; - @internalProperty() private _currentPassword?: string; + @state() private _currentPassword?: string; - @internalProperty() private _password?: string; + @state() private _password?: string; - @internalProperty() private _passwordConfirm?: string; + @state() private _passwordConfirm?: string; protected render(): TemplateResult { return html` @@ -170,7 +170,7 @@ class HaChangePasswordCard extends LitElement { this._passwordConfirm = undefined; } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/profile/ha-long-lived-access-tokens-card.ts b/src/panels/profile/ha-long-lived-access-tokens-card.ts index 99ea0bd7bd..2468c84724 100644 --- a/src/panels/profile/ha-long-lived-access-tokens-card.ts +++ b/src/panels/profile/ha-long-lived-access-tokens-card.ts @@ -3,7 +3,7 @@ import "@material/mwc-icon-button/mwc-icon-button"; import { mdiDelete } from "@mdi/js"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -173,7 +173,7 @@ class HaLongLivedTokens extends LitElement { } } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/profile/ha-mfa-modules-card.ts b/src/panels/profile/ha-mfa-modules-card.ts index f5680cb127..5ccef7f050 100644 --- a/src/panels/profile/ha-mfa-modules-card.ts +++ b/src/panels/profile/ha-mfa-modules-card.ts @@ -3,7 +3,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -48,7 +48,7 @@ class HaMfaModulesCard extends LitElement { `; } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` mwc-button { margin-right: -0.57em; diff --git a/src/panels/profile/ha-panel-profile.ts b/src/panels/profile/ha-panel-profile.ts index cca363678c..382a4b9a6b 100644 --- a/src/panels/profile/ha-panel-profile.ts +++ b/src/panels/profile/ha-panel-profile.ts @@ -6,9 +6,9 @@ import "@polymer/paper-item/paper-item-body"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, - CSSResultArray, + CSSResultGroup, html, - internalProperty, + state, LitElement, property, TemplateResult, @@ -46,9 +46,9 @@ class HaPanelProfile extends LitElement { @property({ type: Boolean }) public narrow!: boolean; - @internalProperty() private _refreshTokens?: RefreshToken[]; + @state() private _refreshTokens?: RefreshToken[]; - @internalProperty() private _coreUserData?: CoreFrontendUserData | null; + @state() private _coreUserData?: CoreFrontendUserData | null; private _unsubCoreData?: UnsubscribeFunc; @@ -228,7 +228,7 @@ class HaPanelProfile extends LitElement { }); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/profile/ha-pick-dashboard-row.ts b/src/panels/profile/ha-pick-dashboard-row.ts index ba749ee6ea..da2c83622d 100644 --- a/src/panels/profile/ha-pick-dashboard-row.ts +++ b/src/panels/profile/ha-pick-dashboard-row.ts @@ -3,7 +3,7 @@ import "@polymer/paper-listbox/paper-listbox"; import { customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -21,7 +21,7 @@ class HaPickDashboardRow extends LitElement { @property() public narrow!: boolean; - @internalProperty() private _dashboards: LovelaceDashboard[] = []; + @state() private _dashboards: LovelaceDashboard[] = []; protected firstUpdated(changedProps: PropertyValues) { super.firstUpdated(changedProps); diff --git a/src/panels/profile/ha-pick-theme-row.ts b/src/panels/profile/ha-pick-theme-row.ts index aeb3f85324..9ba8ee47d8 100644 --- a/src/panels/profile/ha-pick-theme-row.ts +++ b/src/panels/profile/ha-pick-theme-row.ts @@ -4,9 +4,9 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, - internalProperty, + state, LitElement, property, PropertyValues, @@ -27,9 +27,9 @@ export class HaPickThemeRow extends LitElement { @property({ type: Boolean }) public narrow!: boolean; - @internalProperty() _themes: string[] = []; + @state() _themes: string[] = []; - @internalProperty() _selectedTheme = 0; + @state() _selectedTheme = 0; protected render(): TemplateResult { const hasThemes = @@ -208,7 +208,7 @@ export class HaPickThemeRow extends LitElement { fireEvent(this, "settheme", { theme }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` a { color: var(--primary-color); diff --git a/src/panels/profile/ha-refresh-tokens-card.ts b/src/panels/profile/ha-refresh-tokens-card.ts index 044dfa630d..faad31d988 100644 --- a/src/panels/profile/ha-refresh-tokens-card.ts +++ b/src/panels/profile/ha-refresh-tokens-card.ts @@ -3,7 +3,7 @@ import { mdiDelete } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, LitElement, @@ -142,7 +142,7 @@ class HaRefreshTokens extends LitElement { } } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/panels/shopping-list/ha-panel-shopping-list.ts b/src/panels/shopping-list/ha-panel-shopping-list.ts index dabeae5082..99779d0cba 100644 --- a/src/panels/shopping-list/ha-panel-shopping-list.ts +++ b/src/panels/shopping-list/ha-panel-shopping-list.ts @@ -3,10 +3,10 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import { css, - CSSResultArray, + CSSResultGroup, customElement, html, - internalProperty, + state, LitElement, property, PropertyValues, @@ -29,7 +29,7 @@ class PanelShoppingList extends LitElement { @property({ type: Boolean, reflect: true }) public narrow!: boolean; - @internalProperty() private _card!: LovelaceCard | HuiErrorCard; + @state() private _card!: LovelaceCard | HuiErrorCard; private _conversation = memoizeOne((_components) => isComponentLoaded(this.hass, "conversation") @@ -85,7 +85,7 @@ class PanelShoppingList extends LitElement { showVoiceCommandDialog(this); } - static get styles(): CSSResultArray { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/state-summary/state-card-display.ts b/src/state-summary/state-card-display.ts index c89668cfe2..aec040baf9 100755 --- a/src/state-summary/state-card-display.ts +++ b/src/state-summary/state-card-display.ts @@ -2,7 +2,7 @@ import "@polymer/iron-flex-layout/iron-flex-layout-classes"; import type { HassEntity } from "home-assistant-js-websocket"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -75,7 +75,7 @@ export class StateCardDisplay extends LitElement { } } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyle, css` diff --git a/src/state-summary/state-card-input_select.ts b/src/state-summary/state-card-input_select.ts index 7b82d9767d..1c45e41b57 100644 --- a/src/state-summary/state-card-input_select.ts +++ b/src/state-summary/state-card-input_select.ts @@ -4,7 +4,7 @@ import type { PaperItemElement } from "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResult, + CSSResultGroup, customElement, html, LitElement, @@ -61,7 +61,7 @@ class StateCardInputSelect extends LitElement { await setInputSelectOption(this.hass, this.stateObj.entity_id, option); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return css` :host { display: block; diff --git a/src/state-summary/state-card-script.ts b/src/state-summary/state-card-script.ts index afd839c569..579036e07e 100644 --- a/src/state-summary/state-card-script.ts +++ b/src/state-summary/state-card-script.ts @@ -1,12 +1,12 @@ import "@material/mwc-button"; import { HassEntity } from "home-assistant-js-websocket"; import { - CSSResult, customElement, - html, LitElement, property, + CSSResultGroup, } from "lit-element"; +import { html } from "lit-html"; import "../components/entity/ha-entity-toggle"; import "../components/entity/state-info"; import { UNAVAILABLE_STATES } from "../data/entity"; @@ -72,7 +72,7 @@ export class StateCardScript extends LitElement { }); } - static get styles(): CSSResult { + static get styles(): CSSResultGroup { return haStyle; } } diff --git a/src/state/quick-bar-mixin.ts b/src/state/quick-bar-mixin.ts index c09ce80402..7431a1e9f8 100644 --- a/src/state/quick-bar-mixin.ts +++ b/src/state/quick-bar-mixin.ts @@ -1,10 +1,10 @@ -import type { Constructor, PropertyValues } from "lit-element"; +import type { PropertyValues } from "lit-element"; import tinykeys from "tinykeys"; import { QuickBarParams, showQuickBar, } from "../dialogs/quick-bar/show-dialog-quick-bar"; -import { HomeAssistant } from "../types"; +import { Constructor, HomeAssistant } from "../types"; import { storeState } from "../util/ha-pref-storage"; import { HassElement } from "./hass-element"; diff --git a/src/state/url-sync-mixin.ts b/src/state/url-sync-mixin.ts index 2a9efa8d05..b6ae356ac3 100644 --- a/src/state/url-sync-mixin.ts +++ b/src/state/url-sync-mixin.ts @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import { UpdatingElement } from "lit-element"; +import { ReactiveElement } from "lit-element"; import { HASSDomEvent } from "../common/dom/fire_event"; import { closeDialog, @@ -13,7 +13,7 @@ import { Constructor } from "../types"; const DEBUG = false; export const urlSyncMixin = < - T extends Constructor + T extends Constructor >( superClass: T ) => diff --git a/src/styles/polymer-ha-style-dialog.ts b/src/styles/polymer-ha-style-dialog.ts index 04e28b93e1..22e239b470 100644 --- a/src/styles/polymer-ha-style-dialog.ts +++ b/src/styles/polymer-ha-style-dialog.ts @@ -1,4 +1,5 @@ import "@polymer/polymer/lib/elements/dom-module"; +import { CSSResult } from "lit-element"; import { haStyleDialog } from "../resources/styles"; const documentContainer = document.createElement("template"); @@ -7,7 +8,7 @@ documentContainer.setAttribute("style", "display: none;"); documentContainer.innerHTML = ` `; diff --git a/src/styles/polymer-ha-style.ts b/src/styles/polymer-ha-style.ts index 22d8c38cc6..ea6c98d829 100644 --- a/src/styles/polymer-ha-style.ts +++ b/src/styles/polymer-ha-style.ts @@ -1,4 +1,5 @@ import "@polymer/polymer/lib/elements/dom-module"; +import { CSSResult } from "lit-element"; import { haStyle } from "../resources/styles"; const documentContainer = document.createElement("template"); @@ -7,7 +8,7 @@ documentContainer.setAttribute("style", "display: none;"); documentContainer.innerHTML = ` `; diff --git a/yarn.lock b/yarn.lock index 1b7f205fdf..86cb516b9d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8739,17 +8739,17 @@ lit-analyzer@1.2.1, lit-analyzer@^1.2.1: vscode-html-languageservice "3.1.0" web-component-analyzer "~1.1.1" -lit-element@2.5.0, lit-element@^2.0.0, lit-element@^2.2.1, lit-element@^2.3.0, lit-element@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-2.5.0.tgz#218773185d30cab8cb7baabcddd9182f6e7bc14b" - integrity sha512-SS6Bmm7FYw/RVeD6YD3gAjrT0ss6rOQHaacUnDCyVE3sDuUpEmr+Gjl0QUHnD8+0mM5apBbnA60NkFJ2kqcOMA== +lit-element@2.5.1, lit-element@^2.0.0, lit-element@^2.2.1, lit-element@^2.3.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-2.5.1.tgz#3fa74b121a6cd22902409ae3859b7847d01aa6b6" + integrity sha512-ogu7PiJTA33bEK0xGu1dmaX5vhcRjBXCFexPja0e7P7jqLhTpNKYRPmE+GmiCaRVAbiQKGkUgkh/i6+bh++dPQ== dependencies: lit-html "^1.1.1" -lit-html@1.4.0, lit-html@^1.0.0, lit-html@^1.1.1, lit-html@^1.1.2, lit-html@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-1.4.0.tgz#5f18c08d11b52b1d01ceb263df42f115aecef5ca" - integrity sha512-cgaqPSgqHRaTH/P1DnWD/dQxudtrHqD0xo1AoyOGJZir2rXgsvTg77z6Pitwk9B+kL23EakD62HV3x8sT01aWQ== +lit-html@1.4.1, lit-html@^1.0.0, lit-html@^1.1.1, lit-html@^1.1.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-1.4.1.tgz#0c6f3ee4ad4eb610a49831787f0478ad8e9ae5e0" + integrity sha512-B9btcSgPYb1q4oSOb/PrOT6Z/H+r6xuNzfH4lFli/AWhYwdtrgQkQWBbIc6mdnf6E2IL3gDXdkkqNktpU0OZQA== lit-virtualizer@^0.4.2: version "0.4.2" From d308c5d9b906af0986e002c58adbc92b3f5518b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Sat, 8 May 2021 00:06:11 +0200 Subject: [PATCH 016/117] Add manual limit selection to graph header/footer (#9126) Co-authored-by: Paulus Schoutsen --- src/panels/lovelace/cards/hui-sensor-card.ts | 1 + src/panels/lovelace/cards/types.ts | 4 ++++ src/panels/lovelace/common/graph/coordinates.ts | 13 ++++++++++--- .../header-footer/hui-graph-header-footer.ts | 11 ++++++++++- src/panels/lovelace/header-footer/types.ts | 4 ++++ 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/panels/lovelace/cards/hui-sensor-card.ts b/src/panels/lovelace/cards/hui-sensor-card.ts index 0dc038770e..e8cb258662 100644 --- a/src/panels/lovelace/cards/hui-sensor-card.ts +++ b/src/panels/lovelace/cards/hui-sensor-card.ts @@ -55,6 +55,7 @@ class HuiSensorCard extends HuiEntityCard { entity: config.entity, detail: detail || 1, hours_to_show: hours_to_show || 24, + limits: config.limits!, }; entityCardConfig.footer = footerConfig; diff --git a/src/panels/lovelace/cards/types.ts b/src/panels/lovelace/cards/types.ts index 6f70d507ce..db5c4063e4 100644 --- a/src/panels/lovelace/cards/types.ts +++ b/src/panels/lovelace/cards/types.ts @@ -286,6 +286,10 @@ export interface SensorCardConfig extends LovelaceCardConfig { detail?: number; theme?: string; hours_to_show?: number; + limits?: { + min?: number; + max?: number; + }; } export interface ShoppingListCardConfig extends LovelaceCardConfig { diff --git a/src/panels/lovelace/common/graph/coordinates.ts b/src/panels/lovelace/common/graph/coordinates.ts index 0b64d5dffd..7674492c9a 100644 --- a/src/panels/lovelace/common/graph/coordinates.ts +++ b/src/panels/lovelace/common/graph/coordinates.ts @@ -57,15 +57,22 @@ export const coordinates = ( history: any, hours: number, width: number, - detail: number + detail: number, + limits?: { min?: number; max?: number } ): number[][] | undefined => { history.forEach((item) => { item.state = Number(item.state); }); history = history.filter((item) => !Number.isNaN(item.state)); - const min = Math.min(...history.map((item) => item.state)); - const max = Math.max(...history.map((item) => item.state)); + const min = + limits?.min !== undefined + ? limits.min + : Math.min(...history.map((item) => item.state)); + const max = + limits?.max !== undefined + ? limits.max + : Math.max(...history.map((item) => item.state)); const now = new Date().getTime(); const reduce = (res, item, point) => { diff --git a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts index 93eff825be..bc80313c02 100644 --- a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts @@ -190,12 +190,21 @@ export class HuiGraphHeaderFooter this._stateHistory!.push(...stateHistory[0]); } + const limits = + this._config!.limits === undefined && + this._stateHistory?.some( + (entity) => entity.attributes?.unit_of_measurement === "%" + ) + ? { min: 0, max: 100 } + : this._config!.limits; + this._coordinates = coordinates( this._stateHistory, this._config!.hours_to_show!, 500, - this._config!.detail! + this._config!.detail!, + limits ) || []; this._date = endTime; diff --git a/src/panels/lovelace/header-footer/types.ts b/src/panels/lovelace/header-footer/types.ts index 2514649dda..00e058f759 100644 --- a/src/panels/lovelace/header-footer/types.ts +++ b/src/panels/lovelace/header-footer/types.ts @@ -15,6 +15,10 @@ export interface GraphHeaderFooterConfig extends LovelaceHeaderFooterConfig { entity: string; detail?: number; hours_to_show?: number; + limits?: { + min?: number; + max?: number; + }; } export interface PictureHeaderFooterConfig extends LovelaceHeaderFooterConfig { From 83cabcac28637b997bd25a3b1c6c110557ba950c Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Sat, 8 May 2021 00:07:05 +0200 Subject: [PATCH 017/117] Add tsc and eslint to pre-commit (#9131) --- lint-staged.config.js | 5 + package.json | 13 +- yarn.lock | 576 ++++++++++++++++-------------------------- 3 files changed, 226 insertions(+), 368 deletions(-) create mode 100644 lint-staged.config.js diff --git a/lint-staged.config.js b/lint-staged.config.js new file mode 100644 index 0000000000..15d6269cbc --- /dev/null +++ b/lint-staged.config.js @@ -0,0 +1,5 @@ +module.exports = { + "*.ts": () => "tsc -p tsconfig.json", + "*.{js,ts}": "eslint --fix", + "!(/translations)*.{js,ts,json,css,md,html}": "prettier --write", +}; diff --git a/package.json b/package.json index 2002de0926..9d3e64db6e 100644 --- a/package.json +++ b/package.json @@ -204,7 +204,7 @@ "gulp-zopfli-green": "^3.0.1", "html-minifier": "^4.0.0", "husky": "^1.3.1", - "lint-staged": "^8.1.5", + "lint-staged": "^10.5.4", "lit-analyzer": "^1.2.1", "lodash.template": "^4.5.0", "magic-string": "^0.25.7", @@ -250,17 +250,6 @@ "pre-commit": "lint-staged" } }, - "lint-staged": { - "linters": { - "*.{js,ts,json,css,md}": [ - "prettier --write", - "git add" - ] - }, - "ignore": [ - "translations/**" - ] - }, "prettier": { "trailingComma": "es5", "arrowParens": "always" diff --git a/yarn.lock b/yarn.lock index 86cb516b9d..a2c1c90dae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -898,13 +898,6 @@ "@babel/helper-validator-option" "^7.12.17" "@babel/plugin-transform-typescript" "^7.13.0" -"@babel/runtime@7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.0.0.tgz#adeb78fedfc855aa05bc041640f3f6f98e85424c" - integrity sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA== - dependencies: - regenerator-runtime "^0.12.0" - "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4": version "7.14.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.0.tgz#46794bc20b612c5f75e62dd071e24dfd95f1cbe6" @@ -2511,13 +2504,6 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@samverschueren/stream-to-observable@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" - integrity sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg== - dependencies: - any-observable "^0.3.0" - "@sinonjs/commons@^1", "@sinonjs/commons@^1.0.2", "@sinonjs/commons@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.4.0.tgz#7b3ec2d96af481d7a0321252e7b1c94724ec5a78" @@ -2842,6 +2828,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.46.tgz#1cd867ebfe9957ab45951f2f715f8de5f3dab7a3" integrity sha512-Tice8a+sJtlP9C1EUo0DYyjq52T37b3LexVu3p871+kfIBIN+OQ7PKPei1oF3MgF39olEpUfxaLtD+QFc1k69Q== +"@types/parse-json@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" + integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== + "@types/parse5@^5.0.3": version "5.0.3" resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109" @@ -3518,6 +3509,14 @@ acorn@^8.0.4: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.0.5.tgz#a3bfb872a74a6a7f661bc81b9849d9cac12601b7" integrity sha512-v+DieK/HJkJOpFBETDJioequtc3PfxsWMaxIdIwujtF7FEV/MAyDQLlm6/zPvr7Mix07mLh6ccVwIsloceodlg== +aggregate-error@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" @@ -3627,11 +3626,6 @@ ansi-colors@^4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-escapes@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - ansi-escapes@^4.2.1: version "4.3.1" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" @@ -3639,6 +3633,13 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.11.0" +ansi-escapes@^4.3.0: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + ansi-gray@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" @@ -3718,11 +3719,6 @@ any-base@^1.1.0: resolved "https://registry.yarnpkg.com/any-base/-/any-base-1.1.0.tgz#ae101a62bc08a597b4c9ab5b7089d456630549fe" integrity sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg== -any-observable@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" - integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== - any-promise@^1.0.0, any-promise@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" @@ -3961,7 +3957,7 @@ array.prototype.flat@^1.2.3: define-properties "^1.1.3" es-abstract "^1.18.0-next.1" -arrify@^1.0.0, arrify@^1.0.1: +arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= @@ -4582,7 +4578,7 @@ chalk@^0.5.0: strip-ansi "^0.3.0" supports-color "^0.2.0" -chalk@^1.0.0, chalk@^1.1.3: +chalk@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= @@ -4593,7 +4589,7 @@ chalk@^1.0.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -4610,7 +4606,7 @@ chalk@^3.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^4.0.0: +chalk@^4.0.0, chalk@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad" integrity sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg== @@ -4798,18 +4794,16 @@ clean-css@^4.2.1: dependencies: source-map "~0.6.0" +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + cli-boxes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= -cli-cursor@^2.0.0, cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - cli-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" @@ -4817,13 +4811,13 @@ cli-cursor@^3.1.0: dependencies: restore-cursor "^3.1.0" -cli-truncate@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" - integrity sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ= +cli-truncate@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" + integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== dependencies: - slice-ansi "0.0.4" - string-width "^1.0.1" + slice-ansi "^3.0.0" + string-width "^4.2.0" cli-width@^2.0.0: version "2.2.0" @@ -4999,7 +4993,7 @@ command-line-usage@^6.1.1: table-layout "^1.0.1" typical "^5.2.0" -commander@^2.14.1, commander@^2.19.0, commander@^2.9.0: +commander@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== @@ -5009,6 +5003,11 @@ commander@^2.20.0, commander@^2.20.3, commander@~2.20.3: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +commander@^6.2.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" + integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== + commander@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-7.1.0.tgz#f2eaecf131f10e36e07d894698226e36ae0eb5ff" @@ -5199,7 +5198,7 @@ core-util-is@~1.0.0: resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cosmiconfig@^5.0.2, cosmiconfig@^5.0.7: +cosmiconfig@^5.0.7: version "5.2.0" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.0.tgz#45038e4d28a7fe787203aede9c25bca4a08b12c8" integrity sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g== @@ -5209,6 +5208,17 @@ cosmiconfig@^5.0.2, cosmiconfig@^5.0.7: js-yaml "^3.13.0" parse-json "^4.0.0" +cosmiconfig@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.0.tgz#ef9b44d773959cae63ddecd122de23853b60f8d3" + integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA== + dependencies: + "@types/parse-json" "^4.0.0" + import-fresh "^3.2.1" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.10.0" + cpx@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/cpx/-/cpx-1.5.0.tgz#185be018511d87270dedccc293171e37655ab88f" @@ -5287,7 +5297,7 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -5337,11 +5347,6 @@ d@1: dependencies: es5-ext "^0.10.9" -date-fns@^1.27.2: - version "1.30.1" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" - integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== - dateformat@^1.0.7-1.2.3: version "1.0.12" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" @@ -5383,7 +5388,7 @@ debug@^4.0.1, debug@^4.1.1: dependencies: ms "^2.1.1" -debug@^4.1.0: +debug@^4.1.0, debug@^4.2.0: version "4.3.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== @@ -5510,18 +5515,6 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -del@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" - integrity sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU= - dependencies: - globby "^6.1.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - p-map "^1.1.1" - pify "^3.0.0" - rimraf "^2.2.8" - del@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/del/-/del-4.0.0.tgz#4fa27e92c366cb45b9bdaa56a9b8703dced17437" @@ -5720,11 +5713,6 @@ electron-to-chromium@^1.3.719: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.723.tgz#52769a75635342a4db29af5f1e40bd3dad02c877" integrity sha512-L+WXyXI7c7+G1V8ANzRsPI5giiimLAUDC6Zs1ojHHPhYXb3k/iTABFmWjivEtsWrRQymjnO66/rO2ZTABGdmWg== -elegant-spinner@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" - integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= - elliptic@^6.0.0, elliptic@^6.5.2: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" @@ -5922,7 +5910,7 @@ escape-html@^1.0.3, escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.4, escape-string-regexp@^1.0.5: +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -6330,6 +6318,21 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execa@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" + integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== + dependencies: + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.0" + onetime "^5.1.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" + execa@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/execa/-/execa-5.0.0.tgz#4029b0007998a841fbd1032e5f4de86a3c1e3376" @@ -6565,22 +6568,7 @@ fecha@^4.2.0: resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.0.tgz#3ffb6395453e3f3efff850404f0a59b6747f5f41" integrity sha512-aN3pcx/DSmtyoovUudctc8+6Hl4T+hI9GBBHLjA76jdZl7+b1sgh5g4k+u/GL3dTy1/pnYzKp69FpJ0OicE3Wg== -figures@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" - integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= - dependencies: - escape-string-regexp "^1.0.5" - object-assign "^4.1.0" - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= - dependencies: - escape-string-regexp "^1.0.5" - -figures@^3.0.0: +figures@^3.0.0, figures@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== @@ -6666,11 +6654,6 @@ find-index@^0.1.1: resolved "https://registry.yarnpkg.com/find-index/-/find-index-0.1.1.tgz#675d358b2ca3892d795a1ab47232f8b6e2e0dde4" integrity sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ= -find-parent-dir@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" - integrity sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ= - find-replace@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" @@ -6791,11 +6774,6 @@ flush-write-stream@^1.0.2: inherits "^2.0.3" readable-stream "^2.3.6" -fn-name@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-2.0.1.tgz#5214d7537a4d06a4a301c0cc262feb84188002e7" - integrity sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc= - follow-redirects@^1.0.0: version "1.13.0" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" @@ -6922,15 +6900,6 @@ fuse.js@^6.0.0: resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-6.0.0.tgz#6fc16cd7555648deda392892402d4188553552b2" integrity sha512-e5Ap6mhF/WQ9bKqsMFTTR5/DS9qbYab4VXHtMdxCanH+VZkdUV2LqcgMO31etSQv53NXsguQF1bdqkrrPAM2HQ== -g-status@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/g-status/-/g-status-2.0.2.tgz#270fd32119e8fc9496f066fe5fe88e0a6bc78b97" - integrity sha512-kQoE9qH+T1AHKgSSD0Hkv98bobE90ILQcXAF4wvGgsr7uFqNvwmh8j+Lq3l0RVt3E3HjSbv2B9biEGcEtpHLCA== - dependencies: - arrify "^1.0.1" - matcher "^1.0.0" - simple-git "^1.85.0" - gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -7001,6 +6970,13 @@ get-stream@^4.0.0: dependencies: pump "^3.0.0" +get-stream@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + get-stream@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.0.tgz#3e0012cb6827319da2706e601a1583e8629a6718" @@ -7603,6 +7579,11 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= +human-signals@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" + integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== + human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" @@ -7715,10 +7696,10 @@ indent-string@^2.1.0: dependencies: repeating "^2.0.0" -indent-string@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" - integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== indexof@0.0.1: version "0.0.1" @@ -8135,30 +8116,11 @@ is-obj@^1.0.1: resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= -is-observable@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" - integrity sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA== - dependencies: - symbol-observable "^1.1.0" - -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= - is-path-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.0.0.tgz#d4777a8e227a00096a31f030db3770f84b116c02" integrity sha512-m5dHHzpOXEiv18JEORttBO64UgTEypx99vCxQLjbBvGhOJxnTNglYoFXxwo6AbsQb79sqqycQEHv2hWkHZAijA== -is-path-in-cwd@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" - integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ== - dependencies: - is-path-inside "^1.0.0" - is-path-in-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-2.0.0.tgz#68e452a6eec260500cec21e029c0a44cc0dcd2ea" @@ -8270,6 +8232,11 @@ is-unc-path@^1.0.0: dependencies: unc-path-regex "^0.1.2" +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + is-utf8@^0.2.0, is-utf8@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" @@ -8389,6 +8356,11 @@ json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -8650,80 +8622,46 @@ liftoff@^3.1.0: rechoir "^0.6.2" resolve "^1.1.7" -lint-staged@^8.1.5: - version "8.1.5" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.1.5.tgz#372476fe1a58b8834eb562ed4c99126bd60bdd79" - integrity sha512-e5ZavfnSLcBJE1BTzRTqw6ly8OkqVyO3GL2M6teSmTBYQ/2BuueD5GIt2RPsP31u/vjKdexUyDCxSyK75q4BDA== +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + +lint-staged@^10.5.4: + version "10.5.4" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.5.4.tgz#cd153b5f0987d2371fc1d2847a409a2fe705b665" + integrity sha512-EechC3DdFic/TdOPgj/RB3FicqE6932LTHCUm0Y2fsD9KGlLB+RwJl2q1IYBIvEsKzDOgn0D4gll+YxG5RsrKg== dependencies: - chalk "^2.3.1" - commander "^2.14.1" - cosmiconfig "^5.0.2" - debug "^3.1.0" + chalk "^4.1.0" + cli-truncate "^2.1.0" + commander "^6.2.0" + cosmiconfig "^7.0.0" + debug "^4.2.0" dedent "^0.7.0" - del "^3.0.0" - execa "^1.0.0" - find-parent-dir "^0.3.0" - g-status "^2.0.2" - is-glob "^4.0.0" - is-windows "^1.0.2" - listr "^0.14.2" - listr-update-renderer "^0.5.0" - lodash "^4.17.11" - log-symbols "^2.2.0" - micromatch "^3.1.8" - npm-which "^3.0.1" - p-map "^1.1.1" - path-is-inside "^1.0.2" - pify "^3.0.0" - please-upgrade-node "^3.0.2" - staged-git-files "1.1.2" - string-argv "^0.0.2" - stringify-object "^3.2.2" - yup "^0.26.10" + enquirer "^2.3.6" + execa "^4.1.0" + listr2 "^3.2.2" + log-symbols "^4.0.0" + micromatch "^4.0.2" + normalize-path "^3.0.0" + please-upgrade-node "^3.2.0" + string-argv "0.3.1" + stringify-object "^3.3.0" -listr-silent-renderer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" - integrity sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4= - -listr-update-renderer@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz#4ea8368548a7b8aecb7e06d8c95cb45ae2ede6a2" - integrity sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA== +listr2@^3.2.2: + version "3.8.2" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.8.2.tgz#99b138ad1cfb08f1b0aacd422972e49b2d814b99" + integrity sha512-E28Fw7Zd3HQlCJKzb9a8C8M0HtFWQeucE+S8YrSrqZObuCLPRHMRrR8gNmYt65cU9orXYHwvN5agXC36lYt7VQ== dependencies: - chalk "^1.1.3" - cli-truncate "^0.2.1" - elegant-spinner "^1.0.1" - figures "^1.7.0" - indent-string "^3.0.0" - log-symbols "^1.0.2" - log-update "^2.3.0" - strip-ansi "^3.0.1" - -listr-verbose-renderer@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz#f1132167535ea4c1261102b9f28dac7cba1e03db" - integrity sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw== - dependencies: - chalk "^2.4.1" - cli-cursor "^2.1.0" - date-fns "^1.27.2" - figures "^2.0.0" - -listr@^0.14.2: - version "0.14.3" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586" - integrity sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA== - dependencies: - "@samverschueren/stream-to-observable" "^0.3.0" - is-observable "^1.1.0" - is-promise "^2.1.0" - is-stream "^1.1.0" - listr-silent-renderer "^1.1.1" - listr-update-renderer "^0.5.0" - listr-verbose-renderer "^0.5.0" - p-map "^2.0.0" - rxjs "^6.3.3" + chalk "^4.1.1" + cli-truncate "^2.1.0" + figures "^3.2.0" + indent-string "^4.0.0" + log-update "^4.0.0" + p-map "^4.0.0" + rxjs "^6.6.7" + through "^2.3.8" + wrap-ansi "^7.0.0" lit-analyzer@1.2.1, lit-analyzer@^1.2.1: version "1.2.1" @@ -9011,11 +8949,6 @@ lodash.values@~2.4.1: dependencies: lodash.keys "~2.4.1" -lodash@^4.17.10: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== - lodash@^4.17.11, lodash@^4.17.20, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -9033,28 +8966,30 @@ log-symbols@3.0.0: dependencies: chalk "^2.4.2" -log-symbols@^1.0.0, log-symbols@^1.0.2: +log-symbols@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" integrity sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg= dependencies: chalk "^1.0.0" -log-symbols@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== +log-symbols@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== dependencies: - chalk "^2.0.1" + chalk "^4.1.0" + is-unicode-supported "^0.1.0" -log-update@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" - integrity sha1-iDKP19HOeTiykoN0bwsbwSayRwg= +log-update@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" + integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== dependencies: - ansi-escapes "^3.0.0" - cli-cursor "^2.0.0" - wrap-ansi "^3.0.1" + ansi-escapes "^4.3.0" + cli-cursor "^3.1.0" + slice-ansi "^4.0.0" + wrap-ansi "^6.2.0" loglevel@^1.6.8: version "1.7.0" @@ -9170,13 +9105,6 @@ matchdep@^2.0.0: resolve "^1.4.0" stack-trace "0.0.10" -matcher@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/matcher/-/matcher-1.1.1.tgz#51d8301e138f840982b338b116bb0c09af62c1c2" - integrity sha512-+BmqxWIubKTRKNWx/ahnCkk3mG8m7OturVlqq6HiojGJTd5hVYbgZm6WzcYPCoB+KBT4Vd6R7WSRG2OADNaCjg== - dependencies: - escape-string-regexp "^1.0.4" - math-random@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" @@ -9281,7 +9209,7 @@ micromatch@^2.1.5: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: +micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -9374,11 +9302,6 @@ mime@^2.4.4: resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA== -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -9769,13 +9692,6 @@ npm-packlist@^1.1.6: ignore-walk "^3.0.1" npm-bundled "^1.0.1" -npm-path@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" - integrity sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw== - dependencies: - which "^1.2.10" - npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -9783,22 +9699,13 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" -npm-run-path@^4.0.1: +npm-run-path@^4.0.0, npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== dependencies: path-key "^3.0.0" -npm-which@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" - integrity sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo= - dependencies: - commander "^2.9.0" - npm-path "^2.0.2" - which "^1.2.10" - npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" @@ -9973,13 +9880,6 @@ once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: dependencies: wrappy "1" -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - onetime@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" @@ -10149,16 +10049,18 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" -p-map@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" - integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== - p-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.0.0.tgz#be18c5a5adeb8e156460651421aceca56c213a50" integrity sha512-GO107XdrSUmtHxVoi60qc9tUl/KkNKm+X2CF4P9amalpGxv5YqVPJNfSb0wcA+syCopkZvYYIzW8OVTQW59x/w== +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + dependencies: + aggregate-error "^3.0.0" + p-retry@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/p-retry/-/p-retry-3.0.1.tgz#316b4c8893e2c8dc1cfa891f406c4b422bebf328" @@ -10269,6 +10171,16 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse-json@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + parse-node-version@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" @@ -10343,7 +10255,7 @@ path-is-absolute@1.0.1, path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@1.0.2, path-is-inside@^1.0.1, path-is-inside@^1.0.2: +path-is-inside@1.0.2, path-is-inside@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= @@ -10504,13 +10416,20 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -please-upgrade-node@^3.0.2, please-upgrade-node@^3.1.1: +please-upgrade-node@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" integrity sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ== dependencies: semver-compare "^1.0.0" +please-upgrade-node@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" + integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== + dependencies: + semver-compare "^1.0.0" + plugin-error@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c" @@ -10619,11 +10538,6 @@ promise@^8.0.1: dependencies: asap "~2.0.6" -property-expr@^1.5.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/property-expr/-/property-expr-1.5.1.tgz#22e8706894a0c8e28d58735804f6ba3a3673314f" - integrity sha512-CGuc0VUTGthpJXL36ydB6jnbyOf/rAHFvmVrJlH+Rg0DqqLFQGAP6hIaxD/G0OAmBJPhXDHuEJigrp0e0wFV6g== - proxy-addr@~2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" @@ -10734,11 +10648,6 @@ querystring@0.2.0: resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= -querystringify@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" - integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA== - querystringify@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" @@ -10967,11 +10876,6 @@ regenerator-runtime@^0.11.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== -regenerator-runtime@^0.12.0: - version "0.12.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" - integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== - regenerator-runtime@^0.13.2: version "0.13.2" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447" @@ -11245,14 +11149,6 @@ resolve@^1.17.0: is-core-module "^2.1.0" path-parse "^1.0.6" -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -11276,7 +11172,7 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@2.6.3, rimraf@^2.2.8, rimraf@^2.6.1, rimraf@^2.6.2: +rimraf@2.6.3, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== @@ -11394,13 +11290,6 @@ run-parallel@^1.1.9: resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== -rxjs@^6.3.3: - version "6.4.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.4.0.tgz#f3bb0fe7bda7fb69deac0c16f17b50b0b8790504" - integrity sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw== - dependencies: - tslib "^1.9.0" - rxjs@^6.5.3: version "6.5.5" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" @@ -11408,6 +11297,13 @@ rxjs@^6.5.3: dependencies: tslib "^1.9.0" +rxjs@^6.6.7: + version "6.6.7" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" + integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -11701,13 +11597,6 @@ signal-exit@^3.0.3: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== -simple-git@^1.85.0: - version "1.110.0" - resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-1.110.0.tgz#54eb179089d055a7783d32399246cebc9d9933e9" - integrity sha512-UYY0rQkknk0P5eb+KW+03F4TevZ9ou0H+LoGaj7iiVgpnZH4wdj/HTViy/1tNNkmIPcmtxuBqXWiYt2YwlRKOQ== - dependencies: - debug "^4.0.1" - sinon@^7.3.1: version "7.3.1" resolved "https://registry.yarnpkg.com/sinon/-/sinon-7.3.1.tgz#e8276522104e6c08d1cb52a907270b0e316655c4" @@ -11731,11 +11620,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" - integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= - slice-ansi@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" @@ -11745,6 +11629,15 @@ slice-ansi@^2.1.0: astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" +slice-ansi@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" + integrity sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + slice-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" @@ -11945,11 +11838,6 @@ stack-trace@0.0.10: resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= -staged-git-files@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.2.tgz#4326d33886dc9ecfa29a6193bf511ba90a46454b" - integrity sha512-0Eyrk6uXW6tg9PYkhi/V/J4zHp33aNyi2hOCmhFLqLTIhbgqWn5jlSzI+IU0VqrZq6+DbHcabQl/WP6P3BG0QA== - static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -11999,10 +11887,10 @@ stream-to-array@^2.0.2: dependencies: any-promise "^1.1.0" -string-argv@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" - integrity sha1-2sMECGkMIfPDYwo/86BYd73L1zY= +string-argv@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" + integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" @@ -12115,7 +12003,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringify-object@^3.2.2, stringify-object@^3.3.0: +stringify-object@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== @@ -12271,16 +12159,6 @@ sver-compat@^1.5.0: es6-iterator "^2.0.1" es6-symbol "^3.1.1" -symbol-observable@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" - integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== - -synchronous-promise@^2.0.5: - version "2.0.7" - resolved "https://registry.yarnpkg.com/synchronous-promise/-/synchronous-promise-2.0.7.tgz#3574b3d2fae86b145356a4b89103e1577f646fe3" - integrity sha512-16GbgwTmFMYFyQMLvtQjvNWh30dsFe1cAW5Fg1wm5+dg84L9Pe36mftsIRU95/W2YsISxsz/xq4VB23sqpgb/A== - systemjs@^6.3.2: version "6.3.2" resolved "https://registry.yarnpkg.com/systemjs/-/systemjs-6.3.2.tgz#2c3407f949260fdfb3b837c191869db933d1fe0f" @@ -12572,11 +12450,6 @@ toidentifier@1.0.0: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== -toposort@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/toposort/-/toposort-2.0.2.tgz#ae21768175d1559d48bef35420b2f4962f09c330" - integrity sha1-riF2gXXRVZ1IvvNUILL0li8JwzA= - tr46@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" @@ -12725,6 +12598,11 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + type-fest@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" @@ -12916,15 +12794,7 @@ urix@^0.1.0: resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= -url-parse@^1.4.3: - version "1.4.4" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.4.tgz#cac1556e95faa0303691fec5cf9d5a1bc34648f8" - integrity sha512-/92DTTorg4JjktLNLe6GPS2/RvAd/RGr6LuktmWSMLEOa6rjnlrFXNgSbSmkNvCoL2T028A0a1JaJLzRMlFoHg== - dependencies: - querystringify "^2.0.0" - requires-port "^1.0.0" - -url-parse@^1.4.7: +url-parse@^1.4.3, url-parse@^1.4.7: version "1.5.1" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.1.tgz#d5fa9890af8a5e1f274a2c98376510f6425f6e3b" integrity sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q== @@ -13407,7 +13277,7 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@1.3.1, which@^1.2.10, which@^1.2.14, which@^1.2.9: +which@1.3.1, which@^1.2.14, which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -13621,14 +13491,6 @@ wrap-ansi@^2.0.0: string-width "^1.0.1" strip-ansi "^3.0.1" -wrap-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" - integrity sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" @@ -13647,6 +13509,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -13747,6 +13618,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yaml@^1.10.0: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + yargs-parser@13.1.2, yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" @@ -13862,15 +13738,3 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -yup@^0.26.10: - version "0.26.10" - resolved "https://registry.yarnpkg.com/yup/-/yup-0.26.10.tgz#3545839663289038faf25facfc07e11fd67c0cb1" - integrity sha512-keuNEbNSnsOTOuGCt3UJW69jDE3O4P+UHAakO7vSeFMnjaitcmlbij/a3oNb9g1Y1KvSKH/7O1R2PQ4m4TRylw== - dependencies: - "@babel/runtime" "7.0.0" - fn-name "~2.0.1" - lodash "^4.17.10" - property-expr "^1.5.0" - synchronous-promise "^2.0.5" - toposort "^2.0.2" From 4b796b49297d6304845800136e2ec77aa3d8667d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Sat, 8 May 2021 00:08:57 +0200 Subject: [PATCH 018/117] Add supervisor_ingress support to my (#9087) --- hassio/src/hassio-my-redirect.ts | 6 ++++ hassio/src/hassio-router.ts | 3 +- .../src/ingress-view/hassio-ingress-view.ts | 33 +++++++++++++++++++ src/translations/en.json | 3 +- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/hassio/src/hassio-my-redirect.ts b/hassio/src/hassio-my-redirect.ts index 0e73adc529..76fed4cd68 100644 --- a/hassio/src/hassio-my-redirect.ts +++ b/hassio/src/hassio-my-redirect.ts @@ -43,6 +43,12 @@ const REDIRECTS: Redirects = { addon: "string", }, }, + supervisor_ingress: { + redirect: "/hassio/ingress", + params: { + addon: "string", + }, + }, supervisor_add_addon_repository: { redirect: "/hassio/store", params: { diff --git a/hassio/src/hassio-router.ts b/hassio/src/hassio-router.ts index 4e71ca7ca6..2662bfa357 100644 --- a/hassio/src/hassio-router.ts +++ b/hassio/src/hassio-router.ts @@ -61,11 +61,10 @@ class HassioRouter extends HassRouterPage { el.hass = this.hass; el.narrow = this.narrow; el.route = route; + el.supervisor = this.supervisor; if (el.localName === "hassio-ingress-view") { el.ingressPanel = this.panel.config && this.panel.config.ingress; - } else { - el.supervisor = this.supervisor; } } diff --git a/hassio/src/ingress-view/hassio-ingress-view.ts b/hassio/src/ingress-view/hassio-ingress-view.ts index bbdde5c053..54942ca950 100644 --- a/hassio/src/ingress-view/hassio-ingress-view.ts +++ b/hassio/src/ingress-view/hassio-ingress-view.ts @@ -12,14 +12,17 @@ import { } from "lit-element"; import { fireEvent } from "../../../src/common/dom/fire_event"; import { navigate } from "../../../src/common/navigate"; +import { extractSearchParam } from "../../../src/common/url/search-params"; import { fetchHassioAddonInfo, HassioAddonDetails, } from "../../../src/data/hassio/addon"; +import { extractApiErrorMessage } from "../../../src/data/hassio/common"; import { createHassioSession, validateHassioSession, } from "../../../src/data/hassio/ingress"; +import { Supervisor } from "../../../src/data/supervisor/supervisor"; import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box"; import "../../../src/layouts/hass-loading-screen"; import "../../../src/layouts/hass-subpage"; @@ -29,6 +32,8 @@ import { HomeAssistant, Route } from "../../../src/types"; class HassioIngressView extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; + @property({ attribute: false }) public supervisor!: Supervisor; + @property() public route!: Route; @property() public ingressPanel = false; @@ -80,6 +85,34 @@ class HassioIngressView extends LitElement { : iframe}`; } + protected async firstUpdated(): Promise { + if (this.route.path === "") { + const requestedAddon = extractSearchParam("addon"); + let addonInfo: HassioAddonDetails; + if (requestedAddon) { + try { + addonInfo = await fetchHassioAddonInfo(this.hass, requestedAddon); + } catch (err) { + await showAlertDialog(this, { + text: extractApiErrorMessage(err), + title: requestedAddon, + }); + history.back(); + return; + } + if (!addonInfo.ingress) { + await showAlertDialog(this, { + text: this.supervisor.localize("my.error_addon_no_ingress"), + title: addonInfo.name, + }); + history.back(); + } else { + navigate(this, `/hassio/ingress/${addonInfo.slug}`, true); + } + } + } + } + protected updated(changedProps: PropertyValues) { super.updated(changedProps); diff --git a/src/translations/en.json b/src/translations/en.json index ff075ced07..ba76e41b0c 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -3786,7 +3786,8 @@ "not_supported": "[%key:ui::panel::my::not_supported%]", "faq_link": "[%key:ui::panel::my::faq_link%]", "error": "[%key:ui::panel::my::error%]", - "error_addon_not_found": "Add-on not found" + "error_addon_not_found": "Add-on not found", + "error_addon_no_ingress": "The requested add-on does not support ingress" }, "system": { "log": { From 38b3a9205d9603839cc6c7ff40a2a582b4311b11 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 8 May 2021 01:42:37 +0000 Subject: [PATCH 019/117] Translation update --- translations/frontend/ca.json | 1 + translations/frontend/de.json | 1 + translations/frontend/en.json | 1 + translations/frontend/pl.json | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/translations/frontend/ca.json b/translations/frontend/ca.json index efa1660a2d..eae930bf23 100644 --- a/translations/frontend/ca.json +++ b/translations/frontend/ca.json @@ -366,6 +366,7 @@ }, "my": { "error": "S'ha produït un error desconegut", + "error_addon_no_ingress": "El complement sol·licitat no admet ingress", "error_addon_not_found": "No s'ha trobat el complement", "faq_link": "Preguntes freqüents de My Home Assistant", "not_supported": "La instància de Home Assistant no admet aquesta redirecció. Consulta {link} per veure les redireccions compatibles i en quina versió es van introduir." diff --git a/translations/frontend/de.json b/translations/frontend/de.json index d6b8f7e69e..571c05c3e6 100644 --- a/translations/frontend/de.json +++ b/translations/frontend/de.json @@ -2246,6 +2246,7 @@ }, "finish": "Fertig", "loading_first_time": "Bitte warten, während die Integration installiert wird", + "next": "Weiter", "not_all_required_fields": "Nicht alle Pflichtfelder sind ausgefüllt.", "not_loaded": "Die Integration konnte nicht geladen werden. Versuche Home Assistant neu zu starten.", "pick_flow_step": { diff --git a/translations/frontend/en.json b/translations/frontend/en.json index 0ac8bcae0e..20fc12f4da 100644 --- a/translations/frontend/en.json +++ b/translations/frontend/en.json @@ -366,6 +366,7 @@ }, "my": { "error": "An unknown error occurred", + "error_addon_no_ingress": "The requested add-on does not support ingress", "error_addon_not_found": "Add-on not found", "faq_link": "My Home Assistant FAQ", "not_supported": "This redirect is not supported by your Home Assistant instance. Check the {link} for the supported redirects and the version they where introduced." diff --git a/translations/frontend/pl.json b/translations/frontend/pl.json index 73772a82f7..d92661fa47 100644 --- a/translations/frontend/pl.json +++ b/translations/frontend/pl.json @@ -2952,7 +2952,7 @@ }, "logs": { "log_level": "Poziom loga", - "subscribed_to_logs": "Zasubskrybowano komunikaty dziennika Z-Wave JS ...", + "subscribed_to_logs": "Zasubskrybowano komunikaty dziennika Z-Wave JS...", "title": "Logi Z-Wave JS" }, "navigation": { From 6edebe18ad25b8482522f35a3c25c36fc684a4ea Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 8 May 2021 04:07:58 -0700 Subject: [PATCH 020/117] Use grid for sensor cards on 2nd view of teaching birds demo (#9132) --- demo/src/configs/teachingbirds/lovelace.ts | 72 +++++++++------------- 1 file changed, 29 insertions(+), 43 deletions(-) diff --git a/demo/src/configs/teachingbirds/lovelace.ts b/demo/src/configs/teachingbirds/lovelace.ts index 943231353a..9fbf612023 100644 --- a/demo/src/configs/teachingbirds/lovelace.ts +++ b/demo/src/configs/teachingbirds/lovelace.ts @@ -440,57 +440,43 @@ export const demoLovelaceTeachingbirds: DemoConfig["lovelace"] = () => ({ type: "horizontal-stack", }, { + type: "grid", + columns: 2, cards: [ { - cards: [ - { - graph: "line", - type: "sensor", - entity: "sensor.temperature_bedroom", - }, - { - graph: "line", - type: "sensor", - name: "S's room", - entity: "sensor.temperature_stefan", - }, - ], - type: "horizontal-stack", + graph: "line", + type: "sensor", + entity: "sensor.temperature_bedroom", }, { - cards: [ - { - graph: "line", - type: "sensor", - entity: "sensor.temperature_passage", - }, - { - graph: "line", - type: "sensor", - name: "Bathroom", - entity: "sensor.temperature_downstairs_bathroom", - }, - ], - type: "horizontal-stack", + graph: "line", + type: "sensor", + name: "S's room", + entity: "sensor.temperature_stefan", }, { - cards: [ - { - graph: "line", - type: "sensor", - entity: "sensor.temperature_storage", - }, - { - graph: "line", - type: "sensor", - name: "Refrigerator", - entity: "sensor.refrigerator", - }, - ], - type: "horizontal-stack", + graph: "line", + type: "sensor", + entity: "sensor.temperature_passage", + }, + { + graph: "line", + type: "sensor", + name: "Bathroom", + entity: "sensor.temperature_downstairs_bathroom", + }, + { + graph: "line", + type: "sensor", + entity: "sensor.temperature_storage", + }, + { + graph: "line", + type: "sensor", + name: "Refrigerator", + entity: "sensor.refrigerator", }, ], - type: "vertical-stack", }, { entities: [ From 88dc65bc4e6a73e06f9e541740de50c493a0a619 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Sat, 8 May 2021 13:08:28 +0200 Subject: [PATCH 021/117] Dont require manifest for the overflow menu (#9129) --- .../integrations/ha-integration-card.ts | 137 +++++++++--------- 1 file changed, 65 insertions(+), 72 deletions(-) diff --git a/src/panels/config/integrations/ha-integration-card.ts b/src/panels/config/integrations/ha-integration-card.ts index e35512b06f..615e359862 100644 --- a/src/panels/config/integrations/ha-integration-card.ts +++ b/src/panels/config/integrations/ha-integration-card.ts @@ -300,80 +300,73 @@ export class HaIntegrationCard extends LitElement { ` : ""}
- ${!this.manifest - ? "" - : html` - - - - - + + + + + + ${this.hass.localize( + "ui.panel.config.integrations.config_entry.rename" + )} + + + ${this.hass.localize( + "ui.panel.config.integrations.config_entry.system_options" + )} + + ${this.manifest + ? html`
+ ${this.hass.localize( - "ui.panel.config.integrations.config_entry.rename" - )} + "ui.panel.config.integrations.config_entry.documentation" + )} - - ${this.hass.localize( - "ui.panel.config.integrations.config_entry.system_options" - )} - - - - - ${this.hass.localize( - "ui.panel.config.integrations.config_entry.documentation" - )} - - - ${!item.disabled_by && - item.state === "loaded" && - item.supports_unload && - item.source !== "system" - ? html` - ${this.hass.localize( - "ui.panel.config.integrations.config_entry.reload" - )} - ` - : ""} - ${item.disabled_by === "user" - ? html` - ${this.hass.localize("ui.common.enable")} - ` - : item.source !== "system" - ? html` - ${this.hass.localize("ui.common.disable")} - ` - : ""} - ${item.source !== "system" - ? html` - ${this.hass.localize( - "ui.panel.config.integrations.config_entry.delete" - )} - ` - : ""} - - `} + ` + : ""} + ${!item.disabled_by && + item.state === "loaded" && + item.supports_unload && + item.source !== "system" + ? html` + ${this.hass.localize( + "ui.panel.config.integrations.config_entry.reload" + )} + ` + : ""} + ${item.disabled_by === "user" + ? html` + ${this.hass.localize("ui.common.enable")} + ` + : item.source !== "system" + ? html` + ${this.hass.localize("ui.common.disable")} + ` + : ""} + ${item.source !== "system" + ? html` + ${this.hass.localize( + "ui.panel.config.integrations.config_entry.delete" + )} + ` + : ""} +
`; } From 7f49f039fdc3c226b399bc9164c67c48e82b1587 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 8 May 2021 04:53:07 -0700 Subject: [PATCH 022/117] Close new automation dialog before moving to next step (#9071) * Close new automatin dialog before next step * Update dialog-thingtalk.ts * Fix Co-authored-by: Bram Kragten --- src/components/ha-blueprint-picker.ts | 4 +-- src/dialogs/make-dialog-manager.ts | 2 +- .../automation/dialog-new-automation.ts | 27 ++++++++++++------- .../automation/thingtalk/dialog-thingtalk.ts | 24 +++++++++-------- 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/src/components/ha-blueprint-picker.ts b/src/components/ha-blueprint-picker.ts index 95e1318647..276298c6c3 100644 --- a/src/components/ha-blueprint-picker.ts +++ b/src/components/ha-blueprint-picker.ts @@ -108,11 +108,9 @@ class HaBluePrintPicker extends LitElement { min-width: 200px; display: block; } - paper-listbox { - min-width: 200px; - } paper-item { cursor: pointer; + min-width: 200px; } `; } diff --git a/src/dialogs/make-dialog-manager.ts b/src/dialogs/make-dialog-manager.ts index bc32b08050..eada7af6eb 100644 --- a/src/dialogs/make-dialog-manager.ts +++ b/src/dialogs/make-dialog-manager.ts @@ -97,7 +97,7 @@ export const closeDialog = async (dialogTag: string): Promise => { if (!(dialogTag in LOADED)) { return true; } - const dialogElement = await LOADED[dialogTag]; + const dialogElement: HassDialog = await LOADED[dialogTag]; if (dialogElement.closeDialog) { return dialogElement.closeDialog() !== false; } diff --git a/src/panels/config/automation/dialog-new-automation.ts b/src/panels/config/automation/dialog-new-automation.ts index 35932dab35..bf854c2bce 100644 --- a/src/panels/config/automation/dialog-new-automation.ts +++ b/src/panels/config/automation/dialog-new-automation.ts @@ -11,20 +11,25 @@ import { } from "lit-element"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { fireEvent } from "../../../common/dom/fire_event"; +import { nextRender } from "../../../common/util/render-status"; import "../../../components/ha-blueprint-picker"; import "../../../components/ha-card"; import "../../../components/ha-circular-progress"; -import "../../../components/ha-dialog"; +import { createCloseHeading } from "../../../components/ha-dialog"; import { AutomationConfig, showAutomationEditor, } from "../../../data/automation"; +import { + HassDialog, + replaceDialog, +} from "../../../dialogs/make-dialog-manager"; import { haStyle, haStyleDialog } from "../../../resources/styles"; import type { HomeAssistant } from "../../../types"; import { showThingtalkDialog } from "./thingtalk/show-dialog-thingtalk"; @customElement("ha-dialog-new-automation") -class DialogNewAutomation extends LitElement { +class DialogNewAutomation extends LitElement implements HassDialog { @property({ attribute: false }) public hass!: HomeAssistant; @state() private _opened = false; @@ -46,8 +51,9 @@ class DialogNewAutomation extends LitElement {
@@ -107,22 +113,25 @@ class DialogNewAutomation extends LitElement { } private _thingTalk() { - this.closeDialog(); + replaceDialog(); showThingtalkDialog(this, { callback: (config: Partial | undefined) => showAutomationEditor(this, config), input: this.shadowRoot!.querySelector("paper-input")!.value as string, }); + this.closeDialog(); } - private _blueprintPicked(ev: CustomEvent) { + private async _blueprintPicked(ev: CustomEvent) { + this.closeDialog(); + await nextRender(); showAutomationEditor(this, { use_blueprint: { path: ev.detail.value } }); - this.closeDialog(); } - private _blank() { - showAutomationEditor(this); + private async _blank() { this.closeDialog(); + await nextRender(); + showAutomationEditor(this); } static get styles(): CSSResultGroup { diff --git a/src/panels/config/automation/thingtalk/dialog-thingtalk.ts b/src/panels/config/automation/thingtalk/dialog-thingtalk.ts index 663b6a552e..04d43a0b7c 100644 --- a/src/panels/config/automation/thingtalk/dialog-thingtalk.ts +++ b/src/panels/config/automation/thingtalk/dialog-thingtalk.ts @@ -13,6 +13,7 @@ import { query, TemplateResult, } from "lit-element"; +import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/dialog/ha-paper-dialog"; import "../../../../components/ha-circular-progress"; import type { AutomationConfig } from "../../../../data/automation"; @@ -67,6 +68,15 @@ class DialogThingtalk extends LitElement { } } + public closeDialog() { + this._placeholders = undefined; + if (this._input) { + this._input.value = null; + } + this._opened = false; + fireEvent(this, "dialog-closed", { dialog: this.localName }); + } + protected render(): TemplateResult { if (!this._params) { return html``; @@ -225,25 +235,17 @@ class DialogThingtalk extends LitElement { private _sendConfig(input, config) { this._params!.callback({ alias: input, ...config }); - this._closeDialog(); + this.closeDialog(); } private _skip() { this._params!.callback(undefined); - this._closeDialog(); - } - - private _closeDialog() { - this._placeholders = undefined; - if (this._input) { - this._input.value = null; - } - this._opened = false; + this.closeDialog(); } private _openedChanged(ev: PolymerChangedEvent): void { if (!ev.detail.value) { - this._closeDialog(); + this.closeDialog(); } } From 4f449e2600d3adfd5636dbafe22c25b991d2252a Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Sat, 8 May 2021 17:30:31 +0200 Subject: [PATCH 023/117] Adjust token relative_date wording (#9138) --- src/translations/en.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/translations/en.json b/src/translations/en.json index ba76e41b0c..548787b150 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -3261,8 +3261,8 @@ "header": "Refresh Tokens", "description": "Each refresh token represents a login session. Refresh tokens will be automatically removed when you click log out. The following refresh tokens are currently active for your account.", "token_title": "Refresh token for {clientId}", - "created_at": "Created at {date}", - "last_used": "Last used at {date} from {location}", + "created_at": "Created {date}", + "last_used": "Last used {date} from {location}", "not_used": "Has never been used", "confirm_delete": "Are you sure you want to delete the refresh token for {name}?", "delete_failed": "Failed to delete the refresh token.", From 12612a16df5460a948b7abb05c999bfc36cbb651 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 9 May 2021 01:44:02 +0000 Subject: [PATCH 024/117] Translation update --- translations/frontend/ca.json | 2 +- translations/frontend/cs.json | 4 ++-- translations/frontend/en.json | 4 ++-- translations/frontend/es.json | 1 + translations/frontend/et.json | 1 + translations/frontend/fr.json | 3 ++- translations/frontend/it.json | 3 ++- translations/frontend/ru.json | 1 + 8 files changed, 12 insertions(+), 7 deletions(-) diff --git a/translations/frontend/ca.json b/translations/frontend/ca.json index eae930bf23..a9129c209a 100644 --- a/translations/frontend/ca.json +++ b/translations/frontend/ca.json @@ -3975,7 +3975,7 @@ }, "refresh_tokens": { "confirm_delete": "Estàs segur que vols eliminar el token d'actualització per a {name}?", - "created_at": "Creat el {date}", + "created_at": "Creat {date}", "current_token_tooltip": "No s'ha pogut eliminar el token d'autenticació d'actualització.", "delete_failed": "No s'ha pogut eliminar el token d'autenticació d'actualització.", "description": "Cada token d'autenticació d'actualització representa un inici de sessió diferent. Els tokens d'autenticació d'actualització s'eliminaran automàticament quan tanquis la sessió. A sota hi ha una llista de tokens d'autenticació d'actualització que estan actius actualment al teu compte.", diff --git a/translations/frontend/cs.json b/translations/frontend/cs.json index 06d28ece51..eed55146f5 100644 --- a/translations/frontend/cs.json +++ b/translations/frontend/cs.json @@ -3826,7 +3826,7 @@ "required_fields": "Vyplňte všechna povinná pole" }, "intro": "Začněme tím, že vytvoříme uživatelský účet.", - "required_field": "Povinný" + "required_field": "Povinné" } }, "profile": { @@ -3840,7 +3840,7 @@ "current_password": "Současné heslo", "error_new_is_old": "Nové heslo se musí lišit od aktuálního hesla", "error_new_mismatch": "Zadaná nová hesla se neshodují", - "error_required": "Povinný", + "error_required": "Povinné", "header": "Změnit heslo", "new_password": "Nové heslo", "submit": "Odeslat", diff --git a/translations/frontend/en.json b/translations/frontend/en.json index 20fc12f4da..6ffd4b5476 100644 --- a/translations/frontend/en.json +++ b/translations/frontend/en.json @@ -3975,12 +3975,12 @@ }, "refresh_tokens": { "confirm_delete": "Are you sure you want to delete the refresh token for {name}?", - "created_at": "Created at {date}", + "created_at": "Created {date}", "current_token_tooltip": "Unable to delete current refresh token", "delete_failed": "Failed to delete the refresh token.", "description": "Each refresh token represents a login session. Refresh tokens will be automatically removed when you click log out. The following refresh tokens are currently active for your account.", "header": "Refresh Tokens", - "last_used": "Last used at {date} from {location}", + "last_used": "Last used {date} from {location}", "not_used": "Has never been used", "token_title": "Refresh token for {clientId}" }, diff --git a/translations/frontend/es.json b/translations/frontend/es.json index 3133ee0b76..44f190494c 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -366,6 +366,7 @@ }, "my": { "error": "Se ha producido un error desconocido", + "error_addon_no_ingress": "El complemento solicitado no admite la entrada", "error_addon_not_found": "Complemento no encontrado", "faq_link": "Preguntas frecuentes sobre mi Home Assistant", "not_supported": "Esta redirección no es compatible con tu instancia de Home Assistant. Consulta el {link} para conocer las redirecciones admitidas y la versión en la que se introdujeron." diff --git a/translations/frontend/et.json b/translations/frontend/et.json index 7692516d72..d9d0f46d4a 100644 --- a/translations/frontend/et.json +++ b/translations/frontend/et.json @@ -366,6 +366,7 @@ }, "my": { "error": "Viga", + "error_addon_no_ingress": "Valitud lisandmoodul ei toeta ingressi", "error_addon_not_found": "Lisandmoodulit ei leitud", "faq_link": "KKK viide", "not_supported": "pole toetatud" diff --git a/translations/frontend/fr.json b/translations/frontend/fr.json index 869189cb50..a22c8db759 100644 --- a/translations/frontend/fr.json +++ b/translations/frontend/fr.json @@ -366,6 +366,7 @@ }, "my": { "error": "Une erreur inconnue s'est produite", + "error_addon_no_ingress": "L’add-on demandé ne prend pas en charge l’entrée", "error_addon_not_found": "Module complémentaire introuvable", "faq_link": "FAQ de My Home Assistant", "not_supported": "Cette redirection n'est pas prise en charge par votre instance Home Assistant. Vérifiez le {link} pour les redirections prises en charge et la version dans laquelle elles ont été introduites." @@ -2212,7 +2213,7 @@ "logs": "journaux", "manuf": "par {manufacturer}", "no_area": "Pas de zone", - "not_loaded": "Non chargé, vérifiez le {logs_link}", + "not_loaded": "Non chargé", "options": "Options", "provided_by_custom_integration": "Fourni par une intégration personnalisée", "reload": "Recharger", diff --git a/translations/frontend/it.json b/translations/frontend/it.json index 6d53d8b968..b074a2cc8f 100644 --- a/translations/frontend/it.json +++ b/translations/frontend/it.json @@ -366,6 +366,7 @@ }, "my": { "error": "Si è verificato un errore sconosciuto", + "error_addon_no_ingress": "Il componente aggiuntivo richiesto non supporta l'ingresso", "error_addon_not_found": "Componente aggiuntivo non trovato", "faq_link": "My Home Assistant FAQ", "not_supported": "Questo reindirizzamento non è supportato dall'istanza di Home Assistant. Controlla il {link} per i reindirizzamenti supportati e la versione in cui sono stati introdotti." @@ -3979,7 +3980,7 @@ "delete_failed": "Impossibile eliminare il token di aggiornamento.", "description": "Ogni token di aggiornamento rappresenta una sessione di accesso. I token di aggiornamento verranno rimossi automaticamente quando si fa clic su Disconnetti. I seguenti token di aggiornamento sono attualmente attivi per il tuo account.", "header": "Token di aggiornamento", - "last_used": "Utilizzato l'ultima volta il {date} da {location}", + "last_used": "Ultimo utilizzo del {date} da {location}", "not_used": "Non è mai stato usato", "token_title": "Token di aggiornamento per {clientId}" }, diff --git a/translations/frontend/ru.json b/translations/frontend/ru.json index c2ad66a3de..2e99ad93c1 100644 --- a/translations/frontend/ru.json +++ b/translations/frontend/ru.json @@ -366,6 +366,7 @@ }, "my": { "error": "Произошла неизвестная ошибка", + "error_addon_no_ingress": "Дополнение не поддерживает ingress.", "error_addon_not_found": "Дополнение не найдено.", "faq_link": "часто задаваемыми вопросами по My Home Assistant", "not_supported": "Это перенаправление не поддерживается Вашим Home Assistant. Ознакомьтесь с {link}, чтобы узнать поддерживаемые перенаправления и версии, в которых они были добавлены." From 15ee87ee67c29638521216d99c58d1f46ccc13fd Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 10 May 2021 01:45:53 +0000 Subject: [PATCH 025/117] Translation update --- translations/frontend/da.json | 40 +++++++++++++++++++++++++++++- translations/frontend/es.json | 4 +-- translations/frontend/it.json | 2 +- translations/frontend/nl.json | 1 + translations/frontend/zh-Hans.json | 1 + translations/frontend/zh-Hant.json | 1 + 6 files changed, 45 insertions(+), 4 deletions(-) diff --git a/translations/frontend/da.json b/translations/frontend/da.json index 2237a6af24..4cee64b9c9 100644 --- a/translations/frontend/da.json +++ b/translations/frontend/da.json @@ -560,6 +560,8 @@ }, "light": { "brightness": "Lysstyrke", + "cold_white_value": "kold hvid lysstyrke", + "color_brightness": "Farvetemperatur", "color_temperature": "Farvetemperatur", "effect": "Effekt", "white_value": "Hvidværdi" @@ -1182,6 +1184,22 @@ "zha_device_card": { "device_name_placeholder": "Skift enhedsnavn" } + }, + "zha_reconfigure_device": { + "attribute": "Attribut", + "battery_device_warning": "Du er nødt til at tænde for batteridrevne enheder før du stater konfigurationen. Læs mere i manualen til din enhed for at få mere information", + "bind_header": "Binding", + "button_hide": "Skjul detaljer", + "button_show": "Vis detaljer", + "configuration_complete": "Konfiguration af enheden er færdig", + "configuration_failed": "konfuguration af enheden fejlede. Yderligere information kam findes i logfilerne ", + "configuring_alt": "Konfigurerer", + "in_progress": "Enheden rekonfigureres. Dette kan tage noget tid", + "introduction": "Konfigurer en enhed på dit Zigbee netværk. Brug denne mulighed hvos din enhed ikke virker korrekt", + "min_max_change": "Min/maks/ændre", + "reporting_header": "Rapportering", + "run_in_background": "Du kan lukke denne dialogboks.Konfigurationen fortsætter i baggrunden", + "start_reconfiguration": "Start konfiguration" } }, "duration": { @@ -1234,7 +1252,8 @@ "caption": "Områder", "data_table": { "area": "Område", - "devices": "Enheder" + "devices": "Enheder", + "entities": "Entiteter" }, "delete": { "confirmation_text": "Alle enheder i dette område vil blive utildelte.", @@ -1246,8 +1265,10 @@ "create": "Opret", "default_name": "Nyt område", "delete": "Slet", + "linked_entities_caption": "Entiteter", "name": "Navn", "name_required": "Navn er påkrævet", + "no_linked_entities": "Der er ingen entiteter forbundet til dette område", "unknown_error": "Ukendt fejl", "update": "Opdater" }, @@ -1700,10 +1721,16 @@ "remote": { "access_is_being_prepared": "Fjernadgang forberedes. Vi giver dig besked, når den er klar.", "certificate_info": "Certifikatoplysninger", + "connected": "Tilsluttet", "info": "Home Assistant Cloud leverer en sikker fjernforbindelse til din instans, når du er væk fra hjemmet.", "instance_is_available": "Din instans er tilgængelig på", "instance_will_be_available": "Din instans vil være tilgængelig på", "link_learn_how_it_works": "Lær hvordan det fungerer", + "not_connected": "Ikke tilsluttet", + "remote_enabled": { + "caption": "Forbind automatisk", + "description": "Slå denne indstilling til for at sikre din Home Assistant applikation er tilgængelig udefra " + }, "title": "Fjernadgang" }, "sign_out": "Log ud", @@ -2081,6 +2108,7 @@ "license": "Udgivet under Apache 2.0-licensen", "path_configuration": "Sti til 'configuration.yaml': {path}", "server": "server", + "setup_time": "Opsætningstid", "source": "Kilde:", "system_health_error": "System Health-komponenten er ikke indlæst. Føj 'system_health:' til 'config.yaml'", "system_health": { @@ -2146,6 +2174,7 @@ }, "finish": "Afslut", "loading_first_time": "Vent mens integrationen installeres", + "next": "Næste", "not_all_required_fields": "Ikke alle påkrævede felter er udfyldt.", "pick_flow_step": { "new_flow": "Nej, konfigurer en anden forekomst af {integration}", @@ -2830,6 +2859,10 @@ "node_status": "Nodestatus", "zwave_info": "Z-Wave-info" }, + "logs": { + "log_level": "Log niveau", + "subscribed_to_logs": "Abboner på Z-Wave JS Log beskeder" + }, "navigation": { "network": "Netværk" }, @@ -2845,6 +2878,8 @@ "header": "Konfiguration af Z-Wave-enhed", "introduction": "Administrer og juster enheds (node) specifikke konfigurationsparametre for den valgte enhed", "parameter_is_read_only": "Denne parameter er skrivebeskyttet.", + "set_param_error": "Der opstod en fejl", + "set_param_queued": "Parameterændringen er sat i kø, og vil blive udført når enheden vågner", "zwave_js_device_database": "Z-Wave JS-enhedsdatabasen" }, "node_status": { @@ -2854,6 +2889,9 @@ "dead": "Død", "unknown": "Ukendt" }, + "reinterview_node": { + "interview_complete": "Enhedsinformationsudveksling er færdig" + }, "remove_node": { "cancel_exclusion": "Annuller udelukkelse", "controller_in_exclusion_mode": "Din Z-Wave-controller er nu i eksklusionstilstand.", diff --git a/translations/frontend/es.json b/translations/frontend/es.json index 44f190494c..44748ca611 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -3975,12 +3975,12 @@ }, "refresh_tokens": { "confirm_delete": "¿Estás seguro de que quieres eliminar el token de actualización para {name}?", - "created_at": "Creado el {date}", + "created_at": "Creado {date}", "current_token_tooltip": "No se puede eliminar el token actual", "delete_failed": "Error al eliminar el token de acceso.", "description": "Cada token de actualización representa un acceso de sesión. Los tokens de actualización se eliminarán automáticamente al cerrar la sesión. Los siguientes tokens de actualización están actualmente activos para tu cuenta.", "header": "Actualizar tokens", - "last_used": "Último uso el {date} desde {location}", + "last_used": "Último uso {date} desde {location}", "not_used": "Nunca ha sido usado", "token_title": "Actualizar token para {clientId}" }, diff --git a/translations/frontend/it.json b/translations/frontend/it.json index b074a2cc8f..093717fff2 100644 --- a/translations/frontend/it.json +++ b/translations/frontend/it.json @@ -770,7 +770,7 @@ "by_service": "dal servizio", "entries_not_found": "Non sono state trovate voci nel registro.", "messages": { - "became_unavailable": "non è più disponibile", + "became_unavailable": "è diventato non disponibile", "changed_to_state": "cambiato in {state}", "cleared_device_class": "sgombro (nessun {device_class} rilevato)", "detected_device_class": "rilevato {device_class}", diff --git a/translations/frontend/nl.json b/translations/frontend/nl.json index 008084c6a1..90f29b2cdd 100644 --- a/translations/frontend/nl.json +++ b/translations/frontend/nl.json @@ -366,6 +366,7 @@ }, "my": { "error": "Er is een onbekende fout opgetreden", + "error_addon_no_ingress": "De gevraagde add-on ondersteunt geen ingress", "error_addon_not_found": "Invoegtoepassing niet gevonden", "faq_link": "My Home Assistant FAQ", "not_supported": "Deze redirect wordt niet ondersteund door uw Home Assistant instantie. Controleer de {link} voor de ondersteunde redirects en de versie waarin ze zijn geïntroduceerd." diff --git a/translations/frontend/zh-Hans.json b/translations/frontend/zh-Hans.json index 725df39ce1..edafb51850 100644 --- a/translations/frontend/zh-Hans.json +++ b/translations/frontend/zh-Hans.json @@ -366,6 +366,7 @@ }, "my": { "error": "发生未知错误", + "error_addon_no_ingress": "请求的加载项不支持 ingress", "error_addon_not_found": "未找到加载项", "faq_link": "我的 Home Assistant 常见问题", "not_supported": "您的 Home Assistant 不支持此重定向。请查阅{link}以获取受支持的重定向及其引入的版本。" diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index 5785148cb3..66b7ed8961 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -366,6 +366,7 @@ }, "my": { "error": "發生未知錯誤", + "error_addon_no_ingress": "所要求的附加元件不支援 ingress", "error_addon_not_found": "找不到附加元件", "faq_link": "Home Assistant 常見問答集", "not_supported": "Home Assistant 不支援此重新導向。點選 {link} 獲取支援之重新導向與版本。" From 0a8e27249dc6fda94f2eca03e77b4e474a0fe541 Mon Sep 17 00:00:00 2001 From: uvjustin <46082645+uvjustin@users.noreply.github.com> Date: Mon, 10 May 2021 17:06:16 +0800 Subject: [PATCH 026/117] Bump hls.js from v1.0.1 to v1.0.3 (#9147) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9d3e64db6e..3282243d5a 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "fecha": "^4.2.0", "fuse.js": "^6.0.0", "google-timezones-json": "^1.0.2", - "hls.js": "^1.0.1", + "hls.js": "^1.0.3", "home-assistant-js-websocket": "^5.9.0", "idb-keyval": "^3.2.0", "intl-messageformat": "^8.3.9", diff --git a/yarn.lock b/yarn.lock index a2c1c90dae..55477caf3a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7430,10 +7430,10 @@ he@1.2.0, he@^1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -hls.js@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-1.0.1.tgz#d92bd0a9c78760f0f0e90d53c60192800ebc629f" - integrity sha512-ElPUW9VMY2uXdX07N872BSrVUcVd4jZGav4nqlY3vinpdMpW8esmdpUaeVA5vv3oIRSmiC/XtL9K+mSt6rlBpA== +hls.js@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-1.0.3.tgz#856aef94108f99772632343994725a9165ef66f6" + integrity sha512-9pNhXI6dTO5rLfdcroj+p8kRGjkDeDtVJsVvCuj3KpyROTA2D0h0sFwBbvXC5h5nbXxvjMf+w6jTeBGYyfjcjQ== hmac-drbg@^1.0.1: version "1.0.1" From 785f614bd9ff2aded7463578c5bcc4c44db12281 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 May 2021 16:12:38 +0200 Subject: [PATCH 027/117] Bump lodash from 4.17.15 to 4.17.21 (#9154) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 55477caf3a..960c7942c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8949,16 +8949,11 @@ lodash.values@~2.4.1: dependencies: lodash.keys "~2.4.1" -lodash@^4.17.11, lodash@^4.17.20, lodash@^4.17.21: +lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -lodash@^4.17.14, lodash@^4.17.15: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== - log-symbols@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" From 6dc7e852ae72a5fda65d055444a4a2a591630a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Mon, 10 May 2021 18:17:16 +0200 Subject: [PATCH 028/117] Use hass-tabs-subpage-data-table for supervisor snapshots (#9103) * Use hass-tabs-subpage-data-table for supervisor snapshots * comments * type * cleanup * change translations * Update hassio/src/dialogs/snapshot/dialog-hassio-create-snapshot.ts Co-authored-by: Bram Kragten * reset * fix after rebase * internalProperty -> state Co-authored-by: Bram Kragten --- .../snapshot/dialog-hassio-create-snapshot.ts | 368 ++++++++++ .../snapshot/dialog-hassio-snapshot.ts | 21 +- .../show-dialog-hassio-create-snapshot.ts | 18 + hassio/src/snapshots/hassio-snapshots.ts | 483 ++++---------- src/components/data-table/ha-data-table.ts | 631 +++++++++--------- src/layouts/hass-tabs-subpage-data-table.ts | 4 + src/translations/en.json | 2 + 7 files changed, 840 insertions(+), 687 deletions(-) create mode 100755 hassio/src/dialogs/snapshot/dialog-hassio-create-snapshot.ts create mode 100644 hassio/src/dialogs/snapshot/show-dialog-hassio-create-snapshot.ts diff --git a/hassio/src/dialogs/snapshot/dialog-hassio-create-snapshot.ts b/hassio/src/dialogs/snapshot/dialog-hassio-create-snapshot.ts new file mode 100755 index 0000000000..b97354f9a0 --- /dev/null +++ b/hassio/src/dialogs/snapshot/dialog-hassio-create-snapshot.ts @@ -0,0 +1,368 @@ +import "@material/mwc-button"; +import "@polymer/paper-input/paper-input"; +import type { PaperInputElement } from "@polymer/paper-input/paper-input"; +import { + css, + CSSResult, + customElement, + html, + state, + LitElement, + property, + TemplateResult, +} from "lit-element"; +import { formatDate } from "../../../../src/common/datetime/format_date"; +import { fireEvent } from "../../../../src/common/dom/fire_event"; +import { compare } from "../../../../src/common/string/compare"; +import "../../../../src/components/buttons/ha-progress-button"; +import "../../../../src/components/ha-checkbox"; +import type { HaCheckbox } from "../../../../src/components/ha-checkbox"; +import { createCloseHeading } from "../../../../src/components/ha-dialog"; +import "../../../../src/components/ha-formfield"; +import "../../../../src/components/ha-radio"; +import type { HaRadio } from "../../../../src/components/ha-radio"; +import "../../../../src/components/ha-settings-row"; +import { extractApiErrorMessage } from "../../../../src/data/hassio/common"; +import { + createHassioFullSnapshot, + createHassioPartialSnapshot, + HassioFullSnapshotCreateParams, + HassioPartialSnapshotCreateParams, + HassioSnapshot, +} from "../../../../src/data/hassio/snapshot"; +import { showAlertDialog } from "../../../../src/dialogs/generic/show-dialog-box"; +import { PolymerChangedEvent } from "../../../../src/polymer-types"; +import { haStyle, haStyleDialog } from "../../../../src/resources/styles"; +import { HomeAssistant } from "../../../../src/types"; +import { HassioCreateSnapshotDialogParams } from "./show-dialog-hassio-create-snapshot"; + +interface CheckboxItem { + slug: string; + checked: boolean; + name?: string; + version?: string; +} + +const folderList = () => [ + { + slug: "homeassistant", + checked: true, + }, + { slug: "ssl", checked: true }, + { slug: "share", checked: true }, + { slug: "media", checked: true }, + { slug: "addons/local", checked: true }, +]; + +@customElement("dialog-hassio-create-snapshot") +class HassioCreateSnapshotDialog extends LitElement { + @property({ attribute: false }) public hass!: HomeAssistant; + + @state() private _snapshotName = ""; + + @state() private _snapshotPassword = ""; + + @state() private _snapshotHasPassword = false; + + @state() private _snapshotType: HassioSnapshot["type"] = "full"; + + @state() private _dialogParams?: HassioCreateSnapshotDialogParams; + + @state() private _addonList: CheckboxItem[] = []; + + @state() private _folderList: CheckboxItem[] = folderList(); + + @state() private _error = ""; + + public showDialog(params: HassioCreateSnapshotDialogParams) { + this._dialogParams = params; + this._addonList = this._dialogParams.supervisor.supervisor.addons + .map((addon) => ({ + slug: addon.slug, + name: addon.name, + version: addon.version, + checked: true, + })) + .sort((a, b) => compare(a.name, b.name)); + this._snapshotType = "full"; + this._error = ""; + this._folderList = folderList(); + this._snapshotHasPassword = false; + this._snapshotPassword = ""; + this._snapshotName = ""; + } + + public closeDialog() { + this._dialogParams = undefined; + fireEvent(this, "dialog-closed", { dialog: this.localName }); + } + + protected render(): TemplateResult { + if (!this._dialogParams) { + return html``; + } + return html` + + + +
+
+ ${this._dialogParams.supervisor.localize("snapshot.type")}: +
+ + + + + + + + +
+ + ${ + this._snapshotType === "full" + ? undefined + : html` + ${this._dialogParams.supervisor.localize("snapshot.folders")}: +
+ ${this._folderList.map( + (folder, idx) => html` +
+ + + + ${this._dialogParams!.supervisor.localize( + `snapshot.folder.${folder.slug}` + )} + +
+ ` + )} +
+ + ${this._dialogParams.supervisor.localize("snapshot.addons")}: +
+ ${this._addonList.map( + (addon, idx) => html` +
+ + + + ${addon.name} + (${addon.version}) + + +
+ ` + )} +
+ ` + } + ${this._dialogParams.supervisor.localize("snapshot.security")}: +
+
+ + + + ${this._dialogParams.supervisor.localize( + "snapshot.password_protection" + )} + + +
+
+ + ${ + this._snapshotHasPassword + ? html` + + + ` + : undefined + } + ${ + this._error !== "" + ? html`

${this._error}

` + : undefined + } + + ${this._dialogParams.supervisor.localize("common.close")} + + + ${this._dialogParams.supervisor.localize("snapshot.create")} + +
+ `; + } + + private _handleTextValueChanged(ev: PolymerChangedEvent) { + const input = ev.currentTarget as PaperInputElement; + this[`_${input.name}`] = ev.detail.value; + } + + private _handleCheckboxValueChanged(ev: CustomEvent) { + const input = ev.currentTarget as HaCheckbox; + this._snapshotHasPassword = input.checked; + } + + private _handleRadioValueChanged(ev: CustomEvent) { + const input = ev.currentTarget as HaRadio; + this[`_${input.name}`] = input.value; + } + + private _folderChecked(ev) { + const { idx, checked } = ev.currentTarget!; + this._folderList = this._folderList.map((folder, curIdx) => + curIdx === idx ? { ...folder, checked } : folder + ); + } + + private _addonChecked(ev) { + const { idx, checked } = ev.currentTarget!; + this._addonList = this._addonList.map((addon, curIdx) => + curIdx === idx ? { ...addon, checked } : addon + ); + } + + private async _createSnapshot(ev: CustomEvent): Promise { + if (this._dialogParams!.supervisor.info.state !== "running") { + showAlertDialog(this, { + title: this._dialogParams!.supervisor.localize( + "snapshot.could_not_create" + ), + text: this._dialogParams!.supervisor.localize( + "snapshot.create_blocked_not_running", + "state", + this._dialogParams!.supervisor.info.state + ), + }); + return; + } + const button = ev.currentTarget as any; + button.progress = true; + + this._error = ""; + if (this._snapshotHasPassword && !this._snapshotPassword.length) { + this._error = this._dialogParams!.supervisor.localize( + "snapshot.enter_password" + ); + button.progress = false; + return; + } + const name = this._snapshotName || formatDate(new Date(), this.hass.locale); + + try { + if (this._snapshotType === "full") { + const data: HassioFullSnapshotCreateParams = { name }; + if (this._snapshotHasPassword) { + data.password = this._snapshotPassword; + } + await createHassioFullSnapshot(this.hass, data); + } else { + const data: HassioPartialSnapshotCreateParams = { + name, + folders: this._folderList + .filter((folder) => folder.checked) + .map((folder) => folder.slug), + addons: this._addonList + .filter((addon) => addon.checked) + .map((addon) => addon.slug), + }; + if (this._snapshotHasPassword) { + data.password = this._snapshotPassword; + } + await createHassioPartialSnapshot(this.hass, data); + } + + this._dialogParams!.onCreate(); + this.closeDialog(); + } catch (err) { + this._error = extractApiErrorMessage(err); + } + button.progress = false; + } + + static get styles(): CSSResult[] { + return [ + haStyle, + haStyleDialog, + css` + .error { + color: var(--error-color); + } + paper-input[type="password"] { + display: block; + margin: 4px 0 4px 16px; + } + span.version { + color: var(--secondary-text-color); + } + .checkbox-section { + display: grid; + } + .checkbox-line { + display: inline-flex; + align-items: center; + } + `, + ]; + } +} + +declare global { + interface HTMLElementTagNameMap { + "dialog-hassio-create-snapshot": HassioCreateSnapshotDialog; + } +} diff --git a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts index c4e13a02d8..ebe2e9f774 100755 --- a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts +++ b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts @@ -13,6 +13,7 @@ import { property, TemplateResult, } from "lit-element"; +import { formatDateTime } from "../../../../src/common/datetime/format_date_time"; import { fireEvent } from "../../../../src/common/dom/fire_event"; import "../../../../src/components/ha-header-bar"; import "../../../../src/components/ha-svg-icon"; @@ -132,7 +133,7 @@ class HassioSnapshotDialog extends LitElement { ? "Full snapshot" : "Partial snapshot"} (${this._computeSize})
- ${this._formatDatetime(this._snapshot.date)} + ${formatDateTime(new Date(this._snapshot.date), this.hass.locale)}
${this._snapshot.homeassistant ? html`
Home Assistant:
@@ -142,7 +143,8 @@ class HassioSnapshotDialog extends LitElement { this._restoreHass = (ev.target as PaperCheckboxElement).checked!; }}" > - Home Assistant ${this._snapshot.homeassistant} + Home Assistant + (${this._snapshot.homeassistant}) ` : ""} ${this._folders.length @@ -181,6 +183,7 @@ class HassioSnapshotDialog extends LitElement { )}" > ${item.name} + (${item.version}) ` )} @@ -268,6 +271,9 @@ class HassioSnapshotDialog extends LitElement { .no-margin-top { margin-top: 0; } + span.version { + color: var(--secondary-text-color); + } ha-header-bar { --mdc-theme-on-primary: var(--primary-text-color); --mdc-theme-primary: var(--mdc-theme-surface); @@ -499,17 +505,6 @@ class HassioSnapshotDialog extends LitElement { return Math.ceil(this._snapshot!.size * 10) / 10 + " MB"; } - private _formatDatetime(datetime) { - return new Date(datetime).toLocaleDateString(navigator.language, { - weekday: "long", - year: "numeric", - month: "short", - day: "numeric", - hour: "numeric", - minute: "2-digit", - }); - } - private _closeDialog() { this._dialogParams = undefined; this._snapshot = undefined; diff --git a/hassio/src/dialogs/snapshot/show-dialog-hassio-create-snapshot.ts b/hassio/src/dialogs/snapshot/show-dialog-hassio-create-snapshot.ts new file mode 100644 index 0000000000..353caf31a2 --- /dev/null +++ b/hassio/src/dialogs/snapshot/show-dialog-hassio-create-snapshot.ts @@ -0,0 +1,18 @@ +import { fireEvent } from "../../../../src/common/dom/fire_event"; +import { Supervisor } from "../../../../src/data/supervisor/supervisor"; + +export interface HassioCreateSnapshotDialogParams { + supervisor: Supervisor; + onCreate: () => void; +} + +export const showHassioCreateSnapshotDialog = ( + element: HTMLElement, + dialogParams: HassioCreateSnapshotDialogParams +): void => { + fireEvent(element, "show-dialog", { + dialogTag: "dialog-hassio-create-snapshot", + dialogImport: () => import("./dialog-hassio-create-snapshot"), + dialogParams, + }); +}; diff --git a/hassio/src/snapshots/hassio-snapshots.ts b/hassio/src/snapshots/hassio-snapshots.ts index c01310191f..6ed974dfca 100644 --- a/hassio/src/snapshots/hassio-snapshots.ts +++ b/hassio/src/snapshots/hassio-snapshots.ts @@ -1,118 +1,129 @@ import "@material/mwc-button"; -import "@material/mwc-icon-button"; -import { ActionDetail } from "@material/mwc-list/mwc-list-foundation"; +import { ActionDetail } from "@material/mwc-list"; import "@material/mwc-list/mwc-list-item"; +import { mdiDotsVertical, mdiPlus } from "@mdi/js"; import { - mdiDotsVertical, - mdiPackageVariant, - mdiPackageVariantClosed, -} from "@mdi/js"; -import "@polymer/paper-checkbox/paper-checkbox"; -import type { PaperCheckboxElement } from "@polymer/paper-checkbox/paper-checkbox"; -import "@polymer/paper-input/paper-input"; -import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import "@polymer/paper-radio-button/paper-radio-button"; -import "@polymer/paper-radio-group/paper-radio-group"; -import type { PaperRadioGroupElement } from "@polymer/paper-radio-group/paper-radio-group"; -import { - css, CSSResultGroup, customElement, html, - state, LitElement, property, PropertyValues, + state, TemplateResult, } from "lit-element"; +import memoizeOne from "memoize-one"; import { atLeastVersion } from "../../../src/common/config/version"; -import "../../../src/components/buttons/ha-progress-button"; -import "../../../src/components/ha-button-menu"; -import "../../../src/components/ha-card"; -import "../../../src/components/ha-svg-icon"; -import { extractApiErrorMessage } from "../../../src/data/hassio/common"; +import relativeTime from "../../../src/common/datetime/relative_time"; +import { HASSDomEvent } from "../../../src/common/dom/fire_event"; +import { + DataTableColumnContainer, + RowClickedEvent, +} from "../../../src/components/data-table/ha-data-table"; +import "../../../src/components/ha-button-menu"; +import "../../../src/components/ha-fab"; import { - createHassioFullSnapshot, - createHassioPartialSnapshot, fetchHassioSnapshots, - HassioFullSnapshotCreateParams, - HassioPartialSnapshotCreateParams, HassioSnapshot, reloadHassioSnapshots, } from "../../../src/data/hassio/snapshot"; import { Supervisor } from "../../../src/data/supervisor/supervisor"; import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box"; -import "../../../src/layouts/hass-tabs-subpage"; -import { PolymerChangedEvent } from "../../../src/polymer-types"; +import "../../../src/layouts/hass-tabs-subpage-data-table"; import { haStyle } from "../../../src/resources/styles"; import { HomeAssistant, Route } from "../../../src/types"; -import "../components/hassio-card-content"; -import "../components/hassio-upload-snapshot"; +import { showHassioCreateSnapshotDialog } from "../dialogs/snapshot/show-dialog-hassio-create-snapshot"; import { showHassioSnapshotDialog } from "../dialogs/snapshot/show-dialog-hassio-snapshot"; import { showSnapshotUploadDialog } from "../dialogs/snapshot/show-dialog-snapshot-upload"; import { supervisorTabs } from "../hassio-tabs"; import { hassioStyle } from "../resources/hassio-style"; -interface CheckboxItem { - slug: string; - checked: boolean; - name?: string; -} - @customElement("hassio-snapshots") -class HassioSnapshots extends LitElement { +export class HassioSnapshots extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property({ type: Boolean }) public narrow!: boolean; - - @property({ attribute: false }) public route!: Route; - @property({ attribute: false }) public supervisor!: Supervisor; - @state() private _snapshotName = ""; + @property({ type: Object }) public route!: Route; - @state() private _snapshotPassword = ""; + @property({ type: Boolean }) public narrow!: boolean; - @state() private _snapshotHasPassword = false; + @property({ type: Boolean }) public isWide!: boolean; - @state() private _snapshotType: HassioSnapshot["type"] = "full"; + private _firstUpdatedCalled = false; @state() private _snapshots?: HassioSnapshot[] = []; - @state() private _addonList: CheckboxItem[] = []; - - @state() private _folderList: CheckboxItem[] = [ - { - slug: "homeassistant", - checked: true, - }, - { slug: "ssl", checked: true }, - { slug: "share", checked: true }, - { slug: "media", checked: true }, - { slug: "addons/local", checked: true }, - ]; - - @state() private _error = ""; + public connectedCallback(): void { + super.connectedCallback(); + if (this.hass && this._firstUpdatedCalled) { + this.refreshData(); + } + } public async refreshData() { await reloadHassioSnapshots(this.hass); - await this._updateSnapshots(); + await this.fetchSnapshots(); } + protected firstUpdated(changedProperties: PropertyValues): void { + super.firstUpdated(changedProperties); + if (this.hass && this.isConnected) { + this.refreshData(); + } + this._firstUpdatedCalled = true; + } + + private _columns = memoizeOne( + (narrow: boolean): DataTableColumnContainer => ({ + name: { + title: this.supervisor?.localize("snapshot.name") || "", + sortable: true, + filterable: true, + grows: true, + template: (entry: string, snapshot: any) => entry || snapshot.slug, + }, + date: { + title: this.supervisor?.localize("snapshot.created") || "", + width: "15%", + direction: "desc", + hidden: narrow, + filterable: true, + sortable: true, + template: (entry: string) => + relativeTime(new Date(entry), this.hass.localize), + }, + type: { + title: this.supervisor?.localize("snapshot.type") || "", + width: "15%", + hidden: narrow, + filterable: true, + sortable: true, + template: (entry: string) => (entry === "partial" ? "Partial" : "Full"), + }, + }) + ); + protected render(): TemplateResult { + if (!this.supervisor) { + return html``; + } return html` - - - ${this.supervisor.localize("panel.snapshots")} - - ${this.supervisor.localize("common.reload")} + ${this.supervisor?.localize("common.reload")} ${atLeastVersion(this.hass.config.version, 0, 116) ? html` - ${this.supervisor.localize("snapshot.upload_snapshot")} + ${this.supervisor?.localize("snapshot.upload_snapshot")} ` : ""} -
-

${this.supervisor.localize("snapshot.create_snapshot")}

-

- ${this.supervisor.localize("snapshot.description")} -

-
- -
- - ${this.supervisor.localize("snapshot.type")}: - - - ${this.supervisor.localize("snapshot.full_snapshot")} - - - ${this.supervisor.localize("snapshot.partial_snapshot")} - - - ${this._snapshotType === "full" - ? undefined - : html` - ${this.supervisor.localize("snapshot.folders")}: - ${this._folderList.map( - (folder, idx) => html` - - ${this.supervisor.localize( - `snapshot.folder.${folder.slug}` - )} - - ` - )} - ${this.supervisor.localize("snapshot.addons")}: - ${this._addonList.map( - (addon, idx) => html` - - ${addon.name} - - ` - )} - `} - ${this.supervisor.localize("snapshot.security")}: - - ${this.supervisor.localize("snapshot.password_protection")} - - ${this._snapshotHasPassword - ? html` - - ` - : undefined} - ${this._error !== "" - ? html`

${this._error}

` - : undefined} -
-
- - ${this.supervisor.localize("snapshot.create")} - -
-
-
- -

${this.supervisor.localize("snapshot.available_snapshots")}

-
- ${this._snapshots === undefined - ? undefined - : this._snapshots.length === 0 - ? html` - -
- ${this.supervisor.localize("snapshot.no_snapshots")} -
-
- ` - : this._snapshots.map( - (snapshot) => html` - -
- -
-
- ` - )} -
-
-
+ + + + `; } - protected firstUpdated(changedProps: PropertyValues) { - super.firstUpdated(changedProps); - this.refreshData(); - } - - protected updated(changedProps: PropertyValues) { - if (changedProps.has("supervisor")) { - this._addonList = this.supervisor.supervisor.addons - .map((addon) => ({ - slug: addon.slug, - name: addon.name, - checked: true, - })) - .sort((a, b) => (a.name < b.name ? -1 : 1)); - } - } - private _handleAction(ev: CustomEvent) { switch (ev.detail.index) { case 0: @@ -299,157 +165,52 @@ class HassioSnapshots extends LitElement { } } - private _handleTextValueChanged(ev: PolymerChangedEvent) { - const input = ev.currentTarget as PaperInputElement; - this[`_${input.name}`] = ev.detail.value; - } - - private _handleCheckboxValueChanged(ev) { - const input = ev.currentTarget as PaperCheckboxElement; - this[`_${input.name}`] = input.checked; - } - - private _handleRadioValueChanged(ev: PolymerChangedEvent) { - const input = ev.currentTarget as PaperRadioGroupElement; - this[`_${input.getAttribute("name")}`] = ev.detail.value; - } - - private _folderChecked(ev) { - const { idx, checked } = ev.currentTarget!; - this._folderList = this._folderList.map((folder, curIdx) => - curIdx === idx ? { ...folder, checked } : folder - ); - } - - private _addonChecked(ev) { - const { idx, checked } = ev.currentTarget!; - this._addonList = this._addonList.map((addon, curIdx) => - curIdx === idx ? { ...addon, checked } : addon - ); - } - - private async _updateSnapshots() { - try { - this._snapshots = await fetchHassioSnapshots(this.hass); - this._snapshots.sort((a, b) => (a.date < b.date ? 1 : -1)); - } catch (err) { - this._error = extractApiErrorMessage(err); - } - } - - private async _createSnapshot(ev: CustomEvent): Promise { - if (this.supervisor.info.state !== "running") { - await showAlertDialog(this, { - title: this.supervisor.localize("snapshot.could_not_create"), - text: this.supervisor.localize( - "snapshot.create_blocked_not_running", - "state", - this.supervisor.info.state - ), - }); - } - const button = ev.currentTarget as any; - button.progress = true; - - this._error = ""; - if (this._snapshotHasPassword && !this._snapshotPassword.length) { - this._error = this.supervisor.localize("snapshot.enter_password"); - button.progress = false; - return; - } - await this.updateComplete; - - const name = - this._snapshotName || - new Date().toLocaleDateString(navigator.language, { - weekday: "long", - year: "numeric", - month: "short", - day: "numeric", - }); - - try { - if (this._snapshotType === "full") { - const data: HassioFullSnapshotCreateParams = { name }; - if (this._snapshotHasPassword) { - data.password = this._snapshotPassword; - } - await createHassioFullSnapshot(this.hass, data); - } else { - const addons = this._addonList - .filter((addon) => addon.checked) - .map((addon) => addon.slug); - const folders = this._folderList - .filter((folder) => folder.checked) - .map((folder) => folder.slug); - - const data: HassioPartialSnapshotCreateParams = { - name, - folders, - addons, - }; - if (this._snapshotHasPassword) { - data.password = this._snapshotPassword; - } - await createHassioPartialSnapshot(this.hass, data); - } - this._updateSnapshots(); - } catch (err) { - this._error = extractApiErrorMessage(err); - } - button.progress = false; - } - - private _computeDetails(snapshot: HassioSnapshot) { - const type = - snapshot.type === "full" - ? this.supervisor.localize("snapshot.full_snapshot") - : this.supervisor.localize("snapshot.partial_snapshot"); - return snapshot.protected ? `${type}, password protected` : type; - } - - private _snapshotClicked(ev) { - showHassioSnapshotDialog(this, { - slug: ev.currentTarget!.snapshot.slug, - supervisor: this.supervisor, - onDelete: () => this._updateSnapshots(), - }); - } - private _showUploadSnapshotDialog() { showSnapshotUploadDialog(this, { showSnapshot: (slug: string) => showHassioSnapshotDialog(this, { slug, supervisor: this.supervisor, - onDelete: () => this._updateSnapshots(), + onDelete: () => this.fetchSnapshots(), }), reloadSnapshot: () => this.refreshData(), }); } + private async fetchSnapshots() { + await reloadHassioSnapshots(this.hass); + this._snapshots = await fetchHassioSnapshots(this.hass); + } + + private _handleRowClicked(ev: HASSDomEvent) { + const slug = ev.detail.id; + showHassioSnapshotDialog(this, { + slug, + supervisor: this.supervisor, + onDelete: () => this.fetchSnapshots(), + }); + } + + private _createSnapshot() { + if (this.supervisor!.info.state !== "running") { + showAlertDialog(this, { + title: this.supervisor!.localize("snapshot.could_not_create"), + text: this.supervisor!.localize( + "snapshot.create_blocked_not_running", + "state", + this.supervisor!.info.state + ), + }); + return; + } + showHassioCreateSnapshotDialog(this, { + supervisor: this.supervisor!, + onCreate: () => this.fetchSnapshots(), + }); + } + static get styles(): CSSResultGroup { - return [ - haStyle, - hassioStyle, - css` - paper-radio-group { - display: block; - } - paper-radio-button { - padding: 0 0 2px 2px; - } - paper-radio-button, - paper-checkbox, - paper-input[type="password"] { - display: block; - margin: 4px 0 4px 48px; - } - .pointer { - cursor: pointer; - } - `, - ]; + return [haStyle, hassioStyle]; } } diff --git a/src/components/data-table/ha-data-table.ts b/src/components/data-table/ha-data-table.ts index 639849eb7a..6a495afa9f 100644 --- a/src/components/data-table/ha-data-table.ts +++ b/src/components/data-table/ha-data-table.ts @@ -22,6 +22,7 @@ import { fireEvent } from "../../common/dom/fire_event"; import "../../common/search/search-input"; import { debounce } from "../../common/util/debounce"; import { nextRender } from "../../common/util/render-status"; +import { haStyleScrollbar } from "../../resources/styles"; import "../ha-checkbox"; import type { HaCheckbox } from "../ha-checkbox"; import "../ha-icon"; @@ -327,7 +328,7 @@ export class HaDataTable extends LitElement { ` : html`
${scroll({ @@ -574,354 +575,358 @@ export class HaDataTable extends LitElement { } static get styles(): CSSResultGroup { - return css` - /* default mdc styles, colors changed, without checkbox styles */ - :host { - height: 100%; - } - .mdc-data-table__content { - font-family: Roboto, sans-serif; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - font-size: 0.875rem; - line-height: 1.25rem; - font-weight: 400; - letter-spacing: 0.0178571429em; - text-decoration: inherit; - text-transform: inherit; - } + return [ + haStyleScrollbar, + css` + /* default mdc styles, colors changed, without checkbox styles */ + :host { + height: 100%; + } + .mdc-data-table__content { + font-family: Roboto, sans-serif; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + font-size: 0.875rem; + line-height: 1.25rem; + font-weight: 400; + letter-spacing: 0.0178571429em; + text-decoration: inherit; + text-transform: inherit; + } - .mdc-data-table { - background-color: var(--data-table-background-color); - border-radius: 4px; - border-width: 1px; - border-style: solid; - border-color: var(--divider-color); - display: inline-flex; - flex-direction: column; - box-sizing: border-box; - overflow: hidden; - } + .mdc-data-table { + background-color: var(--data-table-background-color); + border-radius: 4px; + border-width: 1px; + border-style: solid; + border-color: var(--divider-color); + display: inline-flex; + flex-direction: column; + box-sizing: border-box; + overflow: hidden; + } - .mdc-data-table__row--selected { - background-color: rgba(var(--rgb-primary-color), 0.04); - } + .mdc-data-table__row--selected { + background-color: rgba(var(--rgb-primary-color), 0.04); + } - .mdc-data-table__row { - display: flex; - width: 100%; - height: 52px; - } + .mdc-data-table__row { + display: flex; + width: 100%; + height: 52px; + } - .mdc-data-table__row ~ .mdc-data-table__row { - border-top: 1px solid var(--divider-color); - } + .mdc-data-table__row ~ .mdc-data-table__row { + border-top: 1px solid var(--divider-color); + } - .mdc-data-table__row:not(.mdc-data-table__row--selected):hover { - background-color: rgba(var(--rgb-primary-text-color), 0.04); - } + .mdc-data-table__row:not(.mdc-data-table__row--selected):hover { + background-color: rgba(var(--rgb-primary-text-color), 0.04); + } - .mdc-data-table__header-cell { - color: var(--primary-text-color); - } + .mdc-data-table__header-cell { + color: var(--primary-text-color); + } - .mdc-data-table__cell { - color: var(--primary-text-color); - } + .mdc-data-table__cell { + color: var(--primary-text-color); + } - .mdc-data-table__header-row { - height: 56px; - display: flex; - width: 100%; - border-bottom: 1px solid var(--divider-color); - overflow-x: auto; - } + .mdc-data-table__header-row { + height: 56px; + display: flex; + width: 100%; + border-bottom: 1px solid var(--divider-color); + overflow-x: auto; + } - .mdc-data-table__header-row::-webkit-scrollbar { - display: none; - } + .mdc-data-table__header-row::-webkit-scrollbar { + display: none; + } - .mdc-data-table__cell, - .mdc-data-table__header-cell { - padding-right: 16px; - padding-left: 16px; - align-self: center; - overflow: hidden; - text-overflow: ellipsis; - flex-shrink: 0; - box-sizing: border-box; - } + .mdc-data-table__cell, + .mdc-data-table__header-cell { + padding-right: 16px; + padding-left: 16px; + align-self: center; + overflow: hidden; + text-overflow: ellipsis; + flex-shrink: 0; + box-sizing: border-box; + } - .mdc-data-table__cell.mdc-data-table__cell--icon { - overflow: initial; - } + .mdc-data-table__cell.mdc-data-table__cell--icon { + overflow: initial; + } - .mdc-data-table__header-cell--checkbox, - .mdc-data-table__cell--checkbox { - /* @noflip */ - padding-left: 16px; - /* @noflip */ - padding-right: 0; - width: 56px; - } - :host([dir="rtl"]) .mdc-data-table__header-cell--checkbox, - :host([dir="rtl"]) .mdc-data-table__cell--checkbox { - /* @noflip */ - padding-left: 0; - /* @noflip */ - padding-right: 16px; - } + .mdc-data-table__header-cell--checkbox, + .mdc-data-table__cell--checkbox { + /* @noflip */ + padding-left: 16px; + /* @noflip */ + padding-right: 0; + width: 56px; + } + :host([dir="rtl"]) .mdc-data-table__header-cell--checkbox, + :host([dir="rtl"]) .mdc-data-table__cell--checkbox { + /* @noflip */ + padding-left: 0; + /* @noflip */ + padding-right: 16px; + } - .mdc-data-table__table { - height: 100%; - width: 100%; - border: 0; - white-space: nowrap; - } + .mdc-data-table__table { + height: 100%; + width: 100%; + border: 0; + white-space: nowrap; + } - .mdc-data-table__cell { - font-family: Roboto, sans-serif; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - font-size: 0.875rem; - line-height: 1.25rem; - font-weight: 400; - letter-spacing: 0.0178571429em; - text-decoration: inherit; - text-transform: inherit; - } + .mdc-data-table__cell { + font-family: Roboto, sans-serif; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + font-size: 0.875rem; + line-height: 1.25rem; + font-weight: 400; + letter-spacing: 0.0178571429em; + text-decoration: inherit; + text-transform: inherit; + } - .mdc-data-table__cell a { - color: inherit; - text-decoration: none; - } + .mdc-data-table__cell a { + color: inherit; + text-decoration: none; + } - .mdc-data-table__cell--numeric { - text-align: right; - } - :host([dir="rtl"]) .mdc-data-table__cell--numeric { - /* @noflip */ - text-align: left; - } + .mdc-data-table__cell--numeric { + text-align: right; + } + :host([dir="rtl"]) .mdc-data-table__cell--numeric { + /* @noflip */ + text-align: left; + } - .mdc-data-table__cell--icon { - color: var(--secondary-text-color); - text-align: center; - } + .mdc-data-table__cell--icon { + color: var(--secondary-text-color); + text-align: center; + } - .mdc-data-table__header-cell--icon, - .mdc-data-table__cell--icon { - width: 54px; - } + .mdc-data-table__header-cell--icon, + .mdc-data-table__cell--icon { + width: 54px; + } - .mdc-data-table__header-cell.mdc-data-table__header-cell--icon { - text-align: center; - } + .mdc-data-table__header-cell.mdc-data-table__header-cell--icon { + text-align: center; + } - .mdc-data-table__header-cell.sortable.mdc-data-table__header-cell--icon:hover, - .mdc-data-table__header-cell.sortable.mdc-data-table__header-cell--icon:not(.not-sorted) { - text-align: left; - } - :host([dir="rtl"]) .mdc-data-table__header-cell.sortable.mdc-data-table__header-cell--icon:hover, - :host([dir="rtl"]) .mdc-data-table__header-cell.sortable.mdc-data-table__header-cell--icon:not(.not-sorted) { - text-align: right; - } + text-align: left; + } + :host([dir="rtl"]) + .mdc-data-table__header-cell.sortable.mdc-data-table__header-cell--icon:hover, + :host([dir="rtl"]) + .mdc-data-table__header-cell.sortable.mdc-data-table__header-cell--icon:not(.not-sorted) { + text-align: right; + } - .mdc-data-table__cell--icon:first-child ha-icon { - margin-left: 8px; - } - :host([dir="rtl"]) .mdc-data-table__cell--icon:first-child ha-icon { - margin-left: auto; - margin-right: 8px; - } + .mdc-data-table__cell--icon:first-child ha-icon { + margin-left: 8px; + } + :host([dir="rtl"]) .mdc-data-table__cell--icon:first-child ha-icon { + margin-left: auto; + margin-right: 8px; + } - .mdc-data-table__cell--icon:first-child state-badge { - margin-right: -8px; - } - :host([dir="rtl"]) .mdc-data-table__cell--icon:first-child state-badge { - margin-right: auto; - margin-left: -8px; - } + .mdc-data-table__cell--icon:first-child state-badge { + margin-right: -8px; + } + :host([dir="rtl"]) .mdc-data-table__cell--icon:first-child state-badge { + margin-right: auto; + margin-left: -8px; + } - .mdc-data-table__header-cell--icon-button, - .mdc-data-table__cell--icon-button { - width: 56px; - padding: 8px; - } + .mdc-data-table__header-cell--icon-button, + .mdc-data-table__cell--icon-button { + width: 56px; + padding: 8px; + } - .mdc-data-table__cell--icon-button { - color: var(--secondary-text-color); - text-overflow: clip; - } + .mdc-data-table__cell--icon-button { + color: var(--secondary-text-color); + text-overflow: clip; + } - .mdc-data-table__header-cell--icon-button:first-child, - .mdc-data-table__cell--icon-button:first-child { - width: 64px; - padding-left: 16px; - } - :host([dir="rtl"]) .mdc-data-table__header-cell--icon-button:first-child, - :host([dir="rtl"]) .mdc-data-table__cell--icon-button:first-child { - padding-left: auto; - padding-right: 16px; - } + .mdc-data-table__header-cell--icon-button:first-child, + .mdc-data-table__cell--icon-button:first-child { + width: 64px; + padding-left: 16px; + } + :host([dir="rtl"]) + .mdc-data-table__header-cell--icon-button:first-child, + :host([dir="rtl"]) .mdc-data-table__cell--icon-button:first-child { + padding-left: auto; + padding-right: 16px; + } - .mdc-data-table__header-cell--icon-button:last-child, - .mdc-data-table__cell--icon-button:last-child { - width: 64px; - padding-right: 16px; - } - :host([dir="rtl"]) .mdc-data-table__header-cell--icon-button:last-child, - :host([dir="rtl"]) .mdc-data-table__cell--icon-button:last-child { - padding-right: auto; - padding-left: 16px; - } + .mdc-data-table__header-cell--icon-button:last-child, + .mdc-data-table__cell--icon-button:last-child { + width: 64px; + padding-right: 16px; + } + :host([dir="rtl"]) .mdc-data-table__header-cell--icon-button:last-child, + :host([dir="rtl"]) .mdc-data-table__cell--icon-button:last-child { + padding-right: auto; + padding-left: 16px; + } - .mdc-data-table__cell--icon-button a { - color: var(--secondary-text-color); - } + .mdc-data-table__cell--icon-button a { + color: var(--secondary-text-color); + } - .mdc-data-table__header-cell { - font-family: Roboto, sans-serif; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - font-size: 0.875rem; - line-height: 1.375rem; - font-weight: 500; - letter-spacing: 0.0071428571em; - text-decoration: inherit; - text-transform: inherit; - text-align: left; - } - :host([dir="rtl"]) .mdc-data-table__header-cell { - /* @noflip */ - text-align: right; - } + .mdc-data-table__header-cell { + font-family: Roboto, sans-serif; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + font-size: 0.875rem; + line-height: 1.375rem; + font-weight: 500; + letter-spacing: 0.0071428571em; + text-decoration: inherit; + text-transform: inherit; + text-align: left; + } + :host([dir="rtl"]) .mdc-data-table__header-cell { + /* @noflip */ + text-align: right; + } - .mdc-data-table__header-cell--numeric { - text-align: right; - } - .mdc-data-table__header-cell--numeric.sortable:hover, - .mdc-data-table__header-cell--numeric.sortable:not(.not-sorted) { - text-align: left; - } - :host([dir="rtl"]) .mdc-data-table__header-cell--numeric { - /* @noflip */ - text-align: left; - } - :host([dir="rtl"]) .mdc-data-table__header-cell--numeric.sortable:hover, - :host([dir="rtl"]) + .mdc-data-table__header-cell--numeric { + text-align: right; + } + .mdc-data-table__header-cell--numeric.sortable:hover, .mdc-data-table__header-cell--numeric.sortable:not(.not-sorted) { - text-align: right; - } + text-align: left; + } + :host([dir="rtl"]) .mdc-data-table__header-cell--numeric { + /* @noflip */ + text-align: left; + } + :host([dir="rtl"]) .mdc-data-table__header-cell--numeric.sortable:hover, + :host([dir="rtl"]) + .mdc-data-table__header-cell--numeric.sortable:not(.not-sorted) { + text-align: right; + } - /* custom from here */ + /* custom from here */ - :host { - display: block; - } + :host { + display: block; + } - .mdc-data-table { - display: block; - border-width: var(--data-table-border-width, 1px); - height: 100%; - } - .mdc-data-table__header-cell { - overflow: hidden; - position: relative; - } - .mdc-data-table__header-cell span { - position: relative; - left: 0px; - } - :host([dir="rtl"]) .mdc-data-table__header-cell span { - left: auto; - right: 0px; - } + .mdc-data-table { + display: block; + border-width: var(--data-table-border-width, 1px); + height: 100%; + } + .mdc-data-table__header-cell { + overflow: hidden; + position: relative; + } + .mdc-data-table__header-cell span { + position: relative; + left: 0px; + } + :host([dir="rtl"]) .mdc-data-table__header-cell span { + left: auto; + right: 0px; + } - .mdc-data-table__header-cell.sortable { - cursor: pointer; - } - .mdc-data-table__header-cell > * { - transition: left 0.2s ease; - } - :host([dir="rtl"]) .mdc-data-table__header-cell > * { - transition: right 0.2s ease; - } - .mdc-data-table__header-cell ha-icon { - top: -3px; - position: absolute; - } - .mdc-data-table__header-cell.not-sorted ha-icon { - left: -20px; - } - :host([dir="rtl"]) .mdc-data-table__header-cell.not-sorted ha-icon { - right: -20px; - } - .mdc-data-table__header-cell.sortable:not(.not-sorted) span, - .mdc-data-table__header-cell.sortable.not-sorted:hover span { - left: 24px; - } - :host([dir="rtl"]) - .mdc-data-table__header-cell.sortable:not(.not-sorted) - span, - :host([dir="rtl"]) - .mdc-data-table__header-cell.sortable.not-sorted:hover - span { - left: auto; - right: 24px; - } - .mdc-data-table__header-cell.sortable:not(.not-sorted) ha-icon, - .mdc-data-table__header-cell.sortable:hover.not-sorted ha-icon { - left: 12px; - } - :host([dir="rtl"]) - .mdc-data-table__header-cell.sortable:not(.not-sorted) - ha-icon, - :host([dir="rtl"]) - .mdc-data-table__header-cell.sortable:hover.not-sorted - ha-icon { - left: auto; - right: 12px; - } - .table-header { - border-bottom: 1px solid var(--divider-color); - padding: 0 16px; - } - search-input { - position: relative; - top: 2px; - } - slot[name="header"] { - display: block; - } - .center { - text-align: center; - } - .secondary { - color: var(--secondary-text-color); - } - .scroller { - display: flex; - position: relative; - contain: strict; - height: calc(100% - 57px); - } - .mdc-data-table__table:not(.auto-height) .scroller { - overflow: auto; - } - .grows { - flex-grow: 1; - flex-shrink: 1; - } - .forceLTR { - direction: ltr; - } - .clickable { - cursor: pointer; - } - `; + .mdc-data-table__header-cell.sortable { + cursor: pointer; + } + .mdc-data-table__header-cell > * { + transition: left 0.2s ease; + } + :host([dir="rtl"]) .mdc-data-table__header-cell > * { + transition: right 0.2s ease; + } + .mdc-data-table__header-cell ha-icon { + top: -3px; + position: absolute; + } + .mdc-data-table__header-cell.not-sorted ha-icon { + left: -20px; + } + :host([dir="rtl"]) .mdc-data-table__header-cell.not-sorted ha-icon { + right: -20px; + } + .mdc-data-table__header-cell.sortable:not(.not-sorted) span, + .mdc-data-table__header-cell.sortable.not-sorted:hover span { + left: 24px; + } + :host([dir="rtl"]) + .mdc-data-table__header-cell.sortable:not(.not-sorted) + span, + :host([dir="rtl"]) + .mdc-data-table__header-cell.sortable.not-sorted:hover + span { + left: auto; + right: 24px; + } + .mdc-data-table__header-cell.sortable:not(.not-sorted) ha-icon, + .mdc-data-table__header-cell.sortable:hover.not-sorted ha-icon { + left: 12px; + } + :host([dir="rtl"]) + .mdc-data-table__header-cell.sortable:not(.not-sorted) + ha-icon, + :host([dir="rtl"]) + .mdc-data-table__header-cell.sortable:hover.not-sorted + ha-icon { + left: auto; + right: 12px; + } + .table-header { + border-bottom: 1px solid var(--divider-color); + padding: 0 16px; + } + search-input { + position: relative; + top: 2px; + } + slot[name="header"] { + display: block; + } + .center { + text-align: center; + } + .secondary { + color: var(--secondary-text-color); + } + .scroller { + display: flex; + position: relative; + contain: strict; + height: calc(100% - 57px); + } + .mdc-data-table__table:not(.auto-height) .scroller { + overflow: auto; + } + .grows { + flex-grow: 1; + flex-shrink: 1; + } + .forceLTR { + direction: ltr; + } + .clickable { + cursor: pointer; + } + `, + ]; } } diff --git a/src/layouts/hass-tabs-subpage-data-table.ts b/src/layouts/hass-tabs-subpage-data-table.ts index 2b9687b20d..179b221515 100644 --- a/src/layouts/hass-tabs-subpage-data-table.ts +++ b/src/layouts/hass-tabs-subpage-data-table.ts @@ -11,6 +11,7 @@ import { query, TemplateResult, } from "lit-element"; +import { LocalizeFunc } from "../common/translations/localize"; import { fireEvent } from "../common/dom/fire_event"; import { computeRTLDirection } from "../common/util/compute_rtl"; import "../components/data-table/ha-data-table"; @@ -35,6 +36,8 @@ declare global { export class HaTabsSubpageDataTable extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; + @property({ attribute: false }) public localizeFunc?: LocalizeFunc; + @property({ type: Boolean }) public isWide = false; @property({ type: Boolean, reflect: true }) public narrow = false; @@ -185,6 +188,7 @@ export class HaTabsSubpageDataTable extends LitElement { return html` Date: Mon, 10 May 2021 22:11:08 +0200 Subject: [PATCH 029/117] Fix missing `customElement` import after Lit 2.0 bump (#9157) --- src/components/date-range-picker.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/date-range-picker.ts b/src/components/date-range-picker.ts index 7dd6244640..ecb8468d35 100644 --- a/src/components/date-range-picker.ts +++ b/src/components/date-range-picker.ts @@ -1,5 +1,6 @@ // @ts-nocheck import wrap from "@vue/web-component-wrapper"; +import { customElement } from "lit-element"; import Vue from "vue"; import DateRangePicker from "vue2-daterange-picker"; import dateRangePickerStyles from "vue2-daterange-picker/dist/vue2-daterange-picker.css"; From d4720a9244da0d88192f868be45b70dd835b6db5 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 10 May 2021 22:22:54 +0200 Subject: [PATCH 030/117] Align state info in center (#9153) --- src/components/entity/state-info.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/entity/state-info.ts b/src/components/entity/state-info.ts index f53089578f..8e56ee10f7 100644 --- a/src/components/entity/state-info.ts +++ b/src/components/entity/state-info.ts @@ -73,7 +73,7 @@ class StateInfo extends LitElement {
` - : html`
`} + : html`
`}
`; } @@ -106,6 +106,10 @@ class StateInfo extends LitElement { .info { margin-left: 56px; + display: flex; + flex-direction: column; + justify-content: center; + height: 100%; } :host([rtl]) .info { From 9f554f4917a911caa67ef7a472ae7bf4053fca56 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 10 May 2021 22:57:42 +0200 Subject: [PATCH 031/117] Silence babel warnings (#9158) --- build-scripts/bundle.js | 16 ++-- build-scripts/env.js | 1 + build-scripts/paths.js | 1 + build-scripts/rollup.js | 176 ++++++++++++++++++--------------------- build-scripts/util.js | 1 + build-scripts/webpack.js | 33 +++----- 6 files changed, 104 insertions(+), 124 deletions(-) diff --git a/build-scripts/bundle.js b/build-scripts/bundle.js index d21b2aea1a..1183a5ce06 100644 --- a/build-scripts/bundle.js +++ b/build-scripts/bundle.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ const path = require("path"); const env = require("./env.js"); const paths = require("./paths.js"); @@ -53,13 +54,13 @@ module.exports.babelOptions = ({ latestBuild }) => ({ babelrc: false, presets: [ !latestBuild && [ - require("@babel/preset-env").default, + "@babel/preset-env", { useBuiltIns: "entry", corejs: "3.6", }, ], - require("@babel/preset-typescript").default, + "@babel/preset-typescript", ].filter(Boolean), plugins: [ // Part of ES2018. Converts {...a, b: 2} to Object.assign({}, a, {b: 2}) @@ -72,14 +73,9 @@ module.exports.babelOptions = ({ latestBuild }) => ({ "@babel/plugin-syntax-dynamic-import", "@babel/plugin-proposal-optional-chaining", "@babel/plugin-proposal-nullish-coalescing-operator", - [ - require("@babel/plugin-proposal-decorators").default, - { decoratorsBeforeExport: true }, - ], - [ - require("@babel/plugin-proposal-class-properties").default, - { loose: true }, - ], + ["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: true }], + ["@babel/plugin-proposal-private-methods", { loose: true }], + ["@babel/plugin-proposal-class-properties", { loose: true }], ].filter(Boolean), }); diff --git a/build-scripts/env.js b/build-scripts/env.js index 8b2dea2eb4..bda99cf010 100644 --- a/build-scripts/env.js +++ b/build-scripts/env.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ const fs = require("fs"); const path = require("path"); const paths = require("./paths.js"); diff --git a/build-scripts/paths.js b/build-scripts/paths.js index da9d8db190..d89f5f582a 100644 --- a/build-scripts/paths.js +++ b/build-scripts/paths.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ const path = require("path"); module.exports = { diff --git a/build-scripts/rollup.js b/build-scripts/rollup.js index c5f8972854..7921ccc051 100644 --- a/build-scripts/rollup.js +++ b/build-scripts/rollup.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ const path = require("path"); const commonjs = require("@rollup/plugin-commonjs"); @@ -32,88 +33,82 @@ const createRollupConfig = ({ publicPath, dontHash, isWDS, -}) => { - return { - /** - * @type { import("rollup").InputOptions } - */ - inputOptions: { - input: entry, - // Some entry points contain no JavaScript. This setting silences a warning about that. - // https://rollupjs.org/guide/en/#preserveentrysignatures - preserveEntrySignatures: false, - plugins: [ - ignore({ - files: bundle.emptyPackages({ latestBuild }), +}) => ({ + /** + * @type { import("rollup").InputOptions } + */ + inputOptions: { + input: entry, + // Some entry points contain no JavaScript. This setting silences a warning about that. + // https://rollupjs.org/guide/en/#preserveentrysignatures + preserveEntrySignatures: false, + plugins: [ + ignore({ + files: bundle.emptyPackages({ latestBuild }), + }), + resolve({ + extensions, + preferBuiltins: false, + browser: true, + rootDir: paths.polymer_dir, + }), + commonjs({ + namedExports: { + "js-yaml": ["safeDump", "safeLoad"], + }, + }), + json(), + babel({ + ...bundle.babelOptions({ latestBuild }), + extensions, + exclude: bundle.babelExclude(), + babelHelpers: isWDS ? "inline" : "bundled", + }), + string({ + // Import certain extensions as strings + include: [path.join(paths.polymer_dir, "node_modules/**/*.css")], + }), + replace(bundle.definedVars({ isProdBuild, latestBuild, defineOverlay })), + !isWDS && + manifest({ + publicPath, }), - resolve({ - extensions, - preferBuiltins: false, - browser: true, - rootDir: paths.polymer_dir, + !isWDS && worker(), + !isWDS && dontHashPlugin({ dontHash }), + !isWDS && isProdBuild && terser(bundle.terserOptions(latestBuild)), + !isWDS && + isStatsBuild && + visualizer({ + // https://github.com/btd/rollup-plugin-visualizer#options + open: true, + sourcemap: true, }), - commonjs({ - namedExports: { - "js-yaml": ["safeDump", "safeLoad"], - }, - }), - json(), - babel({ - ...bundle.babelOptions({ latestBuild }), - extensions, - exclude: bundle.babelExclude(), - babelHelpers: isWDS ? "inline" : "bundled", - }), - string({ - // Import certain extensions as strings - include: [path.join(paths.polymer_dir, "node_modules/**/*.css")], - }), - replace( - bundle.definedVars({ isProdBuild, latestBuild, defineOverlay }) - ), - !isWDS && - manifest({ - publicPath, - }), - !isWDS && worker(), - !isWDS && dontHashPlugin({ dontHash }), - !isWDS && isProdBuild && terser(bundle.terserOptions(latestBuild)), - !isWDS && - isStatsBuild && - visualizer({ - // https://github.com/btd/rollup-plugin-visualizer#options - open: true, - sourcemap: true, - }), - ].filter(Boolean), - }, - /** - * @type { import("rollup").OutputOptions } - */ - outputOptions: { - // https://rollupjs.org/guide/en/#outputdir - dir: outputPath, - // https://rollupjs.org/guide/en/#outputformat - format: latestBuild ? "es" : "systemjs", - // https://rollupjs.org/guide/en/#outputexternallivebindings - externalLiveBindings: false, - // https://rollupjs.org/guide/en/#outputentryfilenames - // https://rollupjs.org/guide/en/#outputchunkfilenames - // https://rollupjs.org/guide/en/#outputassetfilenames - entryFileNames: - isProdBuild && !isStatsBuild ? "[name]-[hash].js" : "[name].js", - chunkFileNames: - isProdBuild && !isStatsBuild ? "c.[hash].js" : "[name].js", - assetFileNames: - isProdBuild && !isStatsBuild ? "a.[hash].js" : "[name].js", - // https://rollupjs.org/guide/en/#outputsourcemap - sourcemap: isProdBuild ? true : "inline", - }, - }; -}; + ].filter(Boolean), + }, + /** + * @type { import("rollup").OutputOptions } + */ + outputOptions: { + // https://rollupjs.org/guide/en/#outputdir + dir: outputPath, + // https://rollupjs.org/guide/en/#outputformat + format: latestBuild ? "es" : "systemjs", + // https://rollupjs.org/guide/en/#outputexternallivebindings + externalLiveBindings: false, + // https://rollupjs.org/guide/en/#outputentryfilenames + // https://rollupjs.org/guide/en/#outputchunkfilenames + // https://rollupjs.org/guide/en/#outputassetfilenames + entryFileNames: + isProdBuild && !isStatsBuild ? "[name]-[hash].js" : "[name].js", + chunkFileNames: isProdBuild && !isStatsBuild ? "c.[hash].js" : "[name].js", + assetFileNames: isProdBuild && !isStatsBuild ? "a.[hash].js" : "[name].js", + // https://rollupjs.org/guide/en/#outputsourcemap + sourcemap: isProdBuild ? true : "inline", + }, +}); -const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild, isWDS }) => { - return createRollupConfig( +const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild, isWDS }) => + createRollupConfig( bundle.config.app({ isProdBuild, latestBuild, @@ -121,31 +116,24 @@ const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild, isWDS }) => { isWDS, }) ); -}; -const createDemoConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => { - return createRollupConfig( +const createDemoConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => + createRollupConfig( bundle.config.demo({ isProdBuild, latestBuild, isStatsBuild, }) ); -}; -const createCastConfig = ({ isProdBuild, latestBuild }) => { - return createRollupConfig(bundle.config.cast({ isProdBuild, latestBuild })); -}; +const createCastConfig = ({ isProdBuild, latestBuild }) => + createRollupConfig(bundle.config.cast({ isProdBuild, latestBuild })); -const createHassioConfig = ({ isProdBuild, latestBuild }) => { - return createRollupConfig(bundle.config.hassio({ isProdBuild, latestBuild })); -}; +const createHassioConfig = ({ isProdBuild, latestBuild }) => + createRollupConfig(bundle.config.hassio({ isProdBuild, latestBuild })); -const createGalleryConfig = ({ isProdBuild, latestBuild }) => { - return createRollupConfig( - bundle.config.gallery({ isProdBuild, latestBuild }) - ); -}; +const createGalleryConfig = ({ isProdBuild, latestBuild }) => + createRollupConfig(bundle.config.gallery({ isProdBuild, latestBuild })); module.exports = { createAppConfig, diff --git a/build-scripts/util.js b/build-scripts/util.js index 23efdfb229..91dee49ea3 100644 --- a/build-scripts/util.js +++ b/build-scripts/util.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ const path = require("path"); const fs = require("fs"); diff --git a/build-scripts/webpack.js b/build-scripts/webpack.js index e39c3d9ea7..b7b11cc346 100644 --- a/build-scripts/webpack.js +++ b/build-scripts/webpack.js @@ -1,9 +1,10 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ const webpack = require("webpack"); const path = require("path"); const TerserPlugin = require("terser-webpack-plugin"); const { WebpackManifestPlugin } = require("webpack-manifest-plugin"); const paths = require("./paths.js"); -const bundle = require("./bundle"); +const bundle = require("./bundle.js"); const log = require("fancy-log"); class LogStartCompilePlugin { @@ -94,6 +95,7 @@ const createWebpackConfig = ({ ? path.resolve(context, resource) : require.resolve(resource); } catch (err) { + // eslint-disable-next-line no-console console.error( "Error in Home Assistant ignore plugin", resource, @@ -144,33 +146,24 @@ const createWebpackConfig = ({ }; }; -const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => { - return createWebpackConfig( +const createAppConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => + createWebpackConfig( bundle.config.app({ isProdBuild, latestBuild, isStatsBuild }) ); -}; -const createDemoConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => { - return createWebpackConfig( +const createDemoConfig = ({ isProdBuild, latestBuild, isStatsBuild }) => + createWebpackConfig( bundle.config.demo({ isProdBuild, latestBuild, isStatsBuild }) ); -}; -const createCastConfig = ({ isProdBuild, latestBuild }) => { - return createWebpackConfig(bundle.config.cast({ isProdBuild, latestBuild })); -}; +const createCastConfig = ({ isProdBuild, latestBuild }) => + createWebpackConfig(bundle.config.cast({ isProdBuild, latestBuild })); -const createHassioConfig = ({ isProdBuild, latestBuild }) => { - return createWebpackConfig( - bundle.config.hassio({ isProdBuild, latestBuild }) - ); -}; +const createHassioConfig = ({ isProdBuild, latestBuild }) => + createWebpackConfig(bundle.config.hassio({ isProdBuild, latestBuild })); -const createGalleryConfig = ({ isProdBuild, latestBuild }) => { - return createWebpackConfig( - bundle.config.gallery({ isProdBuild, latestBuild }) - ); -}; +const createGalleryConfig = ({ isProdBuild, latestBuild }) => + createWebpackConfig(bundle.config.gallery({ isProdBuild, latestBuild })); module.exports = { createAppConfig, From d91546b5327d019306db374a98518eb91ae240dd Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 11 May 2021 00:46:59 +0200 Subject: [PATCH 032/117] Bump home-assistant-js-websocket (#9156) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3282243d5a..9c6d53bd32 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "fuse.js": "^6.0.0", "google-timezones-json": "^1.0.2", "hls.js": "^1.0.3", - "home-assistant-js-websocket": "^5.9.0", + "home-assistant-js-websocket": "^5.10.0", "idb-keyval": "^3.2.0", "intl-messageformat": "^8.3.9", "js-yaml": "^3.13.1", diff --git a/yarn.lock b/yarn.lock index 960c7942c6..96e1a8d846 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7444,10 +7444,10 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -home-assistant-js-websocket@^5.9.0: - version "5.9.0" - resolved "https://registry.yarnpkg.com/home-assistant-js-websocket/-/home-assistant-js-websocket-5.9.0.tgz#85f73cc7aa23362e93d7e8208026fbcf25934022" - integrity sha512-HSAhX+s2JgsE77sYKKqcNsukiO6Zm4CcCIwugq17MwHcEyLoecChsbQtgtbvg1dHctUAk+IHxuZ0JBx10B1YGQ== +home-assistant-js-websocket@^5.10.0: + version "5.10.0" + resolved "https://registry.yarnpkg.com/home-assistant-js-websocket/-/home-assistant-js-websocket-5.10.0.tgz#b59fd4f20a8295571b1a2589530c995d0d910c49" + integrity sha512-QiK26d62wuQCuaXHRZ90yvaMXeHkYbQrSGQvCrF6hqxdibLXEwSXQM2uzWYUgP25Q3iKy3PLQspMBRnuBKczbQ== homedir-polyfill@^1.0.1: version "1.0.3" From 3575d94ca1ce80c9e39c495c8d7ebf51d076ca3b Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 11 May 2021 01:46:41 +0000 Subject: [PATCH 033/117] Translation update --- translations/frontend/ca.json | 2 ++ translations/frontend/cs.json | 1 + translations/frontend/de.json | 5 +++-- translations/frontend/en.json | 2 ++ translations/frontend/et.json | 2 ++ translations/frontend/it.json | 2 ++ translations/frontend/nb.json | 5 +++-- translations/frontend/nl.json | 2 ++ translations/frontend/ru.json | 2 ++ 9 files changed, 19 insertions(+), 4 deletions(-) diff --git a/translations/frontend/ca.json b/translations/frontend/ca.json index a9129c209a..7f92e1223a 100644 --- a/translations/frontend/ca.json +++ b/translations/frontend/ca.json @@ -384,6 +384,7 @@ "create": "Crea", "create_blocked_not_running": "Ara mateix no és possible crear una instantània perquè el sistema es troba en estat {state}.", "create_snapshot": "Crea instantània", + "created": "Creada", "description": "Les instantànies et permeten fer una còpia de seguretat i recuperar les dades de la teva instància de Home Assistant.", "enter_password": "Introdueix una contrasenya.", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "Obtén actualitzacions estables de Home Assistant, del Supervisor i de l'amfitrió", "ram_usage": "Ús de RAM del Supervisor", "reload_supervisor": "Torna a carregar el Supervisor", + "search": "Cerca", "share_diagnostics": "Comparteix diagnòstics", "share_diagnostics_description": "Comparteix informes d'errors i informació de diagnòstic.", "share_diagonstics_description": "Vols compartir automàticament informes d'error i informació de diagnòstic quan el Supervisor trobi amb errors inesperats?{line_break} Això ens permetrà solucionar problemes, la informació només és accessible per a l'equip de Home Assistant Core i no es compartirà amb altres persones.{line_break} Les dades no inclouen informació privada/confidencial, ho pots desactivar en qualsevol moment a la configuració.", diff --git a/translations/frontend/cs.json b/translations/frontend/cs.json index eed55146f5..469db602ec 100644 --- a/translations/frontend/cs.json +++ b/translations/frontend/cs.json @@ -2227,6 +2227,7 @@ }, "finish": "Dokončit", "loading_first_time": "Počkejte prosím, než bude integrace nainstalována.", + "next": "Další", "not_all_required_fields": "Nejsou vyplněna všechna povinná pole.", "not_loaded": "Integraci se nepodařilo načíst, zkuste restartovat Home Assistant.", "pick_flow_step": { diff --git a/translations/frontend/de.json b/translations/frontend/de.json index 571c05c3e6..15b45c2dbf 100644 --- a/translations/frontend/de.json +++ b/translations/frontend/de.json @@ -366,6 +366,7 @@ }, "my": { "error": "Ein unbekannter Fehler ist aufgetreten.", + "error_addon_no_ingress": "Das angeforderte Add-on unterstützt keinen Ingress", "error_addon_not_found": "Add-on nicht gefunden", "faq_link": "Häufig gestellten Fragen zu Home Assistant", "not_supported": "Diese Weiterleitung wird von deiner Home Assistant-Instanz nicht unterstützt. Überprüfe den {link} auf die unterstützten Weiterleitungen und die Version, in der sie eingeführt wurden." @@ -3143,8 +3144,8 @@ "attributes": "Attribute", "copy_id": "ID in die Zwischenablage kopieren", "current_entities": "Aktuelle Entitäten", - "description1": "Stelle die Darstellung eines Geräts in Home Assistant ein.", - "description2": "Dies führt nicht zur Kommunikation mit dem eigentlichen Gerät.", + "description1": "Legt die aktuelle Zustandsdarstellung einer Entität in Home Assistant fest.", + "description2": "Wenn die Entität zu einem Gerät gehört, findet keine tatsächliche Kommunikation mit diesem Gerät statt.", "entity": "Entität", "filter_attributes": "Attribute filtern", "filter_entities": "Entitäten filtern", diff --git a/translations/frontend/en.json b/translations/frontend/en.json index 6ffd4b5476..ea672b9452 100644 --- a/translations/frontend/en.json +++ b/translations/frontend/en.json @@ -384,6 +384,7 @@ "create": "Create", "create_blocked_not_running": "Creating a snapshot is not possible right now because the system is in {state} state.", "create_snapshot": "Create snapshot", + "created": "Created", "description": "Snapshots allow you to easily backup and restore all data of your Home Assistant instance.", "enter_password": "Please enter a password.", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "Get stable updates for Home Assistant, Supervisor and host", "ram_usage": "Supervisor RAM Usage", "reload_supervisor": "Reload Supervisor", + "search": "Search", "share_diagnostics": "Share Diagnostics", "share_diagnostics_description": "Share crash reports and diagnostic information.", "share_diagonstics_description": "Would you want to automatically share crash reports and diagnostic information when the Supervisor encounters unexpected errors? {line_break} This will allow us to fix the problems, the information is only accessible to the Home Assistant Core team and will not be shared with others.{line_break} The data does not include any private/sensitive information and you can disable this in settings at any time you want.", diff --git a/translations/frontend/et.json b/translations/frontend/et.json index d9d0f46d4a..a8ce61e3de 100644 --- a/translations/frontend/et.json +++ b/translations/frontend/et.json @@ -384,6 +384,7 @@ "create": "Loo", "create_blocked_not_running": "Hetktõmmise loomine pole praegu võimalik kuna süsteem on olekus {state}.", "create_snapshot": "Loo hetktõmmis", + "created": "Loodud", "description": "Hetktõmmised võimaldavad hõlpsalt varundada ja taastada kõik Home Assistanti andmed.", "enter_password": "Sisesta salasõna.", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "Hangi Home Assistanti, Supervisori ja hosti jaoks stabiilseid uuendusi", "ram_usage": "Supervisori mälu kasutus", "reload_supervisor": "Taaslae Supevisor", + "search": "Otsing", "share_diagnostics": "Jaga silumisteavet", "share_diagnostics_description": "Jaga krahhiaruandeid ja diagnostikateavet.", "share_diagonstics_description": "Kas soovid automaatselt jagada krahhiaruandeid ja diagnostikateavet kui Supervisoris ilmneb ootamatuid tõrkeid? {line_break} See võimaldab meil probleeme lahendada, teave on kättesaadav ainult Home Assistanti põhimeeskonnale ja seda ei jagata teistega. {line_break} Andmed ei sisalda privaatset/tundlikku teavet ja saad selle sätetes igal ajal keelata.", diff --git a/translations/frontend/it.json b/translations/frontend/it.json index 093717fff2..0bdb85893c 100644 --- a/translations/frontend/it.json +++ b/translations/frontend/it.json @@ -384,6 +384,7 @@ "create": "Crea", "create_blocked_not_running": "La creazione di un'istantanea non è al momento possibile perché il sistema è nello stato {state}.", "create_snapshot": "Crea istantanea", + "created": "Creato", "description": "Le istantanee ti consentono di eseguire facilmente il backup e il ripristino di tutti i dati dell'istanza di Home Assistant.", "enter_password": "Immettere una password.", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "Ricevi aggiornamenti stabili per Home Assistant, Supervisor e host", "ram_usage": "Utilizzo RAM Supervisor", "reload_supervisor": "Ricarica Supervisor", + "search": "Ricerca", "share_diagnostics": "Condividi diagnostica", "share_diagnostics_description": "Condividi i rapporti sugli arresti anomali e le informazioni diagnostiche.", "share_diagonstics_description": "Vorresti condividere automaticamente i rapporti sugli arresti anomali e le informazioni diagnostiche quando il Supervisor rileva errori imprevisti? {line_break} Questo ci consentirà di risolvere i problemi, le informazioni sono accessibili solo al team di Home Assistant Core e non saranno condivise con altri. {line_break} I dati non includono alcuna informazione privata/sensibile e puoi disabilitarla nelle impostazioni in qualsiasi momento lo desideri.", diff --git a/translations/frontend/nb.json b/translations/frontend/nb.json index 1b1dd89408..430ea2ad1c 100644 --- a/translations/frontend/nb.json +++ b/translations/frontend/nb.json @@ -366,6 +366,7 @@ }, "my": { "error": "En ukjent feil har oppstått", + "error_addon_no_ingress": "Det etterspurte tillegget støtter ikke inngang", "error_addon_not_found": "Tillegget ble ikke funnet", "faq_link": "Vanlige spørsmål om Min Home Assistant", "not_supported": "Denne viderekoblingen støttes ikke av Home Assistant-forekomsten. Se på {link} for viderekoblinger som støttes, og hvilken versjon de ble introdusert." @@ -3974,12 +3975,12 @@ }, "refresh_tokens": { "confirm_delete": "Er du sikker på at du vil slette oppdateringstoken for {name}?", - "created_at": "Opprettet den {date}", + "created_at": "Opprettet {date}", "current_token_tooltip": "Kan ikke slette gjeldende oppdateringstoken", "delete_failed": "Kunne ikke slette oppdateringstoken.", "description": "Hver oppdateringstoken representerer en innloggingsøkt. Oppdateringstoken blir automatisk fjernet når du klikker på logg ut. Følgende oppdateringstoken er for tiden aktiv for kontoen din.", "header": "Oppdater Tokens", - "last_used": "Sist brukt den {date} fra {location}", + "last_used": "Sist brukt {date} fra {location}", "not_used": "Har aldri blitt brukt", "token_title": "Oppdateringstoken for {clientId}" }, diff --git a/translations/frontend/nl.json b/translations/frontend/nl.json index 90f29b2cdd..f4e5208080 100644 --- a/translations/frontend/nl.json +++ b/translations/frontend/nl.json @@ -384,6 +384,7 @@ "create": "Maak", "create_blocked_not_running": "Het maken van een snapshot is nu niet mogelijk omdat het systeem in {state} staat.", "create_snapshot": "Maak snapshot", + "created": "Gemaakt", "description": "Met snapshots kunt u gemakkelijk een back-up maken van alle gegevens van uw Home Assistant en ze herstellen.", "enter_password": "Voer een wachtwoord in.", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "Krijg stabiele updates voor Home Assistant, Supervisor en host", "ram_usage": "Supervisor RAM-gebruik", "reload_supervisor": "Herlaad de Supervisor", + "search": "Zoek", "share_diagnostics": "Diagnostische gegevens delen", "share_diagnostics_description": "Deel crash rapporten en diagnostische informatie.", "share_diagonstics_description": "Zou je automatisch crash rapporten en diagnostische informatie willen delen wanneer de Supervisor onverwachte fouten tegenkomt? {line_break} Dit stelt ons in staat om de problemen op te lossen, de informatie is alleen toegankelijk voor het Home Assistant Core team en zal niet met anderen gedeeld worden.{line_break} De gegevens bevatten geen privé/gevoelige informatie en u kunt dit in de instellingen op elk gewenst moment uitschakelen.", diff --git a/translations/frontend/ru.json b/translations/frontend/ru.json index 2e99ad93c1..4f5d621419 100644 --- a/translations/frontend/ru.json +++ b/translations/frontend/ru.json @@ -384,6 +384,7 @@ "create": "Создать", "create_blocked_not_running": "Создание снимка сейчас невозможно, потому что система находится в состоянии {state}.", "create_snapshot": "Снимки файловой системы", + "created": "Создан", "description": "Снимок файловой системы (snapshot) позволяет легко создавать и восстанавливать резервную копию всех данных Вашего Home Assistant.", "enter_password": "Пожалуйста, введите пароль.", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "Получать стабильные версии обновлений для Home Assistant, Supervisor и операционной системы хоста", "ram_usage": "Использование ОЗУ", "reload_supervisor": "Перезагрузить Supervisor", + "search": "Поиск", "share_diagnostics": "Отправлять данные для диагностики", "share_diagnostics_description": "Автоматически отправлять отчеты о сбоях и диагностическую информацию.", "share_diagonstics_description": "Хотели бы Вы автоматически отправлять отчеты о сбоях и другую диагностическую информацию, когда Supervisor обнаруживает неожиданные ошибки? {line_break} Это позволит разработчикам получать необходимые данные для решения проблем. Данные не будут содержать никакой личной или конфиденциальной информации и будут доступны только основной команде Home Assistant. {line_break} Вы сможете отменить отправку данных в настройках в любое время.", From 4e1d10cc08fb2c0087399e8af23632d986579a4a Mon Sep 17 00:00:00 2001 From: Michael <35783820+mib1185@users.noreply.github.com> Date: Tue, 11 May 2021 10:52:44 +0200 Subject: [PATCH 034/117] Improve UX for counter and input_number helpers (#9061) --- src/data/history.ts | 15 +++++++++------ src/panels/lovelace/cards/hui-gauge-card.ts | 2 +- src/panels/lovelace/cards/hui-sensor-card.ts | 9 +++++++-- .../config-elements/hui-gauge-card-editor.ts | 2 +- .../config-elements/hui-sensor-card-editor.ts | 2 +- .../header-footer/hui-graph-header-footer.ts | 8 ++++++-- 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/data/history.ts b/src/data/history.ts index 6bd1f3359d..92c4a2caf8 100644 --- a/src/data/history.ts +++ b/src/data/history.ts @@ -224,12 +224,15 @@ export const computeHistory = ( if (stateWithUnit) { unit = stateWithUnit.attributes.unit_of_measurement; - } else if (computeStateDomain(stateInfo[0]) === "climate") { - unit = hass.config.unit_system.temperature; - } else if (computeStateDomain(stateInfo[0]) === "water_heater") { - unit = hass.config.unit_system.temperature; - } else if (computeStateDomain(stateInfo[0]) === "humidifier") { - unit = "%"; + } else { + unit = { + climate: hass.config.unit_system.temperature, + counter: "#", + humidifier: "%", + input_number: "#", + number: "#", + water_heater: hass.config.unit_system.temperature, + }[computeStateDomain(stateInfo[0])]; } if (!unit) { diff --git a/src/panels/lovelace/cards/hui-gauge-card.ts b/src/panels/lovelace/cards/hui-gauge-card.ts index a6bcf33024..9560e015c3 100644 --- a/src/panels/lovelace/cards/hui-gauge-card.ts +++ b/src/panels/lovelace/cards/hui-gauge-card.ts @@ -44,7 +44,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { entities: string[], entitiesFallback: string[] ): GaugeCardConfig { - const includeDomains = ["sensor"]; + const includeDomains = ["counter", "input_number", "number", "sensor"]; const maxEntities = 1; const entityFilter = (stateObj: HassEntity): boolean => !isNaN(Number(stateObj.state)); diff --git a/src/panels/lovelace/cards/hui-sensor-card.ts b/src/panels/lovelace/cards/hui-sensor-card.ts index e8cb258662..b0dfaed69c 100644 --- a/src/panels/lovelace/cards/hui-sensor-card.ts +++ b/src/panels/lovelace/cards/hui-sensor-card.ts @@ -1,4 +1,5 @@ import { HassEntity } from "home-assistant-js-websocket/dist/types"; +import { computeDomain } from "../../../common/entity/compute_domain"; import { customElement } from "lit-element"; import { HomeAssistant } from "../../../types"; import { findEntities } from "../common/find-entities"; @@ -7,6 +8,8 @@ import { LovelaceCardEditor } from "../types"; import { HuiEntityCard } from "./hui-entity-card"; import { EntityCardConfig, SensorCardConfig } from "./types"; +const includeDomains = ["counter", "input_number", "number", "sensor"]; + @customElement("hui-sensor-card") class HuiSensorCard extends HuiEntityCard { public static async getConfigElement(): Promise { @@ -19,7 +22,6 @@ class HuiSensorCard extends HuiEntityCard { entities: string[], entitiesFallback: string[] ): SensorCardConfig { - const includeDomains = ["sensor"]; const maxEntities = 1; const entityFilter = (stateObj: HassEntity): boolean => !isNaN(Number(stateObj.state)) && @@ -38,7 +40,10 @@ class HuiSensorCard extends HuiEntityCard { } public setConfig(config: SensorCardConfig): void { - if (!config.entity || config.entity.split(".")[0] !== "sensor") { + if ( + !config.entity || + !includeDomains.includes(computeDomain(config.entity)) + ) { throw new Error("Specify an entity from within the sensor domain"); } diff --git a/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts index 246ee75729..13a61042a9 100644 --- a/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts @@ -33,7 +33,7 @@ const cardConfigStruct = object({ theme: optional(string()), }); -const includeDomains = ["sensor"]; +const includeDomains = ["counter", "input_number", "number", "sensor"]; @customElement("hui-gauge-card-editor") export class HuiGaugeCardEditor diff --git a/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts index 11b4da9d7c..9d12608660 100644 --- a/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-sensor-card-editor.ts @@ -37,7 +37,7 @@ const cardConfigStruct = object({ hours_to_show: optional(number()), }); -const includeDomains = ["sensor"]; +const includeDomains = ["counter", "input_number", "number", "sensor"]; @customElement("hui-sensor-card-editor") export class HuiSensorCardEditor diff --git a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts index bc80313c02..918ead0d81 100644 --- a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts @@ -12,6 +12,7 @@ import { } from "lit-element"; import "../../../components/ha-circular-progress"; import { fetchRecent } from "../../../data/history"; +import { computeDomain } from "../../../common/entity/compute_domain"; import { HomeAssistant } from "../../../types"; import { findEntities } from "../common/find-entities"; import { coordinates } from "../common/graph/coordinates"; @@ -22,6 +23,7 @@ import { GraphHeaderFooterConfig } from "./types"; const MINUTE = 60000; const HOUR = MINUTE * 60; +const includeDomains = ["counter", "input_number", "number", "sensor"]; @customElement("hui-graph-header-footer") export class HuiGraphHeaderFooter @@ -37,7 +39,6 @@ export class HuiGraphHeaderFooter entities: string[], entitiesFallback: string[] ): GraphHeaderFooterConfig { - const includeDomains = ["sensor"]; const maxEntities = 1; const entityFilter = (stateObj: HassEntity): boolean => !isNaN(Number(stateObj.state)) && @@ -75,7 +76,10 @@ export class HuiGraphHeaderFooter } public setConfig(config: GraphHeaderFooterConfig): void { - if (!config?.entity || config.entity.split(".")[0] !== "sensor") { + if ( + !config?.entity || + !includeDomains.includes(computeDomain(config.entity)) + ) { throw new Error("Specify an entity from within the sensor domain"); } From 29e8d1cff0f58d31de8782b7b4c8c42a25004edb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 11:24:05 +0200 Subject: [PATCH 035/117] Bump hosted-git-info from 2.7.1 to 2.8.9 (#9162) Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.7.1 to 2.8.9. - [Release notes](https://github.com/npm/hosted-git-info/releases) - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md) - [Commits](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.9) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 96e1a8d846..976a7db2de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7457,9 +7457,9 @@ homedir-polyfill@^1.0.1: parse-passwd "^1.0.0" hosted-git-info@^2.1.4: - version "2.7.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" - integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== hpack.js@^2.1.6: version "2.1.6" From 01b3d2aca9118e17ff1c96e5754476b084d5e8a6 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 12 May 2021 01:47:33 +0000 Subject: [PATCH 036/117] Translation update --- translations/frontend/da.json | 128 +++++++++++++++++++++++++++-- translations/frontend/de.json | 2 + translations/frontend/es.json | 2 + translations/frontend/fr.json | 2 + translations/frontend/it.json | 2 +- translations/frontend/ko.json | 2 + translations/frontend/nb.json | 2 + translations/frontend/zh-Hant.json | 2 + 8 files changed, 132 insertions(+), 10 deletions(-) diff --git a/translations/frontend/da.json b/translations/frontend/da.json index 4cee64b9c9..0d19e2db93 100644 --- a/translations/frontend/da.json +++ b/translations/frontend/da.json @@ -366,6 +366,7 @@ }, "my": { "error": "Der opstod en ukendt fejl", + "error_addon_no_ingress": "Tilføjelsesprogrammet understøtter ikke ingress", "error_addon_not_found": "Tilføjelsesprogrammet blev ikke fundet", "faq_link": "Ofte stillede spørgsmål om Home Assistant", "not_supported": "Denne omdirigering understøttes ikke af din Home Assistant installation. Kontroller {link} for de understøttede omdirigeringer og den version, de blev introduceret i." @@ -383,6 +384,7 @@ "create": "Opret", "create_blocked_not_running": "Det er ikke muligt at oprette et snapshot lige nu, fordi systemet er i tilstanden {state}.", "create_snapshot": "Opret snapshot", + "created": "Oprettet", "description": "Snapshots giver dig mulighed for nemt at sikkerhedskopiere og gendanne alle data fra dit instans af Home Assistant.", "enter_password": "Venligst indtast et kodeord.", "folder": { @@ -458,6 +460,7 @@ "leave_beta_description": "Få stabile opdateringer til Home Assistant, Supervisor og værtsmaskinen", "ram_usage": "Supervisor RAM forbrug", "reload_supervisor": "Genindlæs Supervisor", + "search": "Søg", "share_diagnostics": "Del diagnostik", "share_diagnostics_description": "Del oplysninger om nedbrud og diagnosticeringsinformationer.", "share_diagonstics_description": "Ønsker du automatisk at dele rapporter og fejlfindingsoplysninger når supervisoren oplever uventede fejl? {line_break} Dette vil lade os løse problemerne, informationerne er kun tilgængelige for Home Assistant Core teamet og vil ikke blive delt med andre. {line_break} Dataene indeholder ikke private/følsomme informationer og du kan slå det fra i indstillingerne til hver en tid.", @@ -473,6 +476,7 @@ "unhealthy_title": "Din installation er usund", "unsupported_description": "Nedenfor er en liste over problemer, der er fundet med din installation. Klik på linkene for at lære, hvordan du kan løse problemerne.", "unsupported_reason": { + "apparmor": "AppArmor er ikke aktiveret på værten", "container": "Containere, der erfaringsmæssigt giver problemer", "content-trust": "Validering af indholds-tillid er deaktiveret", "dbus": "DBUS", @@ -564,6 +568,7 @@ "color_brightness": "Farvetemperatur", "color_temperature": "Farvetemperatur", "effect": "Effekt", + "warm_white_value": "Varm hvid lysstyrke", "white_value": "Hvidværdi" }, "lock": { @@ -842,6 +847,14 @@ "label": "Billede", "unsupported_format": "Ikke-understøttet format, vælg venligst et JPEG-, PNG- eller GIF-billede." }, + "related-filter-menu": { + "filter_by_area": "Filtrer efter område", + "filter_by_device": "Filtrer efter enhed", + "filter_by_entity": "Filtrer efter entitet", + "filtered_by_area": "område: {area_name}", + "filtered_by_device": "enhed: {device_name}", + "filtered_by_entity": "entitet: {entity_name}" + }, "related-items": { "area": "Område", "automation": "En del af følgende automatiseringer", @@ -879,6 +892,7 @@ } }, "service-control": { + "integration_doc": "Dokumentation for integration", "required": "Dette felt er påkrævet", "service_data": "Service data", "target": "Mål", @@ -1119,7 +1133,7 @@ "min_max": "Genindlæs min / max entiteter", "mqtt": "Genindlæs manuelt konfigurerede MQTT-entiteter", "person": "Genindlæs personer", - "ping": "Genindlæs ping sensorentiteter", + "ping": "Genindlæs ping sensor entiteter", "reload": "Genindlæs {domain}", "rest": "Genindlæs REST entiteter og REST notifikationstjenester", "rpi_gpio": "Genindlæs Raspberry Pi GPIO entiteter", @@ -1191,9 +1205,11 @@ "bind_header": "Binding", "button_hide": "Skjul detaljer", "button_show": "Vis detaljer", + "cluster_header": "Klynge", "configuration_complete": "Konfiguration af enheden er færdig", "configuration_failed": "konfuguration af enheden fejlede. Yderligere information kam findes i logfilerne ", "configuring_alt": "Konfigurerer", + "heading": "Omkonfigurering af enhed", "in_progress": "Enheden rekonfigureres. Dette kan tage noget tid", "introduction": "Konfigurer en enhed på dit Zigbee netværk. Brug denne mulighed hvos din enhed ikke virker korrekt", "min_max_change": "Min/maks/ændre", @@ -1220,6 +1236,14 @@ "key_wrong_type": "Den angivne værdi for \"{key}\" understøttes ikke af den visuelle editor. Vi understøtter ( {type_correct} ) men modtog ( {type_wrong} ).", "no_template_editor_support": "Skabeloner understøttes ikke i visuel editor", "no_type_provided": "Der er ikke angivet nogen type." + }, + "supervisor": { + "ask": "Anmod om hjælp", + "observer": "Kontroller observatøren", + "reboot": "Prøv at genstarte værten", + "system_health": "Kontroller systemets sundhed", + "title": "Supervisor panelet kunne ikke indlæses!", + "wait": "Hvis du lige er startet, skal du sørge for, at du har givet Supervisor tid til at starte." } }, "login-form": { @@ -1237,10 +1261,12 @@ "notification_toast": { "connection_lost": "Forbindelse afbrudt. Opretter forbindelse igen...", "dismiss": "Afvis", + "intergration_starting": "Starter {integration}, ikke alt vil være tilgængeligt, før det er færdigt.", "service_call_failed": "Kunne ikke kalde tjenesten {service}.", "started": "Home Assistant er startet!", "starting": "Home Assistant starter. Nogle funktioner er måske ikke tilgængelige før opstarten er færdig.", - "triggered": "Udløste {name}" + "triggered": "Udløste {name}", + "wrapping_up_startup": "Færdigører opstarten af Home Assistant. Nogle funktioner er måske ikke tilgængelige før opstarten er færdig." }, "panel": { "config": { @@ -1607,7 +1633,7 @@ "delete_automation": "Slet automatisering", "delete_confirm": "Er du sikker på, at du vil slette denne automatisering?", "dev_automation": "Fejlfindingsautomatisering", - "dev_only_editable": "Kun automatiseringer defineret i automations.yaml kan debugges.", + "dev_only_editable": "Kun automatiseringer, der har fået tildelt et unikt ID, kan fejlsøges.", "duplicate": "Kopier", "duplicate_automation": "Kopier automatisering", "edit_automation": "Rediger automatisering", @@ -1698,7 +1724,7 @@ "google": { "config_documentation": "Konfigurationsdokumentation", "devices_pin": "Pinkode til sikkerhedsenheder", - "enable_ha_skill": "Aktivér Home Assistant-skill til Google Assistant", + "enable_ha_skill": "Aktivér \"Home Assistant Cloud skill for Google Assistant\"", "enable_state_reporting": "Aktivér tilstandsrapportering", "enter_pin_error": "Pin kunne ikke gemmes:", "enter_pin_hint": "Indtast en pinkode for at bruge sikkerhedsenheder", @@ -1706,6 +1732,8 @@ "info": "Med Google Assistant-integrationen til Home Assistant Cloud kan du styre alle dine Home Assistant-enheder via enhver Google Assistant-aktiveret enhed.", "info_state_reporting": "Hvis du aktiverer tilstandsrapportering, vil Home Assistant sende alle tilstandsændringer af eksponerede entiteter til Google. Dette giver dig mulighed for altid at se de seneste tilstande i Google-appen.", "manage_entities": "Administrer entiteter", + "not_configured_text": "Inden du kan bruge Google Assistant, skal du aktivere \"Home Assistant Cloud skill for Google Assistant\" i Google Home-appen.", + "not_configured_title": "Google Assistent er ikke aktiveret", "security_devices": "Sikkerhedsenheder", "sync_entities": "Synkroniser entiteter til Google", "sync_entities_404_message": "Kunne ikke synkronisere dine entiteter til Google. Sig til Google \"Hey Google, synkronisér mine enheder\" for at synkronisere dine entiteter.", @@ -1874,6 +1902,36 @@ "description": "Ændre Home Assistants generelle konfiguration", "section": { "core": { + "analytics": { + "documentation": "Før du aktiverer dette, skal du sørge for at besøge dokumentationssiden {link} for at forstå, hvilke data du sender, og hvordan de opbevares og anvendes.", + "header": "Analytics", + "instance_id": "Instans-id: {huuid}", + "introduction": "Del dine installationsoplysninger med os for at gøre Home Assistant bedre og hjælpe os med at overbevise producenter om at tilføje lokale funktioner, der fokuserer på beskyttelse af personlige oplysninger.", + "learn_more": "Sådan behandler vi dine data", + "needs_base": "Du skal aktivere basisanalyser, for at denne indstilling er tilgængelig", + "preference": { + "base": { + "description": "Instans-id, version og installationstype.", + "title": "Basisanalyser" + }, + "diagnostics": { + "description": "Del fejlrapporter, hvis der opstår uventede fejl.", + "title": "Diagnostik" + }, + "statistics": { + "description": "Samlet antal anvendte enheder, brugere og andre data.", + "title": "Brugsstatistikker" + }, + "usage_supervisor": { + "description": "Navne, versioner og funktioner.", + "title": "Anvendte integrationer og tilføjelsesprogrammer" + }, + "usage": { + "description": "Navne og versionsoplysninger.", + "title": "Anvendte integrationer" + } + } + }, "core_config": { "edit_requires_storage": "Editor er deaktiveret, fordi config er gemt i 'configuration.yaml'.", "elevation": "Højde", @@ -2061,6 +2119,9 @@ "filtering_by": "Filtrering efter", "show": "Vis" }, + "hassio": { + "button": "Konfigurer" + }, "header": "Konfigurer Home Assistant", "helpers": { "caption": "Hjælpere", @@ -2127,8 +2188,11 @@ "caption": "Integrationer", "config_entry": { "area": "I {area}", + "check_the_logs": "Kontroller logfilerne", + "configure": "Konfigurer", "delete": "Slet", "delete_confirm": "Er du sikker på, at du vil fjerne denne integration?", + "depends_on_cloud": "Afhængig af Cloud tjenester", "device_unavailable": "Enheden er utilgængelig", "devices": "{count} {count, plural,\n one {enhed}\n other {enheder}\n}", "disable_restart_confirm": "Genstart Home Assistant for at fuldføre deaktivering af denne integration", @@ -2148,15 +2212,26 @@ "entity_unavailable": "Entiteten er utilgængelig", "firmware": "Firmware: {version}", "hub": "Forbundet via", + "logs": "logfiler", "manuf": "af {manufacturer}", "no_area": "Intet område", + "not_loaded": "Ikke indlæst", "options": "Indstillinger", + "provided_by_custom_integration": "Leveret af en brugerdefineret integration", "reload": "Genindlæs", "reload_confirm": "Integrationen blev genindlæst", "reload_restart_confirm": "Genstart Home Assistant for at fuldføre genindlæsningen af integrationen", "rename": "Omdøb", "restart_confirm": "Genstart Home Assistant for at fuldføre fjernelsen af denne integration", "services": "{count} {count, plural,\n one {tjeneste}\n other {tjenester}\n}", + "state": { + "failed_unload": "Det lykkedes ikke at fjerne", + "loaded": "Indlæst", + "migration_error": "Migrationsfejl", + "not_loaded": "Ikke indlæst", + "setup_error": "Konfigurationen mislykkedes", + "setup_retry": "Forsøger konfigurationen igen" + }, "system_options": "Systemindstillinger", "unnamed_entry": "Unavngivet post" }, @@ -2176,6 +2251,7 @@ "loading_first_time": "Vent mens integrationen installeres", "next": "Næste", "not_all_required_fields": "Ikke alle påkrævede felter er udfyldt.", + "not_loaded": "Integrationen kunne ikke indlæses, prøv at genstarte Home Assistant.", "pick_flow_step": { "new_flow": "Nej, konfigurer en anden forekomst af {integration}", "title": "Vi opdagede disse, vil du oprette dem?" @@ -2224,8 +2300,17 @@ "logs": { "caption": "Logs", "clear": "Ryd", + "custom_integration": "brugerdefineret integration", "description": "Se logs for Home Assistant", "details": "Logdetaljer ({level})", + "error_from_custom_integration": "Denne fejl stammer fra en brugerdefineret integration.", + "level": { + "critical": "KRITISK", + "debug": "DEBUG", + "error": "FEJL", + "info": "INFO", + "warning": "ADVARSEL" + }, "load_full_log": "Indlæs fuld Home Assistant-log", "loading_log": "Indlæser fejllog...", "multiple_messages": "beskeden forekom først kl. {time} og ses {counter} gange", @@ -2590,7 +2675,7 @@ "min_max": "Genindlæs min / max entiteter", "mqtt": "Genindlæs manuelt konfigurerede MQTT-entiteter", "person": "Genindlæs personer", - "ping": "Genindlæs ping sensorentiteter", + "ping": "Genindlæs ping sensor entiteter", "reload": "Genindlæs {domain}", "rest": "Genindlæs REST entiteter og REST notifikationstjenester", "rpi_gpio": "Genindlæs Raspberry Pi GPIO entiteter", @@ -2735,6 +2820,15 @@ "manufacturer_code_override": "Brugerdefineret producentkode", "value": "Værdi" }, + "configuration_page": { + "shortcuts_title": "Genveje", + "update_button": "Opdater konfiguration", + "zha_options": { + "default_light_transition": "Standard overgangstid for lys (sekunder)", + "enable_identify_on_join": "Aktiver identifikation, når enheder tilsluttes netværket", + "title": "Globale indstillinger" + } + }, "device_pairing_card": { "CONFIGURED": "Konfiguration fuldført", "CONFIGURED_status_text": "Initialiserer", @@ -2861,9 +2955,11 @@ }, "logs": { "log_level": "Log niveau", - "subscribed_to_logs": "Abboner på Z-Wave JS Log beskeder" + "subscribed_to_logs": "Abboner på Z-Wave JS Log beskeder", + "title": "Z-Wave JS-logfiler" }, "navigation": { + "logs": "Logfiler", "network": "Netværk" }, "network_status": { @@ -2878,6 +2974,7 @@ "header": "Konfiguration af Z-Wave-enhed", "introduction": "Administrer og juster enheds (node) specifikke konfigurationsparametre for den valgte enhed", "parameter_is_read_only": "Denne parameter er skrivebeskyttet.", + "set_param_accepted": "Parameteren er blevet opdateret.", "set_param_error": "Der opstod en fejl", "set_param_queued": "Parameterændringen er sat i kø, og vil blive udført når enheden vågner", "zwave_js_device_database": "Z-Wave JS-enhedsdatabasen" @@ -2890,7 +2987,14 @@ "unknown": "Ukendt" }, "reinterview_node": { - "interview_complete": "Enhedsinformationsudveksling er færdig" + "battery_device_warning": "Du skal vække batteridrevne enheder, inden du starter forespørgslen. Se enhedens manual for instruktioner om, hvordan du vækker enheden.", + "in_progress": "Enheden forespørges. Dette kan tage noget tid.", + "interview_complete": "Enhedsinformationsudveksling er færdig", + "interview_failed": "Forespørgsel af enheden er mislykkedes. Der kan være yderligere oplysninger i logfilerne.", + "introduction": "Gentag forespørgsel af en enhed på dit Z-Wave-netværk. Brug denne funktion, hvis enheden har manglende eller forkert funktionalitet.", + "run_in_background": "Du kan lukke denne dialog og forespørgslen fortsætter i baggrunden.", + "start_reinterview": "Gentag forespørgsel", + "title": "Gentag forespørgsel af en Z-Wave enhed" }, "remove_node": { "cancel_exclusion": "Annuller udelukkelse", @@ -3042,7 +3146,7 @@ "attributes": "Egenskaber", "copy_id": "Kopier ID til Udklipsholder", "current_entities": "Aktuelle entiteter", - "description1": "Sæt repræsentationen af en enhed i Home Assistant.", + "description1": "Tilpas tilstanden for en enhed i Home Assistant.", "description2": "Dette vil ikke kommunikere med den faktiske enhed.", "entity": "Entitet", "filter_attributes": "Filtrer egenskaber", @@ -3353,7 +3457,7 @@ "name": "Billedentitet" }, "picture-glance": { - "description": "Billedblik-kortet viser et billede og den tilsvarende entitetstilstand som et ikon. Entiteterne på højre side tillader at skifte handlinger, andre viser dialogboksen for mere information.", + "description": "Billedblik-kortet viser et billede og den tilsvarende tilstand for en entitet som et ikon. Entiteterne på højre side tillader at skifte handlinger, andre viser dialogboksen for mere information.", "name": "Billedblik", "state_entity": "Entitet status" }, @@ -3731,6 +3835,10 @@ } }, "page-onboarding": { + "analytics": { + "finish": "Næste", + "intro": "Del analysedata fra din installation. Delte data vil være offentligt tilgængelige på {link}" + }, "core-config": { "button_detect": "Detekter", "finish": "Næste", @@ -3740,12 +3848,14 @@ "location_name": "Navn på din Home Assistant-installation", "location_name_default": "Hjem" }, + "finish": "Afslut", "integration": { "finish": "Afslut", "intro": "Enheder og tjenester er repræsenteret i Home Assistant som integrationer. Du kan konfigurere dem nu eller gøre det senere fra konfigurationsskærmen.", "more_integrations": "Mere" }, "intro": "Er du klar til at vække dit hjem til live, genvinde dit privatliv og blive medlem af et verdensomspændende fællesskab af tinkerers?", + "next": "Næste", "restore": { "description": "Alternativt kan du gendanne fra et tidligere snapshot.", "hide_log": "Skjul fuld log", diff --git a/translations/frontend/de.json b/translations/frontend/de.json index 15b45c2dbf..815a52c017 100644 --- a/translations/frontend/de.json +++ b/translations/frontend/de.json @@ -384,6 +384,7 @@ "create": "Erstellen", "create_blocked_not_running": "Das Erstellen eines Snapshots ist derzeit nicht möglich, da sich das System im Zustand {state} befindet.", "create_snapshot": "Datensicherung erstellen", + "created": "Erstellt", "description": "Datensicherungen ermöglichen dir das leichte Speichern und Wiederherstellen von allen Daten aus Home Assistant.", "enter_password": "Bitte Passwort eingeben.", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "Erhalte stabile Updates für Home Assistant, Supervisor und Host", "ram_usage": "Arbeitsspeicherbedarf von Supervisor", "reload_supervisor": "Supervisor neu laden", + "search": "Suche", "share_diagnostics": "Diagnose teilen", "share_diagnostics_description": "Teile Absturzberichte und Diagnoseinformationen.", "share_diagonstics_description": "Möchtest du Absturzberichte und Diagnoseinformationen automatisch freigeben, wenn der Supervisor auf unerwartete Fehler stößt? {line_break} Auf diese Weise können wir die Probleme beheben. Die Informationen sind nur für das Home Assistant Core Team zugänglich und werden nicht an andere weitergegeben. {line_break} Die Daten enthalten keine privaten/sensiblen Informationen und du kannst diese jederzeit in den Einstellungen deaktivieren.", diff --git a/translations/frontend/es.json b/translations/frontend/es.json index 44748ca611..6d965defbb 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -384,6 +384,7 @@ "create": "Crear", "create_blocked_not_running": "No es posible crear una instantánea en este momento porque el sistema está en el estado {state}.", "create_snapshot": "Crear instantánea", + "created": "Creado", "description": "Las instantáneas te permiten realizar copias de seguridad y restaurar fácilmente todos los datos de tu instancia de Home Assistant.", "enter_password": "Por favor, introduce una contraseña.", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "Obtén actualizaciones estables para Home Assistant, Supervisor y el host", "ram_usage": "Uso de RAM del Supervisor", "reload_supervisor": "Recargar el Supervisor", + "search": "Búsqueda", "share_diagnostics": "Compartir diagnósticos", "share_diagnostics_description": "Comparte informes de fallos e información de diagnóstico.", "share_diagonstics_description": "¿Te gustaría compartir automáticamente informes de fallos e información de diagnóstico cuando el Supervisor encuentra errores inesperados? {line_break} Esto nos permitirá solucionar los problemas, la información solo es accesible para el equipo principal de Home Assistant y no se compartirá con otros. {line_break} Los datos no incluyen ninguna información privada/confidencial y puedes desactivar esto en la configuración en cualquier momento que desees.", diff --git a/translations/frontend/fr.json b/translations/frontend/fr.json index a22c8db759..2a9dac1081 100644 --- a/translations/frontend/fr.json +++ b/translations/frontend/fr.json @@ -384,6 +384,7 @@ "create": "Créer", "create_blocked_not_running": "La création d’un instantané n’est pas possible en ce moment car le système est en état {state}.", "create_snapshot": "Créer un instantané", + "created": "créé", "description": "Les instantanés vous permettent de sauvegarder et de restaurer facilement toutes les données de votre instance Home Assistant.", "enter_password": "Veuillez entrer un mot de passe.", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "Obtenez des mises à jour stables pour l'assistant domestique, le Superviseur et l'hôte", "ram_usage": "Utilisation de la RAM du Superviseur", "reload_supervisor": "Recharger le Superviseur", + "search": "Recherche", "share_diagnostics": "Partager les diagnostics", "share_diagnostics_description": "Partagez les rapports d'incident et les informations de diagnostic.", "share_diagonstics_description": "Souhaitez-vous partager automatiquement les rapports d'erreur et les informations de diagnostic lorsque le Superviseur rencontre des erreurs inattendues? {line_break} Cela nous permettra de résoudre les problèmes, les informations ne sont accessibles qu'à l'équipe Home Assistant Core et ne seront pas partagées avec d'autres. {line_break} Les données n'incluent aucune information privée / sensible et vous pouvez désactiver cela dans les paramètres à tout moment.", diff --git a/translations/frontend/it.json b/translations/frontend/it.json index 0bdb85893c..4737b24302 100644 --- a/translations/frontend/it.json +++ b/translations/frontend/it.json @@ -391,7 +391,7 @@ "addons/local": "Componenti aggiuntivi locali", "homeassistant": "Configurazione di Home Assistant", "media": "Media", - "share": "Share", + "share": "Condividi", "ssl": "SSL" }, "folders": "Cartelle", diff --git a/translations/frontend/ko.json b/translations/frontend/ko.json index 8656b787a0..8a43eb9a67 100644 --- a/translations/frontend/ko.json +++ b/translations/frontend/ko.json @@ -383,6 +383,7 @@ "create": "생성하기", "create_blocked_not_running": "시스템이 {state} 상태이기 때문에 지금은 스냅숏을 생성할 수 없습니다.", "create_snapshot": "스냅숏 생성하기", + "created": "생성됨", "description": "스냅숏을 사용하면 Home Assistant 인스턴스의 모든 데이터를 쉽게 백업하고 복원할 수 있습니다.", "enter_password": "비밀번호를 입력해주세요.", "folder": { @@ -458,6 +459,7 @@ "leave_beta_description": "Home Assistant, Supervisor 및 호스트의 공식 업데이트를 가져옵니다", "ram_usage": "Supervisor RAM 사용량", "reload_supervisor": "Supervisor 다시 읽어오기", + "search": "검색", "share_diagnostics": "진단 정보 공유하기", "share_diagnostics_description": "충돌 보고서 및 진단 정보를 공유합니다.", "share_diagonstics_description": "Supervisor에서 예기치 않은 오류가 발생한 경우 충돌 보고서 및 진단 정보를 자동으로 공유하시겠습니까? {line_break} 공유된 내용으로 발생된 문제를 해결할 수 있으며, 해당 정보는 Home Assistant Core 팀에서만 접근할 수 있을 뿐, 다른 사람과 공유되지 않습니다.{line_break} 데이터에는 개인정보 및 민감한 정보가 포함되어 있지 않으므로 언제든지 설정에서 이 정보를 사용하지 않도록 설정할 수 있습니다.", diff --git a/translations/frontend/nb.json b/translations/frontend/nb.json index 430ea2ad1c..1d6f5abef8 100644 --- a/translations/frontend/nb.json +++ b/translations/frontend/nb.json @@ -384,6 +384,7 @@ "create": "Opprett", "create_blocked_not_running": "Å lage en sikkerhetskopi er ikke mulig akkurat nå fordi systemet er i {state} status", "create_snapshot": "Opprett sikkerhetskopi", + "created": "Opprettet", "description": "Sikkerhetskopier lar deg enkelt sikkerhetskopiere og gjenopprette alle dataene fra din Home Assistant forekomst", "enter_password": "Vennligst skriv inn et passord", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "Få stabile oppdateringer for Home Assistant, Supervisor og vert", "ram_usage": "Supervisor RAM forbruk", "reload_supervisor": "Last inn Supervisor på nytt", + "search": "Søk", "share_diagnostics": "Del diagnostikk", "share_diagnostics_description": "Del krasjrapporter og diagnoseinformasjon", "share_diagonstics_description": "Vil du automatisk dele krasjrapporter og diagnostisk informasjon når Supervisor møter på uventede feil? {line_break} Dette vil tillate oss å løse problemene, informasjonen er bare tilgjengelig for Home Assistant Core-teamet og deles ikke med andre. {line_break} Dataene inkluderer ikke privat / sensitiv informasjon, og du kan deaktivere dette i innstillingene når som helst.", diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index 66b7ed8961..a15b607d56 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -384,6 +384,7 @@ "create": "新增", "create_blocked_not_running": "由於系統為 {state} 狀態,無法製作系統備份。", "create_snapshot": "製作系統備份", + "created": "建立", "description": "系統備份可供您快速的備份與還原 Home Assistant 所有資料。", "enter_password": "請輸入密碼。", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "取得 Home Assistant、Supervisor 與主機穩定更新版", "ram_usage": "Supervisor RAM 使用率", "reload_supervisor": "重新載入 Supervisor", + "search": "搜尋", "share_diagnostics": "分享診斷資料", "share_diagnostics_description": "分享當機回報與診斷資訊。", "share_diagonstics_description": "是否要於 Supervisor 遭遇未知錯誤時、自動分享當機回報與診斷資訊?{line_break} 此些訊息將協助我們修正問題、所提供的資訊僅供 Home Assistant Core 團隊分析使用、將不會與其他人員共享。{line_break} 所提供的資料並不包含任何私人/敏感資訊,您可以於之後隨時關閉此設定。", From d35168e88f1db060a79dc816295b84c60bd8c113 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 13 May 2021 02:09:21 +0200 Subject: [PATCH 037/117] Bump chart.js (#9160) Replaces #9159 --- package.json | 4 ++-- yarn.lock | 21 +++++++++------------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 9c6d53bd32..cc97f462af 100644 --- a/package.json +++ b/package.json @@ -98,8 +98,8 @@ "@vibrant/quantizer-mmcq": "^3.2.1-alpha.1", "@vue/web-component-wrapper": "^1.2.0", "@webcomponents/webcomponentsjs": "^2.2.7", - "chart.js": "~2.8.0", - "chartjs-chart-timeline": "^0.3.0", + "chart.js": "^2.9.4", + "chartjs-chart-timeline": "^0.4.0", "comlink": "^4.3.0", "core-js": "^3.6.5", "cropperjs": "^1.5.7", diff --git a/yarn.lock b/yarn.lock index 976a7db2de..afcc8908b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4627,21 +4627,18 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -chart.js@~2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-2.8.0.tgz#b703b10d0f4ec5079eaefdcd6ca32dc8f826e0e9" - integrity sha512-Di3wUL4BFvqI5FB5K26aQ+hvWh8wnP9A3DWGvXHVkO13D3DSnaSsdZx29cXlEsYKVkn1E2az+ZYFS4t0zi8x0w== +chart.js@2.9.4, chart.js@^2.9.4: + version "2.9.4" + resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-2.9.4.tgz#0827f9563faffb2dc5c06562f8eb10337d5b9684" + integrity sha512-B07aAzxcrikjAPyV+01j7BmOpxtQETxTSlQ26BEYJ+3iUkbNKaOJ/nDbT6JjyqYxseM0ON12COHYdU2cTIjC7A== dependencies: chartjs-color "^2.1.0" moment "^2.10.2" -chartjs-chart-timeline@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/chartjs-chart-timeline/-/chartjs-chart-timeline-0.3.0.tgz#0cd07ad4380d05104162382006d52a02e581decf" - integrity sha512-/smXdf/1yRpp1dUZ1EPJ8l/Cys4fvyLoBgej4uulgC9rlYRIZ3pCIYW6JJbAomFQsNwk6jv7VKlLPCPqxb0oZQ== - dependencies: - chart.js "~2.8.0" - moment "^2.22.0" +chartjs-chart-timeline@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/chartjs-chart-timeline/-/chartjs-chart-timeline-0.4.0.tgz#cbd25dc5ddb5c2b34289f8dd7a2a627d71e251e8" + integrity sha512-a3iOFgMUXgEK9zyDFXlL7cfhO6z4DkeuGqok1xnNVNg12ciSt/k1jDBFk8JKN+sVNZfoqeGAFBT9zvb++iEWnA== chartjs-color-string@^0.6.0: version "0.6.0" @@ -9413,7 +9410,7 @@ mocha@^7.2.0: yargs-parser "13.1.2" yargs-unparser "1.6.0" -moment@^2.10.2, moment@^2.22.0: +moment@^2.10.2: version "2.24.0" resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg== From 4910f60ec40b65166962a002da6fd85d293b4b24 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 13 May 2021 01:54:52 +0000 Subject: [PATCH 038/117] Translation update --- translations/frontend/cs.json | 2 ++ translations/frontend/es.json | 4 ++-- translations/frontend/ja.json | 17 ++++++++++++++--- translations/frontend/ko.json | 12 +++++++----- translations/frontend/pl.json | 3 +++ translations/frontend/zh-Hans.json | 2 ++ translations/frontend/zh-Hant.json | 2 +- 7 files changed, 31 insertions(+), 11 deletions(-) diff --git a/translations/frontend/cs.json b/translations/frontend/cs.json index 469db602ec..75809ef4b0 100644 --- a/translations/frontend/cs.json +++ b/translations/frontend/cs.json @@ -383,6 +383,7 @@ "create": "Vytvořit", "create_blocked_not_running": "Vytvoření zálohy není momentálně možné, protože systém je ve \"{state}\".", "create_snapshot": "Vytvořit zálohu", + "created": "Vytvořeno", "description": "Zálohy umožňují snadno zálohovat a obnovovat všechna data vaší instance Home Assistant.", "enter_password": "Prosím zadejte heslo.", "folder": { @@ -458,6 +459,7 @@ "leave_beta_description": "Získejte stabilní aktualizace pro Home Assistant, Supervisor a hostitele", "ram_usage": "Využití paměti RAM Supervisorem", "reload_supervisor": "Nově načíst Supervisor", + "search": "Hledat", "share_diagnostics": "Sdílet diagnostické informace", "share_diagnostics_description": "Sdílejte zprávy o selhání a diagnostické informace.", "share_diagonstics_description": "Chcete automaticky sdílet zprávy o selhání a diagnostické informace, když Supervisor narazí na neočekávané chyby? {line_break} To nám umožní vyřešit problémy, informace jsou přístupné pouze týmu Home Assistant Core a nebudou sdíleny s ostatními. {line_break} Data neobsahují žádné soukromé / citlivé informace a tato volba může být kdykoliv deaktivována v nastavení.", diff --git a/translations/frontend/es.json b/translations/frontend/es.json index 6d965defbb..0e17ff8e2b 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -384,7 +384,7 @@ "create": "Crear", "create_blocked_not_running": "No es posible crear una instantánea en este momento porque el sistema está en el estado {state}.", "create_snapshot": "Crear instantánea", - "created": "Creado", + "created": "Creada", "description": "Las instantáneas te permiten realizar copias de seguridad y restaurar fácilmente todos los datos de tu instancia de Home Assistant.", "enter_password": "Por favor, introduce una contraseña.", "folder": { @@ -460,7 +460,7 @@ "leave_beta_description": "Obtén actualizaciones estables para Home Assistant, Supervisor y el host", "ram_usage": "Uso de RAM del Supervisor", "reload_supervisor": "Recargar el Supervisor", - "search": "Búsqueda", + "search": "Buscar", "share_diagnostics": "Compartir diagnósticos", "share_diagnostics_description": "Comparte informes de fallos e información de diagnóstico.", "share_diagonstics_description": "¿Te gustaría compartir automáticamente informes de fallos e información de diagnóstico cuando el Supervisor encuentra errores inesperados? {line_break} Esto nos permitirá solucionar los problemas, la información solo es accesible para el equipo principal de Home Assistant y no se compartirá con otros. {line_break} Los datos no incluyen ninguna información privada/confidencial y puedes desactivar esto en la configuración en cualquier momento que desees.", diff --git a/translations/frontend/ja.json b/translations/frontend/ja.json index 7e032802f8..7f29e0c996 100644 --- a/translations/frontend/ja.json +++ b/translations/frontend/ja.json @@ -377,6 +377,7 @@ "create": "作成", "create_blocked_not_running": "システムが {state} 状態であるため、スナップショットの作成は現在できません。", "create_snapshot": "スナップショットの作成", + "created": "作成", "description": "スナップショットでは、Home Assistantインスタンスのすべてのデータを簡単にバックアップして復元することができます。", "enter_password": "パスワードを入力してください。", "folder": { @@ -452,6 +453,7 @@ "leave_beta_description": "Home Assistant、Supervisor、およびホストの安定した更新を取得する", "ram_usage": "SupervisorのRAM使用量", "reload_supervisor": "リロード Supervisor", + "search": "検索", "share_diagnostics": "診断の共有", "share_diagnostics_description": "クラッシュ レポートと診断情報を共有します。", "share_diagonstics_description": "スーパーバイザで予期しないエラーが発生したときに、クラッシュ レポートと診断情報を自動的に共有しますか?{line_break}これにより、問題を解決することができ、情報はホームアシスタントコアチームにのみアクセス可能であり、他の人と共有されません。{line_break}データには、個人情報や機密情報は含まれていないので、いつでも設定でこれを無効にすることができます。", @@ -1109,7 +1111,7 @@ "input_text": "入力テキストを再読み込み", "min_max": "最小/最大エンティティをリロードします", "mqtt": "mqttエンティティをリロードします", - "person": "人の再読込", + "person": "人", "ping": "pingバイナリセンサーエンティティをリロードします", "reload": "{domain}をリロードします", "rest": "残りのエンティティをリロードし通知します", @@ -1227,7 +1229,7 @@ "started": "ホームアシスタントが開始されました!", "starting": "Home Assistantが起動中です。全て利用可能なるまでもうしばらくお待ち下さい。", "triggered": "トリガーしました {name}", - "wrapping_up_startup": "スタートアップを総括すると、完成するまですべてが公開されるわけではありません。" + "wrapping_up_startup": "スタートアップの締めくくりとして、終了するまですべてが利用できるわけではありません。" }, "panel": { "config": { @@ -2612,7 +2614,7 @@ "introduction": "Home Assistant の一部は、再起動を必要とせずに再読込できます。再読込を押すと、現在の設定をアンロードし、新しい設定を読み込みます。", "min_max": "最小/最大エンティティを再読み込み", "mqtt": "mqtt エンティティの再読み込み", - "person": "人の再読込", + "person": "人", "ping": "ping バイナリ センサー エンティティの再読み込み", "reload": "{domain} の再読み込み", "rest": "残りのエンティティの再読み込み", @@ -2758,6 +2760,12 @@ "manufacturer_code_override": "製造元コードの上書き", "value": "バリュー" }, + "configuration_page": { + "zha_options": { + "default_light_transition": "デフォルトのライト遷移時間(秒)", + "enable_identify_on_join": "デバイスがネットワークに参加する際に、識別効果を有効にする" + } + }, "device_pairing_card": { "CONFIGURED": "設定の完了", "CONFIGURED_status_text": "初期化中", @@ -2906,6 +2914,9 @@ "dead": "停止中", "unknown": "不明" }, + "reinterview_node": { + "title": "Z-Waveデバイスへの再インタビュー" + }, "remove_node": { "cancel_exclusion": "除外をキャンセルする", "controller_in_exclusion_mode": "Z-Wave コントローラが除外モードになりました。", diff --git a/translations/frontend/ko.json b/translations/frontend/ko.json index 8a43eb9a67..2dec8ee36b 100644 --- a/translations/frontend/ko.json +++ b/translations/frontend/ko.json @@ -1923,11 +1923,11 @@ }, "usage_supervisor": { "description": "이름, 버전 그리고 기타 정보.", - "title": "사용된 통합 구성요소 및 애드온" + "title": "사용된 통합구성요소 및 애드온" }, "usage": { "description": "이름과 버전 정보.", - "title": "사용된 통합 구성요소" + "title": "사용된 통합구성요소" } } }, @@ -2119,7 +2119,7 @@ "show": "표시하기" }, "hassio": { - "button": "구성하기" + "button": "구성" }, "header": "Home Assistant 구성하기", "helpers": { @@ -2191,6 +2191,7 @@ "configure": "구성", "delete": "삭제하기", "delete_confirm": "이 통합 구성요소를 제거하시겠습니까?", + "depends_on_cloud": "클라우드 서비스", "device_unavailable": "기기 사용불가", "devices": "{count} {count, plural,\none{개의 기기}\nother{개의 기기}\n}", "disable_restart_confirm": "이 통합 구성요소를 비활성화하려면 Home Assistant를 다시 시작해주세요", @@ -2215,6 +2216,7 @@ "no_area": "영역 없음", "not_loaded": "로드되지 않음", "options": "옵션", + "provided_by_custom_integration": "사용자 통합구성요소", "reload": "다시 읽어오기", "reload_confirm": "통합 구성요소를 다시 읽어 들였습니다", "reload_restart_confirm": "이 통합 구성요소를 다시 읽어 들일려면 Home Assistant를 다시 시작해주세요", @@ -2920,7 +2922,7 @@ "use_secure_inclusion": "암호화 연결 사용하기", "view_device": "기기 보기" }, - "button": "구성하기", + "button": "구성", "common": { "add_node": "노드 추가하기", "close": "닫기", @@ -2944,7 +2946,7 @@ "server_version": "서버 버전" }, "device_info": { - "device_config": "기기 구성하기", + "device_config": "기기 구성", "node_ready": "노드 준비", "node_status": "노드 상태", "zwave_info": "Z-Wave 정보" diff --git a/translations/frontend/pl.json b/translations/frontend/pl.json index d92661fa47..be5aa52505 100644 --- a/translations/frontend/pl.json +++ b/translations/frontend/pl.json @@ -366,6 +366,7 @@ }, "my": { "error": "Wystąpił nieznany błąd", + "error_addon_no_ingress": "Żądany dodatek nie obsługuje osadzania", "error_addon_not_found": "Nie znaleziono dodatku", "faq_link": "Mój Home Assistant - często zadawane pytania", "not_supported": "To przekierowanie nie jest obsługiwane przez Twoją instancję Home Assistanta. Sprawdź {link} aby znaleźć obsługiwane przekierowania i wersję, w której zostały wprowadzone." @@ -383,6 +384,7 @@ "create": "Utwórz", "create_blocked_not_running": "Tworzenie snapshota nie jest teraz możliwe, ponieważ system jest w {state}.", "create_snapshot": "Utwórz snapshot", + "created": "Utworzony", "description": "Snapshoty umożliwiają łatwe tworzenie kopii zapasowych i przywracanie wszystkich danych instancji Home Assistant.", "enter_password": "Proszę wprowadzić hasło", "folder": { @@ -458,6 +460,7 @@ "leave_beta_description": "Pobieraj stabilne aktualizacje dla Home Assistanta, Supervisora i hosta", "ram_usage": "Zużycie pamięci przez Supervisora", "reload_supervisor": "Wczytaj ponownie", + "search": "Szukaj", "share_diagnostics": "Udostępnij dane diagnostyczne", "share_diagnostics_description": "Udostępniaj raporty o awariach i informacje diagnostyczne.", "share_diagonstics_description": "Czy chcesz automatycznie udostępniać raporty o awariach i informacje diagnostyczne, gdy Supervisor napotka nieoczekiwane błędy? {line_break} Pozwoli nam to rozwiązać problemy, informacje są dostępne tylko dla głównego zespołu Home Assistant Core i nie będą udostępniane innym. {line_break} Dane nie zawierają żadnych prywatnych/wrażliwych informacji i możesz to wyłączyć w ustawieniach w dowolnym momencie.", diff --git a/translations/frontend/zh-Hans.json b/translations/frontend/zh-Hans.json index edafb51850..eaf84654d4 100644 --- a/translations/frontend/zh-Hans.json +++ b/translations/frontend/zh-Hans.json @@ -384,6 +384,7 @@ "create": "创建", "create_blocked_not_running": "现在无法创建快照,因为系统处于{state}状态。", "create_snapshot": "创建快照", + "created": "创建于", "description": "“快照”使您可以轻松地备份和还原 Home Assistant 实例的所有数据。", "enter_password": "请输入密码。", "folder": { @@ -459,6 +460,7 @@ "leave_beta_description": "获取 Home Assistant、Supervisor 和主机的稳定版更新", "ram_usage": "Supervisor 内存使用率", "reload_supervisor": "重载 Supervisor", + "search": "搜索", "share_diagnostics": "共享诊断信息", "share_diagnostics_description": "共享崩溃报告和诊断信息。", "share_diagonstics_description": "您想要在 Supervisor 遇到异常错误时,共享崩溃报告和诊断信息吗?{line_break}这将帮助我们解决问题,此信息仅限 Home Assistant Core 团队访问,不会共享给他人。{line_break}此信息不包含私密、敏感信息,您可以随时在设置中将其禁用。", diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index a15b607d56..ed0f3b68a1 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -632,7 +632,7 @@ "humidity": "濕度", "precipitation": "降雨量", "temperature": "溫度", - "visibility": "顯示選項", + "visibility": "能見度", "wind_speed": "風速" }, "cardinal_direction": { From 6a62f0565768ee1206cb1611bb9e6caee2d94e03 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 14 May 2021 01:54:56 +0000 Subject: [PATCH 039/117] Translation update --- translations/frontend/cs.json | 33 ++++++++++++++++++++++++++++++--- translations/frontend/nl.json | 2 +- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/translations/frontend/cs.json b/translations/frontend/cs.json index 75809ef4b0..fe65fa927f 100644 --- a/translations/frontend/cs.json +++ b/translations/frontend/cs.json @@ -366,6 +366,7 @@ }, "my": { "error": "Nastala neznámá chyba", + "error_addon_no_ingress": "Požadovaný doplněk nepodporuje ingress", "error_addon_not_found": "Doplněk nebyl nalezen", "faq_link": "Časté dotazy týkající se My Home Assistant", "not_supported": "Toto přesměrování není vaší instancí Home Assistant podporováno. Zkontrolujte {link} pro podporovaná přesměrování a verzi, ve které byla zavedena." @@ -563,9 +564,11 @@ }, "light": { "brightness": "Jas", + "cold_white_value": "Jas studené bílé", "color_brightness": "Jas barev", "color_temperature": "Teplota barvy", "effect": "Efekt", + "warm_white_value": "Jas teplé bílé", "white_value": "Jas bílé" }, "lock": { @@ -1197,7 +1200,14 @@ } }, "zha_reconfigure_device": { - "heading": "Znovunastavení zařízení" + "button_show": "Podrobnosti", + "cluster_header": "Klastr", + "configuration_complete": "Změna konfigurace zařízení dokončena.", + "configuration_failed": "Rekonfigurace zařízení se nezdařila. Další informace mohou být k dispozici v protokolech.", + "configuring_alt": "Nastavuji", + "heading": "Znovunastavení zařízení", + "in_progress": "Zařízení se překonfigurová. Může to chvíli trvat.", + "start_reconfiguration": "Spustit rekonfiguraci" } }, "duration": { @@ -1738,7 +1748,8 @@ "link_learn_how_it_works": "Zjistěte, jak to funguje", "not_connected": "Nepřipojeno", "remote_enabled": { - "caption": "Automaticky se připojit" + "caption": "Automaticky se připojit", + "description": "Povolením této možnosti zajistíte, aby byla vaše instance Home Assistant vždy vzdáleně přístupná." }, "title": "Vzdálené ovládání" }, @@ -2801,7 +2812,11 @@ "value": "Hodnota" }, "configuration_page": { - "update_button": "Aktualizovat nastavení" + "shortcuts_title": "Zástupci", + "update_button": "Aktualizovat nastavení", + "zha_options": { + "title": "Globální možnosti" + } }, "device_pairing_card": { "CONFIGURED": "Nastavení dokončeno", @@ -2927,7 +2942,11 @@ "node_status": "Stav uzlu", "zwave_info": "Z-Wave Info" }, + "logs": { + "title": "Z-Wave JS protokoly" + }, "navigation": { + "logs": "Protokoly", "network": "Síť" }, "network_status": { @@ -2942,6 +2961,9 @@ "header": "Konfigurace zařízení Z-Wave", "introduction": "Spravujte a upravujte specifické konfigurační parametry zařízení (uzlu) pro vybrané zařízení", "parameter_is_read_only": "Tento parametr je jen pro čtení.", + "set_param_accepted": "Parametr byl aktualizován.", + "set_param_error": "Vyskytla se chyba.", + "set_param_queued": "Změna parametru byla zařazena do fronty a bude aktualizována, jakmile se zařízení probudí.", "zwave_js_device_database": "Databáze zařízení Z-Wave JS" }, "node_status": { @@ -2951,6 +2973,11 @@ "dead": "Mrtvý", "unknown": "Nezjištěno" }, + "reinterview_node": { + "interview_complete": "Pohovor se zařízením dokončen.", + "run_in_background": "Toto dialogové okno můžete zavřít a rozhovor bude pokračovat na pozadí.", + "start_reinterview": "Zahájit opakovaný rozhovor" + }, "remove_node": { "cancel_exclusion": "Zrušit vyloučení", "controller_in_exclusion_mode": "Kontroler Z-Wave je nyní v režimu vyloučení.", diff --git a/translations/frontend/nl.json b/translations/frontend/nl.json index f4e5208080..e4e24799c8 100644 --- a/translations/frontend/nl.json +++ b/translations/frontend/nl.json @@ -1671,7 +1671,7 @@ "error_no_url": "Voer de URL van de Blueprint in.", "file_name": "Blueprint pad", "header": "Voeg een nieuwe Blueprint toe", - "import_btn": "Bekijk een Blueprint", + "import_btn": "Bekijk deze Blueprint", "import_header": "Blueprint \"{name}\"", "import_introduction_link": "U kunt Blueprints van andere gebruikers importeren vanuit Github en de {community_link} . Voer de URL van de Blueprint hieronder in.", "importing": "Blueprint importeren ...", From 2ad2a4b198a52d42369a8ce4d14964180f4173aa Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 14 May 2021 07:47:47 +0200 Subject: [PATCH 040/117] Bump lokalize deps + support object format for args (#9155) Co-authored-by: Paulus Schoutsen --- package.json | 7 +- src/common/translations/localize.ts | 59 +++++---- .../config-flow/show-dialog-config-flow.ts | 16 +-- .../config-flow/show-dialog-options-flow.ts | 7 +- .../integrations/ha-config-integrations.ts | 11 +- .../dialog-ha-mfa-module-setup-flow.ts | 4 +- src/panels/profile/ha-panel-profile.ts | 8 +- src/panels/profile/ha-refresh-tokens-card.ts | 28 +++-- yarn.lock | 118 +++++++++--------- 9 files changed, 124 insertions(+), 134 deletions(-) diff --git a/package.json b/package.json index cc97f462af..671905fdcc 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,9 @@ "@codemirror/stream-parser": "^0.18.0", "@codemirror/text": "^0.18.0", "@codemirror/view": "^0.18.0", - "@formatjs/intl-getcanonicallocales": "^1.4.6", - "@formatjs/intl-pluralrules": "^3.4.10", + "@formatjs/intl-getcanonicallocales": "^1.5.10", + "@formatjs/intl-locale": "^2.4.24", + "@formatjs/intl-pluralrules": "^4.0.18", "@fullcalendar/common": "5.1.0", "@fullcalendar/core": "5.1.0", "@fullcalendar/daygrid": "5.1.0", @@ -111,7 +112,7 @@ "hls.js": "^1.0.3", "home-assistant-js-websocket": "^5.10.0", "idb-keyval": "^3.2.0", - "intl-messageformat": "^8.3.9", + "intl-messageformat": "^9.6.13", "js-yaml": "^3.13.1", "leaflet": "^1.7.1", "leaflet-draw": "^1.0.4", diff --git a/src/common/translations/localize.ts b/src/common/translations/localize.ts index 94edcc8a7a..72042fcd3f 100644 --- a/src/common/translations/localize.ts +++ b/src/common/translations/localize.ts @@ -3,7 +3,6 @@ import IntlMessageFormat from "intl-messageformat"; import { Resources } from "../../types"; export type LocalizeFunc = (key: string, ...args: any[]) => string; - interface FormatType { [format: string]: any; } @@ -13,12 +12,17 @@ export interface FormatsType { time: FormatType; } +let loadedPolyfillLocale: Set | undefined; + let polyfillLoaded = !shouldPolyfill(); const polyfillProm = polyfillLoaded ? undefined - : import("@formatjs/intl-pluralrules/polyfill-locales").then(() => { - polyfillLoaded = true; - }); + : import("@formatjs/intl-locale/polyfill") + .then(() => import("@formatjs/intl-pluralrules/polyfill")) + .then(() => { + loadedPolyfillLocale = new Set(); + polyfillLoaded = true; + }); /** * Adapted from Polymer app-localize-behavior. @@ -51,6 +55,15 @@ export const computeLocalize = async ( await polyfillProm; } + if (loadedPolyfillLocale && !loadedPolyfillLocale.has(language)) { + try { + loadedPolyfillLocale.add(language); + await import("@formatjs/intl-pluralrules/locale-data/en"); + } catch (_e) { + // Ignore + } + } + // Everytime any of the parameters change, invalidate the strings cache. cache._localizationCache = {}; @@ -68,7 +81,9 @@ export const computeLocalize = async ( } const messageKey = key + translatedValue; - let translatedMessage = cache._localizationCache[messageKey]; + let translatedMessage = cache._localizationCache[messageKey] as + | IntlMessageFormat + | undefined; if (!translatedMessage) { translatedMessage = new IntlMessageFormat( @@ -79,37 +94,19 @@ export const computeLocalize = async ( cache._localizationCache[messageKey] = translatedMessage; } - const argObject = {}; - for (let i = 0; i < args.length; i += 2) { - argObject[args[i]] = args[i + 1]; + let argObject = {}; + if (args.length === 1 && typeof args[0] === "object") { + argObject = args[0]; + } else { + for (let i = 0; i < args.length; i += 2) { + argObject[args[i]] = args[i + 1]; + } } try { - return translatedMessage.format(argObject); + return translatedMessage.format(argObject) as string; } catch (err) { return "Translation " + err; } }; }; - -/** - * Silly helper function that converts an object of placeholders to array so we - * can convert it back to an object again inside the localize func. - * @param localize - * @param key - * @param placeholders - */ -export const localizeKey = ( - localize: LocalizeFunc, - key: string, - placeholders?: Record -) => { - const args: [string, ...string[]] = [key]; - if (placeholders) { - Object.keys(placeholders).forEach((placeholderKey) => { - args.push(placeholderKey); - args.push(placeholders[placeholderKey]); - }); - } - return localize(...args); -}; diff --git a/src/dialogs/config-flow/show-dialog-config-flow.ts b/src/dialogs/config-flow/show-dialog-config-flow.ts index 452d83cb22..207429fcfe 100644 --- a/src/dialogs/config-flow/show-dialog-config-flow.ts +++ b/src/dialogs/config-flow/show-dialog-config-flow.ts @@ -1,6 +1,5 @@ import { html } from "lit-element"; import { caseInsensitiveCompare } from "../../common/string/compare"; -import { localizeKey } from "../../common/translations/localize"; import { createConfigFlow, deleteConfigFlow, @@ -52,8 +51,7 @@ export const showConfigFlowDialog = ( deleteFlow: deleteConfigFlow, renderAbortDescription(hass, step) { - const description = localizeKey( - hass.localize, + const description = hass.localize( `component.${step.handler}.config.abort.${step.reason}`, step.description_placeholders ); @@ -74,8 +72,7 @@ export const showConfigFlowDialog = ( }, renderShowFormStepDescription(hass, step) { - const description = localizeKey( - hass.localize, + const description = hass.localize( `component.${step.handler}.config.step.${step.step_id}.description`, step.description_placeholders ); @@ -108,8 +105,7 @@ export const showConfigFlowDialog = ( }, renderExternalStepDescription(hass, step) { - const description = localizeKey( - hass.localize, + const description = hass.localize( `component.${step.handler}.config.${step.step_id}.description`, step.description_placeholders ); @@ -133,8 +129,7 @@ export const showConfigFlowDialog = ( }, renderCreateEntryDescription(hass, step) { - const description = localizeKey( - hass.localize, + const description = hass.localize( `component.${step.handler}.config.create_entry.${ step.description || "default" }`, @@ -170,8 +165,7 @@ export const showConfigFlowDialog = ( }, renderShowFormProgressDescription(hass, step) { - const description = localizeKey( - hass.localize, + const description = hass.localize( `component.${step.handler}.config.progress.${step.progress_action}`, step.description_placeholders ); diff --git a/src/dialogs/config-flow/show-dialog-options-flow.ts b/src/dialogs/config-flow/show-dialog-options-flow.ts index 1113b939a6..e2346c660d 100644 --- a/src/dialogs/config-flow/show-dialog-options-flow.ts +++ b/src/dialogs/config-flow/show-dialog-options-flow.ts @@ -1,5 +1,4 @@ import { html } from "lit-element"; -import { localizeKey } from "../../common/translations/localize"; import { ConfigEntry } from "../../data/config_entries"; import { createOptionsFlow, @@ -43,8 +42,7 @@ export const showOptionsFlowDialog = ( deleteFlow: deleteOptionsFlow, renderAbortDescription(hass, step) { - const description = localizeKey( - hass.localize, + const description = hass.localize( `component.${configEntry.domain}.options.abort.${step.reason}`, step.description_placeholders ); @@ -69,8 +67,7 @@ export const showOptionsFlowDialog = ( }, renderShowFormStepDescription(hass, step) { - const description = localizeKey( - hass.localize, + const description = hass.localize( `component.${configEntry.domain}.options.step.${step.step_id}.description`, step.description_placeholders ); diff --git a/src/panels/config/integrations/ha-config-integrations.ts b/src/panels/config/integrations/ha-config-integrations.ts index 731ece01c0..e2cdcc6187 100644 --- a/src/panels/config/integrations/ha-config-integrations.ts +++ b/src/panels/config/integrations/ha-config-integrations.ts @@ -346,8 +346,7 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { ? html`
${this.hass.localize( "ui.panel.config.integrations.disable.disabled_integrations", - "number", - disabledConfigEntries.size + { number: disabledConfigEntries.size } )}
- ${this.hass.localize( - "ui.panel.profile.current_user", - "fullName", - this.hass.user!.name - )} + ${this.hass.localize("ui.panel.profile.current_user", { + fullName: this.hass.user!.name, + })} ${this.hass.user!.is_owner ? this.hass.localize("ui.panel.profile.is_owner") : ""} diff --git a/src/panels/profile/ha-refresh-tokens-card.ts b/src/panels/profile/ha-refresh-tokens-card.ts index faad31d988..738bb5760b 100644 --- a/src/panels/profile/ha-refresh-tokens-card.ts +++ b/src/panels/profile/ha-refresh-tokens-card.ts @@ -62,28 +62,31 @@ class HaRefreshTokens extends LitElement { ${this.hass.localize( "ui.panel.profile.refresh_tokens.token_title", - "clientId", - token.client_id + { clientId: token.client_id } )}
${this.hass.localize( "ui.panel.profile.refresh_tokens.created_at", - "date", - relativeTime(new Date(token.created_at), this.hass.localize) + { + date: relativeTime( + new Date(token.created_at), + this.hass.localize + ), + } )}
${token.last_used_at ? this.hass.localize( "ui.panel.profile.refresh_tokens.last_used", - "date", - relativeTime( - new Date(token.last_used_at), - this.hass.localize - ), - "location", - token.last_used_ip + { + date: relativeTime( + new Date(token.last_used_at), + this.hass.localize + ), + location: token.last_used_ip, + } ) : this.hass.localize( "ui.panel.profile.refresh_tokens.not_used" @@ -119,8 +122,7 @@ class HaRefreshTokens extends LitElement { !(await showConfirmationDialog(this, { text: this.hass.localize( "ui.panel.profile.refresh_tokens.confirm_delete", - "name", - token.client_name || token.client_id + { name: token.client_name || token.client_id } ), })) ) { diff --git a/yarn.lock b/yarn.lock index afcc8908b1..0207ccdfcd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1101,40 +1101,60 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@formatjs/ecma402-abstract@^1.2.5": - version "1.2.5" - resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.2.5.tgz#5a61ac1990ff2df8d1348ab12e186c1ca2a2bd71" - integrity sha512-k0fqS3LBNOHueAoMdgig8Ni6TchsH+zbzWBzX2gTFm50X9mxHwnuXdCk0XLlCIbvgVVlzcO254Men/mHAheMbg== +"@formatjs/ecma402-abstract@1.7.1": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.7.1.tgz#1459a9dad654d5d5ec34765965b8e4f22ad6ff81" + integrity sha512-FjewVLB2DVEVCvvC7IMffzXVhysvi442i6ed0H7qcrT6xtUpO4vr0oZgpOmsv6D9I4Io0GVebIuySwteS/k3gg== dependencies: - tslib "^2.0.1" + tslib "^2.1.0" -"@formatjs/intl-getcanonicallocales@^1.4.6": - version "1.4.6" - resolved "https://registry.yarnpkg.com/@formatjs/intl-getcanonicallocales/-/intl-getcanonicallocales-1.4.6.tgz#348a0b8dd87f2b0513a4942a6273c937dd91ead0" - integrity sha512-V54a+Ks02vke2CSmuGJ4GCvrdWfN105GSH7oZRoW5QSiwuac+fmxb5Qpu4002HetuRu0rrRTm+NMUTfZ1VB2xw== +"@formatjs/fast-memoize@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@formatjs/fast-memoize/-/fast-memoize-1.1.1.tgz#3006b58aca1e39a98aca213356b42da5d173f26b" + integrity sha512-mIqBr5uigIlx13eZTOPSEh2buDiy3BCdMYUtewICREQjbb4xarDiVWoXSnrERM7NanZ+0TAHNXSqDe6HpEFQUg== + +"@formatjs/icu-messageformat-parser@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.0.1.tgz#a3b542542b92958f1cdd090f1cb475cb7cb4e21a" + integrity sha512-GXHsATo6/9OMgrfAuyX86fYPMLeQXDN93TOKXQeW7A7ULCy9eEOp3beNwhrVFxaGIjVy/haLLqHMT36iyhwvCA== dependencies: - cldr-core "36.0.0" - tslib "^2.0.1" + "@formatjs/ecma402-abstract" "1.7.1" + "@formatjs/icu-skeleton-parser" "1.2.2" + tslib "^2.1.0" -"@formatjs/intl-pluralrules@^3.4.10": - version "3.4.10" - resolved "https://registry.yarnpkg.com/@formatjs/intl-pluralrules/-/intl-pluralrules-3.4.10.tgz#7ed3b03190971f21d482cb0e46791d90783a74d3" - integrity sha512-KcZZv38bu0pho9+9pMUOsCAi9/Kayh4+V5QZ/I9ps5OFSQlQaFMP5sX/zHBp41SsT6HxTfrPw5CHWpGrS75NQQ== +"@formatjs/icu-skeleton-parser@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.2.2.tgz#6e9a6eff16e3c7b69d67d40b292d4b499e37228e" + integrity sha512-peBBPIiNzJdPsvEzFGCicD7ARvlcaUYOVZ5dljvzzcHqc5OHlH58OrUNWwYgxFS6Dnb3Ncy4qFwlTdPGTTvw1g== dependencies: - "@formatjs/ecma402-abstract" "^1.2.5" - tslib "^2.0.1" + "@formatjs/ecma402-abstract" "1.7.1" + tslib "^2.1.0" -"@formatjs/intl-unified-numberformat@^3.3.5": - version "3.3.5" - resolved "https://registry.yarnpkg.com/@formatjs/intl-unified-numberformat/-/intl-unified-numberformat-3.3.5.tgz#b150c25eb56c1b09a03bf24fb5d1e394b945a27c" - integrity sha512-LdRs9OoqG8Ah6wKKAcaq9wfeZ0w+Icway63thbbOam5DLY9G3u44NReFYWAmVSU+MXOQ+VPATMB9RUXGZxBdig== +"@formatjs/intl-getcanonicallocales@1.5.10", "@formatjs/intl-getcanonicallocales@^1.5.10": + version "1.5.10" + resolved "https://registry.yarnpkg.com/@formatjs/intl-getcanonicallocales/-/intl-getcanonicallocales-1.5.10.tgz#f57f12f19fd28a241767986b081331f8b26fb18b" + integrity sha512-tFqGxZ9HkAzphupybyCKdWHzL1ge/sY8TtzEK57Hs3RCxrv/y+VxIPrE+Izw2oCFowQBz76cyi0zT6PjHuWArA== dependencies: - "@formatjs/intl-utils" "^2.2.4" + cldr-core "38" + tslib "^2.1.0" -"@formatjs/intl-utils@^2.2.4": - version "2.2.4" - resolved "https://registry.yarnpkg.com/@formatjs/intl-utils/-/intl-utils-2.2.4.tgz#fe62a96799d1f7dbe621fd38a4bd2e5a6a16cb0e" - integrity sha512-83fsJywew0o9wQsW3VuEp33HRiFd0qbQDyFFnwZCwk59eLZ33CtKyJ5ofKMrU2KK6hk1zaIdzisrZeoNfmI3Tw== +"@formatjs/intl-locale@^2.4.24": + version "2.4.24" + resolved "https://registry.yarnpkg.com/@formatjs/intl-locale/-/intl-locale-2.4.24.tgz#c3f9dba15653b79ac7b377bb048a35aeedfc234d" + integrity sha512-+JOwvBRFS/GFuJlWiWbfAzBng0A+ANoGV1LRseXK+4uzp4Sn35GD8M/dfgU1lp2R2dTWpYie2yyoHe4k4aHF6w== + dependencies: + "@formatjs/ecma402-abstract" "1.7.1" + "@formatjs/intl-getcanonicallocales" "1.5.10" + cldr-core "38" + tslib "^2.1.0" + +"@formatjs/intl-pluralrules@^4.0.18": + version "4.0.18" + resolved "https://registry.yarnpkg.com/@formatjs/intl-pluralrules/-/intl-pluralrules-4.0.18.tgz#da4bda058cce5217691836c4f46ba3e9f25b0eeb" + integrity sha512-qRFITPsNoeXfsiGc97pp8mVgqcC7aQNuXsiJjY9LpXVTkYNfjUP4ZpbYXflM4xoWCXMJNz3ilsrQhZWXy9td5g== + dependencies: + "@formatjs/ecma402-abstract" "1.7.1" + tslib "^2.1.0" "@fullcalendar/common@5.1.0", "@fullcalendar/common@~5.1.0": version "5.1.0" @@ -2568,11 +2588,6 @@ resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.7.tgz#1b8e33b61a8c09cbe1f85133071baa0dbf9fa71a" integrity sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA== -"@types/chai@^4.2.11": - version "4.2.11" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.11.tgz#d3614d6c5f500142358e6ed24e1bf16657536c50" - integrity sha512-t7uW6eFafjO+qJ3BIV2gGUyZs27egcNRkUdalkud+Qa3+kg//f129iuOFivHDXQ+vnU3fDXuwgv0cqMCbcE8sw== - "@types/chrome@*": version "0.0.119" resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.119.tgz#12a2af96886d0c7210590928729ebf622eb67a58" @@ -4779,10 +4794,10 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -cldr-core@36.0.0: - version "36.0.0" - resolved "https://registry.yarnpkg.com/cldr-core/-/cldr-core-36.0.0.tgz#1d2148ed6802411845baeeb21432d7bbfde7d4f7" - integrity sha512-QLnAjt20rZe38c8h8OJ9jPND+O4o5O8Nw0TK/P3KpNn1cmOhMu0rk6Kc3ap96c5OStQ9gAngs9+Be2sum26NOw== +cldr-core@38: + version "38.1.0" + resolved "https://registry.yarnpkg.com/cldr-core/-/cldr-core-38.1.0.tgz#3c400436b89110e2c0584469d51b7479ef0fa70c" + integrity sha512-Da9xKjDp4qGGIX0VDsBqTan09iR5nuYD2a/KkfEaUyqKhu6wFVNRiCpPDXeRbpVwPBY6PgemV8WiHatMhcpy4A== clean-css@^4.2.1: version "4.2.3" @@ -7773,28 +7788,14 @@ interpret@^2.2.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== -intl-format-cache@^4.2.26: - version "4.2.26" - resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-4.2.26.tgz#ba5e2ee6cec25217f688b68ecdd58eec3703a827" - integrity sha512-RalEzK89R3rJrOo7vcGY8h1WLypF1ZRQQldIsrQM6FTEPixvHb+pAEhd2QkdUk972hFjAEBJR02GdHhaEw9v2g== +intl-messageformat@^9.6.13: + version "9.6.13" + resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-9.6.13.tgz#7c4ace385b3b8cc5010bfd774451ed0c50a73a9b" + integrity sha512-F8OHdgdZYdY3O7TSkQtIGY1qBL7ttbbfIb6g9sgjLw1SQ9SlN3rlaUa1tv9RK3sX0qVkqNLqlPVuOfHlhXpm2Q== dependencies: - "@types/chai" "^4.2.11" - chai "^4.2.0" - -intl-messageformat-parser@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-5.0.2.tgz#878c0d66459b366f4135a812007a873789875b95" - integrity sha512-7logOIMKQX4cWTAGdMSPdlzlGG2aGcpdTr/Laroi3/LTgXvYqMQ8fbC7DolygSEWUxbYrzDIuQsoQGJO6Kp8Gg== - dependencies: - "@formatjs/intl-unified-numberformat" "^3.3.5" - -intl-messageformat@^8.3.9: - version "8.3.9" - resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-8.3.9.tgz#fa57e6f5abdd4b5ad03dd767c965435bd38cbd78" - integrity sha512-WHIopaMiZ14UJ76d14FfqbeNE3knGJT7pJg6eJVxh1G5ziL656BqfQk6dYxPZ2VvoaY7wnT3dLlIXy1MTE0blw== - dependencies: - intl-format-cache "^4.2.26" - intl-messageformat-parser "^5.0.2" + "@formatjs/fast-memoize" "1.1.1" + "@formatjs/icu-messageformat-parser" "2.0.1" + tslib "^2.1.0" into-stream@^4.0.0: version "4.0.0" @@ -12532,6 +12533,11 @@ tslib@^2.0.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ== +tslib@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c" + integrity sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w== + tsparticles@^1.19.2: version "1.19.2" resolved "https://registry.yarnpkg.com/tsparticles/-/tsparticles-1.19.2.tgz#056d26149e67155e99efbfb1ea8f521fcc66520c" From b12a10ccb5db24280ed6a10022479c2bfdc95a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Fri, 14 May 2021 11:49:52 +0200 Subject: [PATCH 041/117] Add snapshot contents as secondary info for partial snapshots (#9166) --- hassio/src/snapshots/hassio-snapshots.ts | 50 ++++++++++++++++++++---- src/data/hassio/snapshot.ts | 15 +++++++ 2 files changed, 57 insertions(+), 8 deletions(-) diff --git a/hassio/src/snapshots/hassio-snapshots.ts b/hassio/src/snapshots/hassio-snapshots.ts index 6ed974dfca..8fd5a9ed15 100644 --- a/hassio/src/snapshots/hassio-snapshots.ts +++ b/hassio/src/snapshots/hassio-snapshots.ts @@ -24,6 +24,7 @@ import "../../../src/components/ha-button-menu"; import "../../../src/components/ha-fab"; import { fetchHassioSnapshots, + friendlyFolderName, HassioSnapshot, reloadHassioSnapshots, } from "../../../src/data/hassio/snapshot"; @@ -66,6 +67,33 @@ export class HassioSnapshots extends LitElement { await this.fetchSnapshots(); } + private _computeSnapshotContent = (snapshot: HassioSnapshot): string => { + if (snapshot.type === "full") { + return this.supervisor.localize("snapshot.full_snapshot"); + } + const content: string[] = []; + if (snapshot.content.homeassistant) { + content.push("Home Assistant"); + } + if (snapshot.content.folders.length !== 0) { + for (const folder of snapshot.content.folders) { + content.push(friendlyFolderName[folder] || folder); + } + } + + if (snapshot.content.addons.length !== 0) { + for (const addon of snapshot.content.addons) { + content.push( + this.supervisor.supervisor.addons.find( + (entry) => entry.slug === addon + )?.name || addon + ); + } + } + + return content.join(", "); + }; + protected firstUpdated(changedProperties: PropertyValues): void { super.firstUpdated(changedProperties); if (this.hass && this.isConnected) { @@ -81,7 +109,9 @@ export class HassioSnapshots extends LitElement { sortable: true, filterable: true, grows: true, - template: (entry: string, snapshot: any) => entry || snapshot.slug, + template: (entry: string, snapshot: any) => + html`${entry || snapshot.slug} +
${snapshot.secondary}
`, }, date: { title: this.supervisor?.localize("snapshot.created") || "", @@ -93,17 +123,21 @@ export class HassioSnapshots extends LitElement { template: (entry: string) => relativeTime(new Date(entry), this.hass.localize), }, - type: { - title: this.supervisor?.localize("snapshot.type") || "", - width: "15%", - hidden: narrow, + secondary: { + title: "", + hidden: true, filterable: true, - sortable: true, - template: (entry: string) => (entry === "partial" ? "Partial" : "Full"), }, }) ); + private _snapshotData = memoizeOne((snapshots: HassioSnapshot[]) => + snapshots.map((snapshot) => ({ + ...snapshot, + secondary: this._computeSnapshotContent(snapshot), + })) + ); + protected render(): TemplateResult { if (!this.supervisor) { return html``; @@ -118,7 +152,7 @@ export class HassioSnapshots extends LitElement { .narrow=${this.narrow} .route=${this.route} .columns=${this._columns(this.narrow)} - .data=${this._snapshots} + .data=${this._snapshotData(this._snapshots || [])} id="slug" @row-click=${this._handleRowClicked} clickable diff --git a/src/data/hassio/snapshot.ts b/src/data/hassio/snapshot.ts index 77df1be76e..0281f0d9a4 100644 --- a/src/data/hassio/snapshot.ts +++ b/src/data/hassio/snapshot.ts @@ -2,12 +2,27 @@ import { atLeastVersion } from "../../common/config/version"; import { HomeAssistant } from "../../types"; import { hassioApiResultExtractor, HassioResponse } from "./common"; +export const friendlyFolderName = { + ssl: "SSL", + homeassistant: "Configuration", + "addons/local": "Local add-ons", + media: "Media", + share: "Share", +}; + +interface SnapshotContent { + homeassistant: boolean; + folders: string[]; + addons: string[]; +} + export interface HassioSnapshot { slug: string; date: string; name: string; type: "full" | "partial"; protected: boolean; + content: SnapshotContent; } export interface HassioSnapshotDetail extends HassioSnapshot { From fe2fe7468f6e7b975e215646b6c4d5eec20dcd92 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 14 May 2021 11:50:50 +0200 Subject: [PATCH 042/117] Bump lodash (#9135) --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0207ccdfcd..a2c81c5b57 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8811,7 +8811,7 @@ lodash._reinterpolate@^2.4.1, lodash._reinterpolate@~2.4.1: resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz#4f1227aa5a8711fc632f5b07a1f4607aab8b3222" integrity sha1-TxInqlqHEfxjL1sHofRgequLMiI= -lodash._reinterpolate@^3.0.0, lodash._reinterpolate@~3.0.0: +lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= @@ -8921,11 +8921,11 @@ lodash.template@^4.5.0: lodash.templatesettings "^4.0.0" lodash.templatesettings@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" - integrity sha1-K01OlbpEDZFf8IvImeRVNmZxMxY= + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" + integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== dependencies: - lodash._reinterpolate "~3.0.0" + lodash._reinterpolate "^3.0.0" lodash.templatesettings@~2.4.1: version "2.4.1" From cc0a120bf6b8046949855a82f0094c5894543c3a Mon Sep 17 00:00:00 2001 From: Julien Roy Date: Fri, 14 May 2021 16:55:38 +0200 Subject: [PATCH 043/117] Switch update and openChangelog button (#9174) Co-authored-by: Bram Kragten --- hassio/src/addon-view/info/hassio-addon-info.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hassio/src/addon-view/info/hassio-addon-info.ts b/hassio/src/addon-view/info/hassio-addon-info.ts index 0a3e0fd691..3873353bba 100644 --- a/hassio/src/addon-view/info/hassio-addon-info.ts +++ b/hassio/src/addon-view/info/hassio-addon-info.ts @@ -171,16 +171,16 @@ class HassioAddonInfo extends LitElement { : ""}
- - ${this.supervisor.localize("common.update")} - ${this.addon.changelog ? html` ${this.supervisor.localize("addon.dashboard.changelog")} ` - : ""} + : html``} + + ${this.supervisor.localize("common.update")} +
` From ebf0bdc8401d801a21930c4760967eeebf510e01 Mon Sep 17 00:00:00 2001 From: Matt Emerick-Law Date: Fri, 14 May 2021 20:44:03 +0100 Subject: [PATCH 044/117] Add duplicate scene functionality (#9175) --- src/data/scene.ts | 1 + src/panels/config/scene/ha-scene-editor.ts | 107 ++++++++++++++++++--- src/translations/en.json | 2 + 3 files changed, 95 insertions(+), 15 deletions(-) diff --git a/src/data/scene.ts b/src/data/scene.ts index 6b029412c4..f77972af6a 100644 --- a/src/data/scene.ts +++ b/src/data/scene.ts @@ -39,6 +39,7 @@ export interface SceneEntity extends HassEntityBase { } export interface SceneConfig { + id?: string; name: string; icon?: string; entities: SceneEntities; diff --git a/src/panels/config/scene/ha-scene-editor.ts b/src/panels/config/scene/ha-scene-editor.ts index 545a5d12b8..953535dbc8 100644 --- a/src/panels/config/scene/ha-scene-editor.ts +++ b/src/panels/config/scene/ha-scene-editor.ts @@ -1,4 +1,11 @@ -import { mdiContentSave } from "@mdi/js"; +import { ActionDetail } from "@material/mwc-list/mwc-list-foundation"; +import "@material/mwc-list/mwc-list-item"; +import { + mdiContentDuplicate, + mdiContentSave, + mdiDelete, + mdiDotsVertical, +} from "@mdi/js"; import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; @@ -48,6 +55,7 @@ import { SceneEntities, SceneEntity, SCENE_IGNORED_DOMAINS, + showSceneEditor, } from "../../../data/scene"; import { showAlertDialog, @@ -83,7 +91,7 @@ export class HaSceneEditor extends SubscribeMixin( @property() public route!: Route; - @property() public sceneId?: string; + @property() public sceneId: string | null = null; @property() public scenes!: SceneEntity[]; @@ -198,19 +206,52 @@ export class HaSceneEditor extends SubscribeMixin( .backCallback=${() => this._backTapped()} .tabs=${configSections.automation} > - ${!this.sceneId - ? "" - : html` - - `} + + + + + + ${this.hass.localize( + "ui.panel.config.scene.picker.duplicate_scene" + )} + + + + + ${this.hass.localize("ui.panel.config.scene.picker.delete_scene")} + + + + ${this._errors ? html`
${this._errors}
` : ""} ${this.narrow ? html` ${name} ` : ""}
) { + switch (ev.detail.index) { + case 0: + this._duplicate(); + break; + case 1: + this._deleteTapped(); + break; + } + } + private async _setScene() { const scene = this.scenes.find( (entity: SceneEntity) => entity.attributes.id === this.sceneId @@ -683,6 +735,31 @@ export class HaSceneEditor extends SubscribeMixin( history.back(); } + private async _duplicate() { + if (this._dirty) { + if ( + !(await showConfirmationDialog(this, { + text: this.hass!.localize( + "ui.panel.config.scene.editor.unsaved_confirm" + ), + confirmText: this.hass!.localize("ui.common.leave"), + dismissText: this.hass!.localize("ui.common.stay"), + })) + ) { + return; + } + // Wait for dialog to complete closing + await new Promise((resolve) => setTimeout(resolve, 0)); + } + showSceneEditor(this, { + ...this._config, + id: undefined, + name: `${this._config?.name} (${this.hass.localize( + "ui.panel.config.scene.picker.duplicate" + )})`, + }); + } + private _calculateStates(): SceneEntities { const output: SceneEntities = {}; this._entities.forEach((entityId) => { diff --git a/src/translations/en.json b/src/translations/en.json index 731eda21fa..00a5030c59 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1680,6 +1680,8 @@ "show_info_scene": "Show info about scene", "delete_scene": "Delete scene", "delete_confirm": "Are you sure you want to delete this scene?", + "duplicate_scene": "Duplicate scene", + "duplicate": "Duplicate", "headers": { "name": "Name" } From 64a117d8ac380ef74b9d8da219f584ac7a2fddd5 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 14 May 2021 22:32:41 +0200 Subject: [PATCH 045/117] Fix yarn.lock --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index a2c81c5b57..63437a8239 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4642,7 +4642,7 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -chart.js@2.9.4, chart.js@^2.9.4: +chart.js@^2.9.4: version "2.9.4" resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-2.9.4.tgz#0827f9563faffb2dc5c06562f8eb10337d5b9684" integrity sha512-B07aAzxcrikjAPyV+01j7BmOpxtQETxTSlQ26BEYJ+3iUkbNKaOJ/nDbT6JjyqYxseM0ON12COHYdU2cTIjC7A== From 9f32d72a41e0d606dbea00f0047272557427f9d8 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 15 May 2021 01:51:54 +0000 Subject: [PATCH 046/117] Translation update --- translations/frontend/en.json | 2 ++ translations/frontend/nl.json | 2 +- translations/frontend/sk.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/translations/frontend/en.json b/translations/frontend/en.json index ea672b9452..2742873f2d 100644 --- a/translations/frontend/en.json +++ b/translations/frontend/en.json @@ -2588,6 +2588,8 @@ "add_scene": "Add scene", "delete_confirm": "Are you sure you want to delete this scene?", "delete_scene": "Delete scene", + "duplicate": "Duplicate", + "duplicate_scene": "Duplicate scene", "edit_scene": "Edit scene", "header": "Scene Editor", "headers": { diff --git a/translations/frontend/nl.json b/translations/frontend/nl.json index e4e24799c8..0c61ea78f3 100644 --- a/translations/frontend/nl.json +++ b/translations/frontend/nl.json @@ -1961,7 +1961,7 @@ "attributes_override": "Je kunt ze overschrijven als je wilt.", "attributes_set": "De volgende attributen van de entiteit zijn automatisch ingevuld.", "caption": "Aanpassingen", - "description": "Pas je entiteiten aan", + "description": "Pas uw entiteiten aan", "different_include": "Mogelijk via een domein, een glob of een andere include.", "pick_attribute": "Kies een attribuut om te overschrijven", "picker": { diff --git a/translations/frontend/sk.json b/translations/frontend/sk.json index 1470603626..a1ba3685ab 100644 --- a/translations/frontend/sk.json +++ b/translations/frontend/sk.json @@ -1151,7 +1151,7 @@ "delete_confirm": "Ste si istý odstránením ? ", "duplicate": "Duplikovať", "header": "Akcie", - "introduction": "Akcie, ktoré vykoná Home Assistant, sa aktivujú po spustení automatizácie. \n\n [Viac informácií o akciách.](https://home-assistant.io/docs/automation/action/)", + "introduction": "Akcie predstavujú činnosti, ktoré Home Assistant vykoná po spustení automatizácie.", "learn_more": "Získajte viac informácií o akciách", "name": "Akcia", "type_select": "Typ akcie", From f4ffbe67e23725ec73abb906519fee305555ef2d Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 15 May 2021 03:23:33 -0700 Subject: [PATCH 047/117] Remove shadowroot from ha-markdown-element (#9187) --- src/components/ha-markdown-element.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/ha-markdown-element.ts b/src/components/ha-markdown-element.ts index 4658f5ee05..840fc97395 100644 --- a/src/components/ha-markdown-element.ts +++ b/src/components/ha-markdown-element.ts @@ -10,11 +10,8 @@ class HaMarkdownElement extends ReactiveElement { @property({ type: Boolean }) public breaks = false; - public connectedCallback() { - super.connectedCallback(); - if (!this.shadowRoot) { - this.attachShadow({ mode: "open" }); - } + protected createRenderRoot() { + return this; } protected update(changedProps) { @@ -25,7 +22,7 @@ class HaMarkdownElement extends ReactiveElement { } private async _render() { - this.shadowRoot!.innerHTML = await renderMarkdown( + this.innerHTML = await renderMarkdown( this.content, { breaks: this.breaks, @@ -39,8 +36,10 @@ class HaMarkdownElement extends ReactiveElement { this._resize(); const walker = document.createTreeWalker( - this.shadowRoot!, - 1 /* SHOW_ELEMENT */ + this, + 1 /* SHOW_ELEMENT */, + null, + false ); while (walker.nextNode()) { From 37cc6709d47ac386f08a18fc57001adb7c774fcf Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 15 May 2021 03:25:28 -0700 Subject: [PATCH 048/117] If we have a link, make it a link (#9181) --- hassio/src/snapshots/hassio-snapshots.ts | 2 + src/components/ha-tab.ts | 2 - src/entrypoints/custom-panel.ts | 9 ++++ src/layouts/hass-tabs-subpage-data-table.ts | 6 +++ src/layouts/hass-tabs-subpage.ts | 60 +++++++++++---------- 5 files changed, 50 insertions(+), 29 deletions(-) diff --git a/hassio/src/snapshots/hassio-snapshots.ts b/hassio/src/snapshots/hassio-snapshots.ts index 8fd5a9ed15..b6bb3486f0 100644 --- a/hassio/src/snapshots/hassio-snapshots.ts +++ b/hassio/src/snapshots/hassio-snapshots.ts @@ -157,6 +157,8 @@ export class HassioSnapshots extends LitElement { @row-click=${this._handleRowClicked} clickable hasFab + main-page + supervisor > { + const href = isNavigationClick(ev); + if (href) { + navigate(document.body, href); + } + }); } document.addEventListener( diff --git a/src/layouts/hass-tabs-subpage-data-table.ts b/src/layouts/hass-tabs-subpage-data-table.ts index 179b221515..de56e096cd 100644 --- a/src/layouts/hass-tabs-subpage-data-table.ts +++ b/src/layouts/hass-tabs-subpage-data-table.ts @@ -42,6 +42,10 @@ export class HaTabsSubpageDataTable extends LitElement { @property({ type: Boolean, reflect: true }) public narrow = false; + @property({ type: Boolean }) public supervisor = false; + + @property({ type: Boolean, attribute: "main-page" }) public mainPage = false; + /** * Object with the columns. * @type {Object} @@ -195,6 +199,8 @@ export class HaTabsSubpageDataTable extends LitElement { .backCallback=${this.backCallback} .route=${this.route} .tabs=${this.tabs} + .mainPage=${this.mainPage} + .supervisor=${this.supervisor} >
${this.narrow diff --git a/src/layouts/hass-tabs-subpage.ts b/src/layouts/hass-tabs-subpage.ts index 448c6e3e17..9b77850e4d 100644 --- a/src/layouts/hass-tabs-subpage.ts +++ b/src/layouts/hass-tabs-subpage.ts @@ -15,7 +15,6 @@ import { classMap } from "lit-html/directives/class-map"; import memoizeOne from "memoize-one"; import { isComponentLoaded } from "../common/config/is_component_loaded"; import { restoreScroll } from "../common/decorators/restore-scroll"; -import { navigate } from "../common/navigate"; import { LocalizeFunc } from "../common/translations/localize"; import { computeRTL } from "../common/util/compute_rtl"; import "../components/ha-icon"; @@ -88,23 +87,23 @@ class HassTabsSubpage extends LitElement { return shownTabs.map( (page) => html` - - ${page.iconPath - ? html`` - : html``} - + + + ${page.iconPath + ? html`` + : html``} + + ` ); } @@ -148,6 +147,14 @@ class HassTabsSubpage extends LitElement { .narrow=${this.narrow} > ` + : this.backPath + ? html` + + + + ` : html` Date: Sun, 16 May 2021 01:59:23 +0000 Subject: [PATCH 049/117] Translation update --- translations/frontend/bg.json | 2 +- translations/frontend/ca.json | 2 ++ translations/frontend/es.json | 2 ++ translations/frontend/et.json | 2 ++ translations/frontend/ko.json | 2 ++ translations/frontend/nl.json | 6 ++++-- translations/frontend/ru.json | 2 ++ translations/frontend/zh-Hans.json | 4 +++- 8 files changed, 18 insertions(+), 4 deletions(-) diff --git a/translations/frontend/bg.json b/translations/frontend/bg.json index ff7aec3c07..b6cce688a8 100644 --- a/translations/frontend/bg.json +++ b/translations/frontend/bg.json @@ -1994,7 +1994,7 @@ "frontend": "интерфейс", "frontend_version": "Версия на интерфейса: {version} - {type}", "home_assistant_logo": "Лого на Home Assistant", - "icons_by": "Икони от", + "icons_by": "икони от", "integrations": "Интеграции", "license": "Публикувано под лиценза Apache 2.0", "path_configuration": "Път към configuration.yaml: {path}", diff --git a/translations/frontend/ca.json b/translations/frontend/ca.json index 7f92e1223a..94e7bf4906 100644 --- a/translations/frontend/ca.json +++ b/translations/frontend/ca.json @@ -2588,6 +2588,8 @@ "add_scene": "Afegeix escena", "delete_confirm": "Estàs segur que vols eliminar aquesta escena?", "delete_scene": "Elimina l'escena", + "duplicate": "Duplica", + "duplicate_scene": "Duplica escena", "edit_scene": "Edita escena", "header": "Editor d'escenes", "headers": { diff --git a/translations/frontend/es.json b/translations/frontend/es.json index 0e17ff8e2b..25049a91f3 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -2588,6 +2588,8 @@ "add_scene": "Añadir escena", "delete_confirm": "¿Estás seguro de que quieres eliminar esta escena?", "delete_scene": "Eliminar escena", + "duplicate": "Duplicar", + "duplicate_scene": "Duplicar la escena", "edit_scene": "Editar escena", "header": "Editor de escenas", "headers": { diff --git a/translations/frontend/et.json b/translations/frontend/et.json index a8ce61e3de..e59c6fe131 100644 --- a/translations/frontend/et.json +++ b/translations/frontend/et.json @@ -2588,6 +2588,8 @@ "add_scene": "Lisa stseen", "delete_confirm": "Oled kindel, et soovid selle stseeni kustutada?", "delete_scene": "Kustuta stseen", + "duplicate": "Paljunda", + "duplicate_scene": "Paljunda stseen", "edit_scene": "Muuda stseeni", "header": "Stseeniredaktor", "headers": { diff --git a/translations/frontend/ko.json b/translations/frontend/ko.json index 2dec8ee36b..2f8c64ce2f 100644 --- a/translations/frontend/ko.json +++ b/translations/frontend/ko.json @@ -2587,6 +2587,8 @@ "add_scene": "씬 추가하기", "delete_confirm": "이 씬을 삭제하시겠습니까?", "delete_scene": "씬 삭제하기", + "duplicate": "복제", + "duplicate_scene": "씬 복제", "edit_scene": "씬 편집하기", "header": "씬 편집기", "headers": { diff --git a/translations/frontend/nl.json b/translations/frontend/nl.json index 0c61ea78f3..1415c621cb 100644 --- a/translations/frontend/nl.json +++ b/translations/frontend/nl.json @@ -1633,7 +1633,7 @@ "delete_automation": "Verwijder automatisering", "delete_confirm": "Weet je zeker dat je deze automatisering wilt verwijderen?", "dev_automation": "Debug automatisering", - "dev_only_editable": "Alleen automatiseringen in automations.yaml kunnen worden gedebugd.", + "dev_only_editable": "Alleen automatiseringen waaraan een uniek ID is toegewezen, kunnen worden gedebugd", "duplicate": "Dupliceren", "duplicate_automation": "Dupliceer automatisering", "edit_automation": "Bewerk automatisering", @@ -2588,6 +2588,8 @@ "add_scene": "Voeg scène toe", "delete_confirm": "Weet je zeker dat je deze scène wilt verwijderen?", "delete_scene": "Scène verwijderen", + "duplicate": "Dupliceer", + "duplicate_scene": "Dupliceer scene", "edit_scene": "Scène bewerken", "header": "Scene Editor", "headers": { @@ -2824,7 +2826,7 @@ "shortcuts_title": "Snelkoppelingen", "update_button": "Update configuratie", "zha_options": { - "default_light_transition": "Standaard licht transitietijd (seconden)", + "default_light_transition": "Standaard lichttransitietijd (seconden)", "enable_identify_on_join": "Schakel het identificatie-effect in wanneer apparaten in het netwerk komen", "title": "Globale opties" } diff --git a/translations/frontend/ru.json b/translations/frontend/ru.json index 4f5d621419..1ea87f29ea 100644 --- a/translations/frontend/ru.json +++ b/translations/frontend/ru.json @@ -2588,6 +2588,8 @@ "add_scene": "Добавить сцену", "delete_confirm": "Вы уверены, что хотите удалить эту сцену?", "delete_scene": "Удалить сцену", + "duplicate": "Дублировать", + "duplicate_scene": "Дублировать сцену", "edit_scene": "Редактировать сцену", "header": "Редактор сцен", "headers": { diff --git a/translations/frontend/zh-Hans.json b/translations/frontend/zh-Hans.json index eaf84654d4..290b56986c 100644 --- a/translations/frontend/zh-Hans.json +++ b/translations/frontend/zh-Hans.json @@ -2169,7 +2169,7 @@ "license": "根据 Apache 2.0 许可发布", "path_configuration": "configuration.yaml 路径:{path}", "server": "服务器", - "setup_time": "安装时间", + "setup_time": "启动时长", "source": "源:", "system_health_error": "未加载系统健康组件。请将 'system_health:' 添加到 configuration.yaml", "system_health": { @@ -2588,6 +2588,8 @@ "add_scene": "添加场景", "delete_confirm": "您确定要删除此场景吗?", "delete_scene": "删除场景", + "duplicate": "制作副本", + "duplicate_scene": "复制场景", "edit_scene": "编辑场景", "header": "场景编辑器", "headers": { From 0a672c55c56d462e8746d0eb9d27d10bcd24e2f2 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 17 May 2021 01:54:21 +0000 Subject: [PATCH 050/117] Translation update --- translations/frontend/ar.json | 40 ++++++++++++++++++++++++++++-- translations/frontend/bg.json | 4 ++- translations/frontend/ko.json | 3 +++ translations/frontend/nl.json | 2 +- translations/frontend/pt.json | 20 ++++++++++++++- translations/frontend/zh-Hant.json | 2 ++ 6 files changed, 66 insertions(+), 5 deletions(-) diff --git a/translations/frontend/ar.json b/translations/frontend/ar.json index 5902381b4d..874b69ddb8 100644 --- a/translations/frontend/ar.json +++ b/translations/frontend/ar.json @@ -124,6 +124,14 @@ }, "my": { "error_addon_not_found": "لم يتم العثور على الإضافة" + }, + "snapshot": { + "created": "خلقت" + }, + "system": { + "supervisor": { + "search": "بحث" + } } }, "ui": { @@ -383,6 +391,10 @@ "zha_device_card": { "device_name_placeholder": "تغيير اسم الجهاز" } + }, + "zha_reconfigure_device": { + "button_hide": "أخف التفاصيل", + "button_show": "إظهار التفاصيل" } }, "duration": { @@ -421,7 +433,8 @@ "areas": { "data_table": { "area": "المنطقة", - "devices": "الأجهزة" + "devices": "الأجهزة", + "entities": "الكيانات" }, "delete": { "confirmation_text": "سيتم إلغاء تعيين جميع الأجهزة في هذه المنطقة.", @@ -429,8 +442,10 @@ }, "editor": { "area_id": "المنطقة", + "linked_entities_caption": "الكيانات", "name": "اسم", "name_required": "الاسم مطلوب", + "no_linked_entities": "لا توجد كيانات مرتبطة بهذه المنطقة.", "unknown_error": "خطأ غير معروف" }, "picker": { @@ -649,6 +664,14 @@ "integrations": "تكاملات", "integrations_introduction2": "تحقق من الموقع ل", "integrations_link_all_features": " جميع الميزات المتوفرة", + "remote": { + "connected": "متصل", + "not_connected": "غير متصل", + "remote_enabled": { + "caption": "الاتصال تلقائيا", + "description": "قم بتفعيل هذا الخيار للتأكد من أن Home Assistant الخاص بك يمكن الوصول إليه دائمًا عن بُعد." + } + }, "tts": { "dialog": { "example_message": "مرحبًا {name} ، يمكنك تشغيل أي نص على أي مشغل وسائط مدعوم!", @@ -752,7 +775,8 @@ "documentation": "الوثائق", "home_assistant_logo": "شعار Home Assistant", "integrations": "تكاملات", - "issues": "الاعطال" + "issues": "الاعطال", + "setup_time": "وقت التنصيب" }, "integration_panel_move": { "link_integration_page": "صفحة التكاملات", @@ -777,6 +801,9 @@ "options": "خيارات", "rename": "إعادة تسمية", "restart_confirm": "أعد تشغيل Home Assistant لإنهاء حذف هذا التكامل", + "state": { + "setup_error": "فشل في التنصيب" + }, "system_options": "خيارات النظام", "unnamed_entry": "إدخال بدون اسم" }, @@ -791,6 +818,7 @@ }, "finish": "إنهاء", "loading_first_time": "يرجى الانتظار بينما يتم تثبيت الـintegration", + "next": "التالى", "not_all_required_fields": "لم يتم تعبئة جميع الحقول المطلوبة." }, "configure": "إعداد", @@ -914,6 +942,8 @@ "icon": "أيقونة" }, "picker": { + "duplicate": "تكرار", + "duplicate_scene": "تكرار بطاقة", "headers": { "name": "الاسم" } @@ -1034,6 +1064,12 @@ "dashboard": { "dump_not_ready_confirm": "تحميل" }, + "logs": { + "log_level": "مستوى التسجيل في السجل" + }, + "navigation": { + "logs": "السجلات" + }, "remove_node": { "cancel_exclusion": "إلغاء الاستبعاد", "start_exclusion": "بدء الاستبعاد" diff --git a/translations/frontend/bg.json b/translations/frontend/bg.json index b6cce688a8..183fb56d1e 100644 --- a/translations/frontend/bg.json +++ b/translations/frontend/bg.json @@ -350,6 +350,7 @@ "create": "Създаване", "create_blocked_not_running": "Създаването на снапшот в момента не е възможно, тъй като системата е в състояние {state}.", "create_snapshot": "Създаване на снапшот", + "created": "Създаден", "description": "Снапшотите ви позволяват лесно да архивирате и възстановявате всички данни от вашия екземпляр на Home Assistant.", "enter_password": "Моля, въведете парола.", "folder": { @@ -425,6 +426,7 @@ "leave_beta_description": "Получавайте стабилни актуализации за Home Assistant, Supervisor и хоста", "ram_usage": "Използване на RAM от Supervisor", "reload_supervisor": "Презареждане на Supervisor", + "search": "Търсене", "share_diagnostics": "Споделяне на диагностика", "share_diagnostics_description": "Споделяйте доклади за сривове и диагностична информация.", "share_diagonstics_description": "Искате ли да споделяте автоматично отчети за сривове и диагностична информация, когато Supervisor срещне неочаквани грешки? {line_break} Това ще ни позволи да отстраним проблемите, информацията е достъпна само за екипа на Home Assistant Core и няма да бъде споделяна с други. {line_break} Данните не включват никаква частна/чувствителна информация и можете да деактивирате това в настройките по всяко време, когато пожелаете.", @@ -3487,7 +3489,7 @@ }, "sidebar": { "done": "Готово", - "external_app_configuration": "Конфигурация на приложение" + "external_app_configuration": "Конфигурация на приложението" } } } \ No newline at end of file diff --git a/translations/frontend/ko.json b/translations/frontend/ko.json index 2f8c64ce2f..f59a7f765f 100644 --- a/translations/frontend/ko.json +++ b/translations/frontend/ko.json @@ -366,6 +366,7 @@ }, "my": { "error": "알 수 없는 오류가 발생했습니다", + "error_addon_no_ingress": "해당 애드온은 인그레스를 지원하지 않습니다.", "error_addon_not_found": "애드온을 찾을 수 없습니다", "faq_link": "내 Home Assistant 자주 묻는 질문", "not_supported": "이 리디렉션은 Home Assistant 인스턴스에서 지원되지 않습니다. {link}에서 지원되는 리디렉션과 리디렉션이 도입된 버전을 확인해주세요." @@ -2822,6 +2823,7 @@ "value": "값" }, "configuration_page": { + "shortcuts_title": "바로 가기", "update_button": "구성 업데이트", "zha_options": { "default_light_transition": "조명 전환 시간 기본 값(초)", @@ -2955,6 +2957,7 @@ }, "logs": { "log_level": "로그 레벨", + "subscribed_to_logs": "Z-Wave JS 로그 메시지 수신 ...", "title": "Z-Wave JS 로그" }, "navigation": { diff --git a/translations/frontend/nl.json b/translations/frontend/nl.json index 1415c621cb..f272d7b1e8 100644 --- a/translations/frontend/nl.json +++ b/translations/frontend/nl.json @@ -3599,7 +3599,7 @@ "unsaved_changes": "Niet-opgeslagen wijzigingen" }, "save_config": { - "cancel": "Laat maar", + "cancel": "Annuleer", "close": "Sluiten", "empty_config": "Begin met een leeg dashboard", "header": "Neem de controle over je Lovelace UI", diff --git a/translations/frontend/pt.json b/translations/frontend/pt.json index bdc10ad0c1..8d513ee8d0 100644 --- a/translations/frontend/pt.json +++ b/translations/frontend/pt.json @@ -344,6 +344,7 @@ "create": "Criar", "create_blocked_not_running": "Não é possível criar um snapshot agora porque o sistema está {state}.", "create_snapshot": "Criar snapshot", + "created": "Criado", "description": "As imagens de sistema permitem facilmente criar uma cópia de segurança e restauro de todos os dados da sua instância do Home Assistant", "enter_password": "Por favor introduza uma palavra-passe.", "folder": { @@ -419,6 +420,7 @@ "leave_beta_description": "Obter actualizações estáveis para Home Assistant, Supervisor e Host", "ram_usage": "Utilização de RAM do Supervisor", "reload_supervisor": "Recarregar Supervisor", + "search": "Procurar", "share_diagnostics": "Partilhar Diagnósticos", "share_diagnostics_description": "Partilhar relatórios de falhas e informações de diagnóstico.", "share_diagonstics_description": "Quer partilhar automaticamente relatórios de quebras do sistema e informações de diagnóstico quando o Supervisor se deparar com erros inesperados? {line_break} Isto permitir-nos-á resolver os problemas, a informação só é acessível à equipa do Home Assistant Core e não será partilhada com outros.{line_break} Os dados não incluem qualquer informação privada/sensível e pode desativá-la em configurações em qualquer altura.", @@ -1134,6 +1136,13 @@ "zha_device_card": { "device_name_placeholder": "Alterar o nome do dispositivo" } + }, + "zha_reconfigure_device": { + "attribute": "Atributo", + "button_hide": "Ocultar detalhes", + "button_show": "Mostrar Detalhes", + "configuring_alt": "A configurar", + "start_reconfiguration": "Iniciar reconfiguração" } }, "duration": { @@ -1185,7 +1194,8 @@ "caption": "Áreas", "data_table": { "area": "Área", - "devices": "Dispositivos" + "devices": "Dispositivos", + "entities": "Entidades" }, "delete": { "confirmation_text": "Todos os dispositivos nesta área ficarão por atribuir.", @@ -1197,6 +1207,7 @@ "create": "Criar", "default_name": "Nova área", "delete": "Apagar", + "linked_entities_caption": "Entidades", "name": "Nome", "name_required": "Nome é obrigatório", "unknown_error": "Erro desconhecido", @@ -1649,10 +1660,15 @@ "remote": { "access_is_being_prepared": "O acesso remoto está a ser preparado. Iremos notificá-lo quando estiver pronto.", "certificate_info": "Informações do certificado", + "connected": "Ligado", "info": "O Home Assistant Cloud oferece uma ligação remota segura à sua instância enquanto estiver fora de casa.", "instance_is_available": "A sua instância está disponível em", "instance_will_be_available": "Sua instância estará disponível em", "link_learn_how_it_works": "Aprenda como funciona", + "not_connected": "Não Ligado", + "remote_enabled": { + "caption": "Ligar automaticamente" + }, "title": "Controle Remoto" }, "sign_out": "Terminar sessão", @@ -2094,6 +2110,7 @@ }, "finish": "Terminar", "loading_first_time": "Por favor, aguarde enquanto a integração está a ser instalada", + "next": "Próximo", "not_all_required_fields": "Nem todos os campos obrigatórios estão preenchidos.", "submit": "Enviar" }, @@ -2417,6 +2434,7 @@ "add_scene": "Adicionar cenário", "delete_confirm": "Tem certeza de que deseja apagar esta cena?", "delete_scene": "Eliminar cena", + "duplicate": "Duplicado", "edit_scene": "Editar cena", "header": "Editor de cenários", "headers": { diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index ed0f3b68a1..3561143f6c 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -2588,6 +2588,8 @@ "add_scene": "新增場景", "delete_confirm": "確定要刪除此場景?", "delete_scene": "刪除場景", + "duplicate": "複製", + "duplicate_scene": "複製場景", "edit_scene": "編輯場景", "header": "場景編輯器", "headers": { From 5abb3dd8c15c7ebb6a5889a9ae58deba65d3de53 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 17 May 2021 14:12:16 +0200 Subject: [PATCH 051/117] Use default behaviour for service target (#8650) --- src/components/ha-service-control.ts | 13 +-------- src/data/entity.ts | 42 ---------------------------- 2 files changed, 1 insertion(+), 54 deletions(-) diff --git a/src/components/ha-service-control.ts b/src/components/ha-service-control.ts index 50ae36f237..359183544d 100644 --- a/src/components/ha-service-control.ts +++ b/src/components/ha-service-control.ts @@ -19,7 +19,6 @@ import memoizeOne from "memoize-one"; import { fireEvent } from "../common/dom/fire_event"; import { computeDomain } from "../common/entity/compute_domain"; import { computeObjectId } from "../common/entity/compute_object_id"; -import { ENTITY_COMPONENT_DOMAINS } from "../data/entity"; import { Selector } from "../data/selector"; import { PolymerChangedEvent } from "../polymer-types"; import { HomeAssistant } from "../types"; @@ -124,11 +123,6 @@ export class HaServiceControl extends LitElement { } } - private _domainFilter = memoizeOne((service: string) => { - const domain = computeDomain(service); - return ENTITY_COMPONENT_DOMAINS.includes(domain) ? [domain] : null; - }); - private _getServiceInfo = memoizeOne( ( service?: string, @@ -231,11 +225,7 @@ export class HaServiceControl extends LitElement { .hass=${this.hass} .selector=${serviceData.target ? { target: serviceData.target } - : { - target: { - entity: { domain: computeDomain(this._value!.service) }, - }, - }} + : { target: {} }} @value-changed=${this._targetChanged} .value=${this._value?.target} >` diff --git a/src/data/entity.ts b/src/data/entity.ts index 0ade5b2d15..829ee58c35 100644 --- a/src/data/entity.ts +++ b/src/data/entity.ts @@ -2,45 +2,3 @@ export const UNAVAILABLE = "unavailable"; export const UNKNOWN = "unknown"; export const UNAVAILABLE_STATES = [UNAVAILABLE, UNKNOWN]; - -export const ENTITY_COMPONENT_DOMAINS = [ - "air_quality", - "alarm_control_panel", - "alert", - "automation", - "binary_sensor", - "calendar", - "camera", - "counter", - "cover", - "dominos", - "fan", - "geo_location", - "group", - "image_processing", - "input_boolean", - "input_datetime", - "input_number", - "input_select", - "input_text", - "light", - "lock", - "mailbox", - "media_player", - "number", - "person", - "plant", - "remember_the_milk", - "remote", - "scene", - "script", - "sensor", - "switch", - "timer", - "utility_meter", - "vacuum", - "weather", - "wink", - "zha", - "zwave", -]; From 4f731baa00e20799f1b1e0f1acb4be66411e47cd Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 17 May 2021 16:24:39 +0200 Subject: [PATCH 052/117] Add guard for non color lights (#9186) --- .../more-info/controls/more-info-light.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/dialogs/more-info/controls/more-info-light.ts b/src/dialogs/more-info/controls/more-info-light.ts index 2cff114519..1dffd398a4 100644 --- a/src/dialogs/more-info/controls/more-info-light.ts +++ b/src/dialogs/more-info/controls/more-info-light.ts @@ -282,15 +282,18 @@ class MoreInfoLight extends LitElement { stateObj.attributes.color_mode === LightColorModes.RGBWW ? Math.round((stateObj.attributes.rgbww_color[4] * 100) / 255) : undefined; - this._colorBrightnessSliderValue = Math.round( - (Math.max(...getLightCurrentModeRgbColor(stateObj).slice(0, 3)) * 100) / - 255 - ); - this._colorPickerColor = getLightCurrentModeRgbColor(stateObj).slice( - 0, - 3 - ) as [number, number, number]; + const currentRgbColor = getLightCurrentModeRgbColor(stateObj); + + this._colorBrightnessSliderValue = currentRgbColor + ? Math.round((Math.max(...currentRgbColor.slice(0, 3)) * 100) / 255) + : undefined; + + this._colorPickerColor = currentRgbColor?.slice(0, 3) as [ + number, + number, + number + ]; } else { this._brightnessSliderValue = 0; } From 1f65328f2d4bcdf54f259054ffc6ff416a845091 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 17 May 2021 16:55:12 +0200 Subject: [PATCH 053/117] Make slider default for number selector (#9190) --- src/components/ha-selector/ha-selector-number.ts | 12 +++++------- src/data/selector.ts | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/ha-selector/ha-selector-number.ts b/src/components/ha-selector/ha-selector-number.ts index 393dbb7d00..8f64b386bf 100644 --- a/src/components/ha-selector/ha-selector-number.ts +++ b/src/components/ha-selector/ha-selector-number.ts @@ -29,12 +29,12 @@ export class HaNumberSelector extends LitElement { protected render() { return html`${this.label} - ${this.selector.number.mode === "slider" + ${this.selector.number.mode !== "box" ? html` Date: Mon, 17 May 2021 16:57:43 +0200 Subject: [PATCH 054/117] Correct types for script automation editors (#9184) --- .../config/automation/ha-automation-editor.ts | 13 ++++++++----- src/panels/config/script/ha-script-editor.ts | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 7b4ad82315..b0780ea237 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -75,7 +75,7 @@ declare global { export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public automationId!: string; + @property() public automationId: string | null = null; @property() public automations!: AutomationEntity[]; @@ -178,14 +178,14 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { aria-label=${this.hass.localize( "ui.panel.config.automation.picker.delete_automation" )} - class=${classMap({ warning: this.automationId })} + class=${classMap({ warning: Boolean(this.automationId) })} graphic="icon" > ${this.hass.localize( "ui.panel.config.automation.picker.delete_automation" )} @@ -349,7 +349,10 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { private async _loadConfig() { try { - const config = await getAutomationConfig(this.hass, this.automationId); + const config = await getAutomationConfig( + this.hass, + this.automationId as string + ); // Normalize data: ensure trigger, action and condition are lists // Happens when people copy paste their automations into the config @@ -470,7 +473,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { } private async _delete() { - await deleteAutomation(this.hass, this.automationId); + await deleteAutomation(this.hass, this.automationId as string); history.back(); } diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index bd11dc5bba..fc17217056 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -61,7 +61,7 @@ import { configSections } from "../ha-panel-config"; export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public scriptEntityId!: string; + @property() public scriptEntityId: string | null = null; @property() public route!: Route; @@ -161,12 +161,12 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { aria-label=${this.hass.localize( "ui.panel.config.script.editor.delete_script" )} - class=${classMap({ warning: this.scriptEntityId })} + class=${classMap({ warning: Boolean(this.scriptEntityId) })} graphic="icon" > ${this.hass.localize("ui.panel.config.script.editor.delete_script")} @@ -470,7 +470,7 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { private async _runScript(ev) { ev.stopPropagation(); - await triggerScript(this.hass, this.scriptEntityId); + await triggerScript(this.hass, this.scriptEntityId as string); showToast(this, { message: this.hass.localize( "ui.notification_toast.triggered", @@ -620,7 +620,10 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { } private async _delete() { - await deleteScript(this.hass, computeObjectId(this.scriptEntityId)); + await deleteScript( + this.hass, + computeObjectId(this.scriptEntityId as string) + ); history.back(); } From fd2728c02ced0b7af9a9ceb6a496465ce7072740 Mon Sep 17 00:00:00 2001 From: Charles Garwood Date: Mon, 17 May 2021 11:15:01 -0400 Subject: [PATCH 055/117] Fix Z-Wave JS add node wizard and add interview status (#9145) --- .../zwave_js/dialog-zwave_js-add-node.ts | 126 +++++++++++++++++- src/translations/en.json | 6 +- 2 files changed, 124 insertions(+), 8 deletions(-) diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts index 484b240212..0de86314ba 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts @@ -34,8 +34,14 @@ class DialogZWaveJSAddNode extends LitElement { @state() private _status = ""; + @state() private _nodeAdded = false; + @state() private _device?: ZWaveJSAddNodeDevice; + @state() private _stages?: string[]; + + private _stoppedTimeout?: any; + private _addNodeTimeoutHandle?: number; private _subscribed?: Promise<() => Promise>; @@ -128,6 +134,40 @@ class DialogZWaveJSAddNode extends LitElement { ` : ``} + ${this._status === "interviewing" + ? html` +
+ +
+

+ ${this.hass.localize( + "ui.panel.config.zwave_js.add_node.interview_started" + )} +

+ ${this._stages + ? html`
+ ${this._stages.map( + (stage) => html` + + + ${stage} + + ` + )} +
` + : ""} +
+
+ + ${this.hass.localize("ui.panel.config.zwave_js.common.close")} + + ` + : ``} ${this._status === "failed" ? html`
@@ -141,6 +181,21 @@ class DialogZWaveJSAddNode extends LitElement { "ui.panel.config.zwave_js.add_node.inclusion_failed" )}

+ ${this._stages + ? html`
+ ${this._stages.map( + (stage) => html` + + + ${stage} + + ` + )} +
` + : ""}
@@ -168,6 +223,21 @@ class DialogZWaveJSAddNode extends LitElement { )} + ${this._stages + ? html`
+ ${this._stages.map( + (stage) => html` + + + ${stage} + + ` + )} +
` + : ""}
@@ -211,16 +281,41 @@ class DialogZWaveJSAddNode extends LitElement { this._status = "failed"; } if (message.event === "inclusion stopped") { - if (this._status !== "finished") { - this._status = ""; - } - this._unsubscribe(); + // we get the inclusion stopped event before the node added event + // during a successful inclusion. so we set a timer to wait 3 seconds + // to give the node added event time to come in before assuming it + // timed out or was cancelled and unsubscribing. + this._stoppedTimeout = setTimeout(() => { + if (!this._nodeAdded) { + this._status = ""; + this._unsubscribe(); + this._stoppedTimeout = undefined; + } + }, 3000); } if (message.event === "device registered") { this._device = message.device; + } + if (message.event === "node added") { + this._nodeAdded = true; + if (this._stoppedTimeout) { + clearTimeout(this._stoppedTimeout); + } + this._status = "interviewing"; + } + + if (message.event === "interview completed") { this._status = "finished"; this._unsubscribe(); } + + if (message.event === "interview stage completed") { + if (this._stages === undefined) { + this._stages = [message.stage]; + } else { + this._stages = [...this._stages, message.stage]; + } + } } private _unsubscribe(): void { @@ -246,7 +341,13 @@ class DialogZWaveJSAddNode extends LitElement { this._unsubscribe(); this.entry_id = undefined; this._status = ""; + this._nodeAdded = false; this._device = undefined; + this._stages = undefined; + if (this._stoppedTimeout) { + clearTimeout(this._stoppedTimeout); + this._stoppedTimeout = undefined; + } this._use_secure_inclusion = false; fireEvent(this, "dialog-closed", { dialog: this.localName }); @@ -261,11 +362,24 @@ class DialogZWaveJSAddNode extends LitElement { } .success { - color: green; + color: var(--success-color); } .failed { - color: red; + color: var(--warning-color); + } + + .stages { + margin-top: 16px; + } + + .flex-container .stage ha-svg-icon { + width: 16px; + height: 16px; + margin-right: 0px; + } + .stage { + padding: 8px; } blockquote { diff --git a/src/translations/en.json b/src/translations/en.json index 00a5030c59..670cff6250 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2633,8 +2633,10 @@ "controller_in_inclusion_mode": "Your Z-Wave controller is now in inclusion mode.", "follow_device_instructions": "Follow the directions that came with your device to trigger pairing on the device.", "inclusion_failed": "The node could not be added. Please check the logs for more information.", - "inclusion_finished": "The node has been added. It may take a few minutes for all entities to show up as we finish setting up the node in the background.", - "view_device": "View Device" + "inclusion_finished": "The node has been added.", + "view_device": "View Device", + "interview_started": "The device is being interviewed. This may take some time.", + "interview_failed": "The device interview failed. Additional information may be available in the logs." }, "remove_node": { "title": "Remove a Z-Wave Node", From f8e8b5ad18baecf073a7a557a7b88f5c89578e0c Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 17 May 2021 11:19:47 -0700 Subject: [PATCH 056/117] Trace fixes (#9192) * Show sub-conditions * Better show errors in timeline * Add rendered nodes * Fix some rendering issues with sub-conditions in timeline * Improve condition rendering --- src/components/trace/hat-script-graph.ts | 69 +++++++++++-------- src/components/trace/hat-trace-timeline.ts | 21 ++++-- src/data/automation_i18n.ts | 4 +- src/data/device_automation.ts | 2 +- .../trace/ha-automation-trace-path-details.ts | 12 ++-- .../automation/trace/ha-automation-trace.ts | 12 ++-- 6 files changed, 71 insertions(+), 49 deletions(-) diff --git a/src/components/trace/hat-script-graph.ts b/src/components/trace/hat-script-graph.ts index cecb0feb28..7b0755ee4e 100644 --- a/src/components/trace/hat-script-graph.ts +++ b/src/components/trace/hat-script-graph.ts @@ -63,6 +63,8 @@ class HatScriptGraph extends LitElement { @property({ attribute: false }) public selected; + @property() renderedNodes: Record = {}; + @property() trackedNodes: Record = {}; private selectNode(config, path) { @@ -74,8 +76,9 @@ class HatScriptGraph extends LitElement { private render_trigger(config: Trigger, i: number) { const path = `trigger/${i}`; const tracked = this.trace && path in this.trace.trace; + this.renderedNodes[path] = { config, path }; if (tracked) { - this.trackedNodes[path] = { config, path }; + this.trackedNodes[path] = this.renderedNodes[path]; } return html` @@ -411,8 +418,9 @@ class HatScriptGraph extends LitElement { const type = Object.keys(NODE_TYPES).find((key) => key in node) || "other"; const nodeEl = NODE_TYPES[type].bind(this)(node, path); + this.renderedNodes[path] = { config: node, path }; if (this.trace && path in this.trace.trace) { - this.trackedNodes[path] = { config: node, path }; + this.trackedNodes[path] = this.renderedNodes[path]; } return nodeEl; } @@ -483,6 +491,7 @@ class HatScriptGraph extends LitElement { protected update(changedProps: PropertyValues) { if (changedProps.has("trace")) { + this.renderedNodes = {}; this.trackedNodes = {}; } super.update(changedProps); @@ -493,7 +502,7 @@ class HatScriptGraph extends LitElement { // Select first node if new trace loaded but no selection given. if (changedProps.has("trace")) { - const tracked = this.getTrackedNodes(); + const tracked = this.trackedNodes; const paths = Object.keys(tracked); // If trace changed and we have no or an invalid selection, select first option. @@ -509,42 +518,44 @@ class HatScriptGraph extends LitElement { if (this.trace) { const sortKeys = Object.keys(this.trace.trace); - const keys = Object.keys(this.trackedNodes).sort( + const keys = Object.keys(this.renderedNodes).sort( (a, b) => sortKeys.indexOf(a) - sortKeys.indexOf(b) ); - const sortedTrackedNodes = keys.reduce((obj, key) => { - obj[key] = this.trackedNodes[key]; - return obj; - }, {}); + const sortedTrackedNodes = {}; + const sortedRenderedNodes = {}; + for (const key of keys) { + sortedRenderedNodes[key] = this.renderedNodes[key]; + if (key in this.trackedNodes) { + sortedTrackedNodes[key] = this.trackedNodes[key]; + } + } + this.renderedNodes = sortedRenderedNodes; this.trackedNodes = sortedTrackedNodes; } } } - public getTrackedNodes() { - return this.trackedNodes; - } - public previousTrackedNode() { - const tracked = this.getTrackedNodes(); - const nodes = Object.keys(tracked); - - for (let i = nodes.indexOf(this.selected) - 1; i >= 0; i--) { - if (tracked[nodes[i]]) { - fireEvent(this, "graph-node-selected", tracked[nodes[i]]); - break; - } + const nodes = Object.keys(this.trackedNodes); + const prevIndex = nodes.indexOf(this.selected) - 1; + if (prevIndex >= 0) { + fireEvent( + this, + "graph-node-selected", + this.trackedNodes[nodes[prevIndex]] + ); } } public nextTrackedNode() { - const tracked = this.getTrackedNodes(); - const nodes = Object.keys(tracked); - for (let i = nodes.indexOf(this.selected) + 1; i < nodes.length; i++) { - if (tracked[nodes[i]]) { - fireEvent(this, "graph-node-selected", tracked[nodes[i]]); - break; - } + const nodes = Object.keys(this.trackedNodes); + const nextIndex = nodes.indexOf(this.selected) + 1; + if (nextIndex < nodes.length) { + fireEvent( + this, + "graph-node-selected", + this.trackedNodes[nodes[nextIndex]] + ); } } diff --git a/src/components/trace/hat-trace-timeline.ts b/src/components/trace/hat-trace-timeline.ts index ea6746322e..67c4eb1f04 100644 --- a/src/components/trace/hat-trace-timeline.ts +++ b/src/components/trace/hat-trace-timeline.ts @@ -245,13 +245,15 @@ class ActionRenderer { try { data = getDataFromPath(this.trace.config, path); } catch (err) { - this.entries.push( - html`Unable to extract path ${path}. Download trace and report as bug` + this._renderEntry( + path, + `Unable to extract path ${path}. Download trace and report as bug` ); return index + 1; } - const isTopLevel = path.split("/").length === 2; + const parts = path.split("/"); + const isTopLevel = parts.length === 2; if (!isTopLevel && !actionType) { this._renderEntry(path, path.replace(/\//g, " ")); @@ -267,7 +269,16 @@ class ActionRenderer { } this._renderEntry(path, describeAction(this.hass, data, actionType)); - return index + 1; + + let i = index + 1; + + for (; i < this.keys.length; i++) { + if (this.keys[i].split("/").length === parts.length) { + break; + } + } + + return i; } private _handleTrigger(index: number, triggerStep: TriggerTraceStep): number { @@ -303,7 +314,7 @@ class ActionRenderer { // +4: executed sequence const choosePath = this.keys[index]; - const startLevel = choosePath.split("/").length - 1; + const startLevel = choosePath.split("/").length; const chooseTrace = this._getItem(index)[0] as ChooseActionTraceStep; const defaultExecuted = chooseTrace.result?.choice === "default"; diff --git a/src/data/automation_i18n.ts b/src/data/automation_i18n.ts index 7b0caf842f..8dc2746556 100644 --- a/src/data/automation_i18n.ts +++ b/src/data/automation_i18n.ts @@ -7,8 +7,8 @@ export const describeCondition = (condition: Condition) => { if (condition.alias) { return condition.alias; } - if (condition.condition === "template") { - return "Test a template"; + if (["or", "and", "not"].includes(condition.condition)) { + return `multiple conditions using "${condition.condition}"`; } return `${condition.condition} condition`; }; diff --git a/src/data/device_automation.ts b/src/data/device_automation.ts index 339bf61a16..4392fa529e 100644 --- a/src/data/device_automation.ts +++ b/src/data/device_automation.ts @@ -17,7 +17,7 @@ export interface DeviceAction extends DeviceAutomation { } export interface DeviceCondition extends DeviceAutomation { - condition: string; + condition: "device"; } export interface DeviceTrigger extends DeviceAutomation { diff --git a/src/panels/config/automation/trace/ha-automation-trace-path-details.ts b/src/panels/config/automation/trace/ha-automation-trace-path-details.ts index a7c3754c4d..4afaa2abc5 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-path-details.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-path-details.ts @@ -38,6 +38,8 @@ export class HaAutomationTracePathDetails extends LitElement { @property() public logbookEntries!: LogbookEntry[]; + @property() renderedNodes: Record = {}; + @property() public trackedNodes!: Record; @state() private _view: "config" | "changed_variables" | "logbook" = "config"; @@ -99,12 +101,12 @@ export class HaAutomationTracePathDetails extends LitElement { const parts: TemplateResult[][] = []; let active = false; - const childConditionsPrefix = `${this.selected.path}/conditions/`; for (const curPath of Object.keys(this.trace.trace)) { - // Include all child conditions too + // Include all trace results until the next rendered node. + // Rendered nodes also include non-chosen choose paths. if (active) { - if (!curPath.startsWith(childConditionsPrefix)) { + if (curPath in this.renderedNodes) { break; } } else if (curPath === this.selected.path) { @@ -129,9 +131,7 @@ export class HaAutomationTracePathDetails extends LitElement { return html` ${curPath === this.selected.path ? "" - : html`

- Condition ${curPath.substr(childConditionsPrefix.length)} -

`} + : html`

${curPath.substr(this.selected.path.length + 1)}

`} ${data.length === 1 ? "" : html`

Iteration ${idx + 1}

`} Executed: ${formatDateTimeWithSeconds( diff --git a/src/panels/config/automation/trace/ha-automation-trace.ts b/src/panels/config/automation/trace/ha-automation-trace.ts index 9985d1a496..2f0afc5fee 100644 --- a/src/panels/config/automation/trace/ha-automation-trace.ts +++ b/src/panels/config/automation/trace/ha-automation-trace.ts @@ -81,9 +81,9 @@ export class HaAutomationTrace extends LitElement { ? this.hass.states[this._entityId] : undefined; - const trackedNodes = this.shadowRoot!.querySelector( - "hat-script-graph" - )?.getTrackedNodes(); + const graph = this.shadowRoot!.querySelector("hat-script-graph"); + const trackedNodes = graph?.trackedNodes; + const renderedNodes = graph?.renderedNodes; const title = stateObj?.attributes.friendly_name || this._entityId; @@ -234,6 +234,7 @@ export class HaAutomationTrace extends LitElement { .selected=${this._selected} .logbookEntries=${this._logbookEntries} .trackedNodes=${trackedNodes} + .renderedNodes=${renderedNodes} > ` : this._view === "config" @@ -442,9 +443,8 @@ export class HaAutomationTrace extends LitElement { private _timelinePathPicked(ev) { const path = ev.detail.value; - const nodes = this.shadowRoot!.querySelector( - "hat-script-graph" - )!.getTrackedNodes(); + const nodes = this.shadowRoot!.querySelector("hat-script-graph")! + .trackedNodes; if (nodes[path]) { this._selected = nodes[path]; } From 5730c14dc11bdac11b45354e8b68307abbcefb81 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 17 May 2021 14:59:46 -0700 Subject: [PATCH 057/117] Make hassio backwards compat (#9195) --- hassio/src/hassio-main.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hassio/src/hassio-main.ts b/hassio/src/hassio-main.ts index e5b8f89530..102513139a 100644 --- a/hassio/src/hassio-main.ts +++ b/hassio/src/hassio-main.ts @@ -2,6 +2,8 @@ import { customElement, html, property, PropertyValues } from "lit-element"; import { atLeastVersion } from "../../src/common/config/version"; import { applyThemesOnElement } from "../../src/common/dom/apply_themes_on_element"; import { fireEvent } from "../../src/common/dom/fire_event"; +import { isNavigationClick } from "../../src/common/dom/is-navigation-click"; +import { navigate } from "../../src/common/navigate"; import { HassioPanelInfo } from "../../src/data/hassio/supervisor"; import { Supervisor } from "../../src/data/supervisor/supervisor"; import { makeDialogManager } from "../../src/dialogs/make-dialog-manager"; @@ -46,7 +48,7 @@ export class HassioMain extends SupervisorBaseElement { // listen on this element for navigation events, so we need to forward them. // Joakim - April 26, 2021 - // Due to changes in behavior in Google Chrome, we changed navigate to fire on the top element + // Due to changes in behavior in Google Chrome, we changed navigate to listen on the top element top.addEventListener("location-changed", (ev) => // @ts-ignore fireEvent(this, ev.type, ev.detail, { @@ -54,6 +56,15 @@ export class HassioMain extends SupervisorBaseElement { }) ); + // Paulus - May 17, 2021 + // Convert the tags to native nav in Home Assistant < 2021.6 + document.body.addEventListener("click", (ev) => { + const href = isNavigationClick(ev); + if (href) { + navigate(document.body, href); + } + }); + // Forward haptic events to parent window. window.addEventListener("haptic", (ev) => { // @ts-ignore From 07bab7b26497a2c3969692eb8e2240127a642099 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 17 May 2021 16:05:58 -0700 Subject: [PATCH 058/117] Drop app-route (#9196) --- package.json | 1 - src/layouts/home-assistant.ts | 96 ++++++++++++++++++++--------------- yarn.lock | 15 ------ 3 files changed, 54 insertions(+), 58 deletions(-) diff --git a/package.json b/package.json index 671905fdcc..ecbb9f2e26 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,6 @@ "@mdi/js": "5.9.55", "@mdi/svg": "5.9.55", "@polymer/app-layout": "^3.0.2", - "@polymer/app-route": "^3.0.2", "@polymer/app-storage": "^3.0.2", "@polymer/iron-autogrow-textarea": "^3.0.1", "@polymer/iron-flex-layout": "^3.0.1", diff --git a/src/layouts/home-assistant.ts b/src/layouts/home-assistant.ts index 675781d5a5..bbe799862c 100644 --- a/src/layouts/home-assistant.ts +++ b/src/layouts/home-assistant.ts @@ -1,5 +1,5 @@ -import "@polymer/app-route/app-location"; import { customElement, html, state, PropertyValues } from "lit-element"; +import { isNavigationClick } from "../common/dom/is-navigation-click"; import { navigate } from "../common/navigate"; import { getStorageDefaultPanelUrlPath } from "../data/panel"; import "../resources/custom-card-support"; @@ -31,22 +31,16 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { protected render() { const hass = this.hass; - return html` - - ${this._panelUrl === undefined || this._route === undefined - ? "" - : hass && hass.states && hass.config && hass.services - ? html` - - ` - : html` `} - `; + return this._panelUrl === undefined || this._route === undefined + ? html`` + : hass && hass.states && hass.config && hass.services + ? html` + + ` + : html``; } protected firstUpdated(changedProps) { @@ -59,6 +53,49 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { this._updateHass({ suspendWhenHidden: ev.detail.suspend }); storeState(this.hass!); }); + + // Navigation + const useHash = __DEMO__; + const curPath = () => + window.decodeURIComponent( + useHash ? location.hash.substr(1) : location.pathname + ); + const updateRoute = (path = curPath()) => { + if (this._route && path === this._route.path) { + return; + } + this._route = { + prefix: "", + path: path, + }; + const dividerPos = path.indexOf("/", 1); + this._panelUrl = + dividerPos === -1 ? path.substr(1) : path.substr(1, dividerPos - 1); + }; + + window.addEventListener("location-changed", () => updateRoute()); + + // Handle history changes + if (useHash) { + window.addEventListener("hashchange", () => updateRoute()); + } else { + window.addEventListener("popstate", () => updateRoute()); + } + + // Handle clicking on links + window.addEventListener("click", (ev) => { + const href = isNavigationClick(ev); + if (href) { + navigate(this, href); + } + }); + + // Handle first navigation + if (["", "/"].includes(curPath())) { + navigate(this, `/${getStorageDefaultPanelUrlPath()}`, true); + } else { + updateRoute(); + } } protected updated(changedProps: PropertyValues): void { @@ -129,31 +166,6 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { } } - private async _routeChanged(ev) { - // routeChangged event listener is called while we're doing the fist render, - // causing the update to be ignored. So delay it to next task (Lit render is sync). - await new Promise((resolve) => setTimeout(resolve, 0)); - - const route = ev.detail.value as Route; - // If it's the first route that we process, - // check if we should navigate away from / - if ( - this._route === undefined && - (route.path === "" || route.path === "/") - ) { - navigate(window, `/${getStorageDefaultPanelUrlPath()}`, true); - return; - } - - this._route = route; - - const dividerPos = route.path.indexOf("/", 1); - this._panelUrl = - dividerPos === -1 - ? route.path.substr(1) - : route.path.substr(1, dividerPos - 1); - } - protected _checkVisibility() { if (document.hidden) { // If the document is hidden, we will prevent reconnects until we are visible again diff --git a/yarn.lock b/yarn.lock index 63437a8239..9dfc4c1569 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1961,14 +1961,6 @@ "@polymer/iron-scroll-target-behavior" "^3.0.0-pre.26" "@polymer/polymer" "^3.0.0" -"@polymer/app-route@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@polymer/app-route/-/app-route-3.0.2.tgz#749096fb610fb15d27c7b68446406f30786cf93d" - integrity sha512-8Y34evmsaYh7ONr+zLwLzXaU0iOZZQj1E2uB3iaToQHbOP1POhKlnmAycBQ/eFB8BwrdSUBaDQk+rZhio78FQw== - dependencies: - "@polymer/iron-location" "^3.0.0-pre.26" - "@polymer/polymer" "^3.0.0" - "@polymer/app-storage@^3.0.2": version "3.0.2" resolved "https://registry.yarnpkg.com/@polymer/app-storage/-/app-storage-3.0.2.tgz#9303d9cf246f4882b223cca7c36901ecc6fa003c" @@ -2103,13 +2095,6 @@ "@polymer/iron-scroll-target-behavior" "^3.0.0-pre.26" "@polymer/polymer" "^3.0.0" -"@polymer/iron-location@^3.0.0-pre.26": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@polymer/iron-location/-/iron-location-3.0.1.tgz#43a59fced248ea71db5833116fcdefa186b79527" - integrity sha512-almb+p/fdSi4bxG+vyXjY51fDZxHMxwiug51Lfvr86wZRXN/u21Y6BapxG5n9f0hPSy9fimjIAvaYmozi7VjyQ== - dependencies: - "@polymer/polymer" "^3.0.0" - "@polymer/iron-media-query@^3.0.0", "@polymer/iron-media-query@^3.0.0-pre.26": version "3.0.1" resolved "https://registry.yarnpkg.com/@polymer/iron-media-query/-/iron-media-query-3.0.1.tgz#5cd8a1c1e8c9b8bafd3dd5da14e0f8d2cfa76d83" From 7890ca85a88042cfeae4c90dd02b85a59d46acee Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 17 May 2021 16:06:19 -0700 Subject: [PATCH 059/117] Bumped version to 20210517.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b2cbfd5720..0bc0a1fedd 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20210504.0", + version="20210517.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", From 8d81ed58c8aa54cfe8667020866ac1ce9f3b94bf Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 18 May 2021 01:57:40 +0000 Subject: [PATCH 060/117] Translation update --- translations/frontend/ca.json | 4 +- translations/frontend/cs.json | 16 +++++ translations/frontend/de.json | 2 + translations/frontend/en.json | 4 +- translations/frontend/es.json | 4 +- translations/frontend/et.json | 4 +- translations/frontend/fi.json | 130 +++++++++++++++++++++++++++++++--- translations/frontend/hu.json | 13 +++- translations/frontend/it.json | 6 +- translations/frontend/pt.json | 50 +++++++++++-- translations/frontend/ru.json | 8 ++- 11 files changed, 219 insertions(+), 22 deletions(-) diff --git a/translations/frontend/ca.json b/translations/frontend/ca.json index 94e7bf4906..d8e67eac71 100644 --- a/translations/frontend/ca.json +++ b/translations/frontend/ca.json @@ -2917,7 +2917,9 @@ "controller_in_inclusion_mode": "El controlador Z-Wave ara està en mode d'inclusió.", "follow_device_instructions": "Segueix les instruccions del teu dispositiu per activar la vinculació al dispositiu.", "inclusion_failed": "No s'ha pogut afegir el node. Consulta els registres per a més informació.", - "inclusion_finished": "S'ha afegit el node. Pot ser que les entitats triguin uns minuts a aparèixer mentre s'acaba de configurar el node en segon pla.", + "inclusion_finished": "S'ha afegit el node.", + "interview_failed": "Ha fallat la consulta del dispositiu. Pots trobar informació addicional als registres.", + "interview_started": "S'està consultant el dispositiu. Això pot trigar una estona.", "introduction": "Aquest assistent et guiarà perquè afegeixis un node a la teva xarxa Z-Wave.", "secure_inclusion_warning": "Els dispositius segurs necessiten una amplada de banda més gran; si tens molts dispositius segurs pot ser que la xarxa Z-Wave vagi més lenta. Et recomanem que utilitzis la inclusió segura només en dispositius que realment ho necessitin com ara panys i controls de portes.", "start_inclusion": "Inicia la inclusió", diff --git a/translations/frontend/cs.json b/translations/frontend/cs.json index fe65fa927f..b75901f927 100644 --- a/translations/frontend/cs.json +++ b/translations/frontend/cs.json @@ -1200,6 +1200,10 @@ } }, "zha_reconfigure_device": { + "attribute": "Atribut", + "battery_device_warning": "Před zahájením procesu rekonfigurace budete muset probudit zařízení napájená z baterie. Pokyny k probuzení zařízení najdete v příručce k zařízení.", + "bind_header": "Vazba", + "button_hide": "Skrýt podrobnosti", "button_show": "Podrobnosti", "cluster_header": "Klastr", "configuration_complete": "Změna konfigurace zařízení dokončena.", @@ -1207,6 +1211,10 @@ "configuring_alt": "Nastavuji", "heading": "Znovunastavení zařízení", "in_progress": "Zařízení se překonfigurová. Může to chvíli trvat.", + "introduction": "Překonfigurujte zařízení v síti Zigbee. Tuto funkci použijte, pokud zařízení nefunguje správně.", + "min_max_change": "min/max/změna", + "reporting_header": "Hlášení", + "run_in_background": "Toto dialogové okno můžete zavřít a změna konfigurace bude pokračovat na pozadí.", "start_reconfiguration": "Spustit rekonfiguraci" } }, @@ -2161,6 +2169,7 @@ "license": "Publikováno pod licencí Apache 2.0", "path_configuration": "Cesta k souboru configuration.yaml: {path}", "server": "server", + "setup_time": "Doba nastavení", "source": "Zdroj:", "system_health_error": "Součást System Health není načtena. Přidejte 'system_health:' do configuration.yaml", "system_health": { @@ -2579,6 +2588,8 @@ "add_scene": "Přidat scénu", "delete_confirm": "Opravdu chcete tuto scénu smazat?", "delete_scene": "Smazat scénu", + "duplicate": "Duplikovat", + "duplicate_scene": "Duplikovat scénu", "edit_scene": "Upravit scénu", "header": "Editor scén", "headers": { @@ -2815,6 +2826,7 @@ "shortcuts_title": "Zástupci", "update_button": "Aktualizovat nastavení", "zha_options": { + "default_light_transition": "Výchozí doba přechodu světla (sekundy)", "title": "Globální možnosti" } }, @@ -2943,6 +2955,7 @@ "zwave_info": "Z-Wave Info" }, "logs": { + "log_level": "Úroveň protokolu", "title": "Z-Wave JS protokoly" }, "navigation": { @@ -2974,7 +2987,10 @@ "unknown": "Nezjištěno" }, "reinterview_node": { + "battery_device_warning": "Před zahájením opakovaného rozhovoru je třeba probudit zařízení napájená z baterie. Pokyny k probuzení zařízení naleznete v příručce k zařízení.", + "in_progress": "Zařízení je dotazováno. To může nějakou dobu trvat.", "interview_complete": "Pohovor se zařízením dokončen.", + "interview_failed": "Dotazování zařízení se nezdařilo. Další informace mohou být k dispozici v protokolech.", "run_in_background": "Toto dialogové okno můžete zavřít a rozhovor bude pokračovat na pozadí.", "start_reinterview": "Zahájit opakovaný rozhovor" }, diff --git a/translations/frontend/de.json b/translations/frontend/de.json index 815a52c017..a1dda6235e 100644 --- a/translations/frontend/de.json +++ b/translations/frontend/de.json @@ -2588,6 +2588,8 @@ "add_scene": "Szene hinzufügen", "delete_confirm": "Bist du sicher, dass du diese Szene löschen möchtest?", "delete_scene": "Szene löschen", + "duplicate": "Duplizieren", + "duplicate_scene": "Szene duplizieren", "edit_scene": "Szene bearbeiten", "header": "Szenen-Editor", "headers": { diff --git a/translations/frontend/en.json b/translations/frontend/en.json index 2742873f2d..c91a7b8f4c 100644 --- a/translations/frontend/en.json +++ b/translations/frontend/en.json @@ -2917,7 +2917,9 @@ "controller_in_inclusion_mode": "Your Z-Wave controller is now in inclusion mode.", "follow_device_instructions": "Follow the directions that came with your device to trigger pairing on the device.", "inclusion_failed": "The node could not be added. Please check the logs for more information.", - "inclusion_finished": "The node has been added. It may take a few minutes for all entities to show up as we finish setting up the node in the background.", + "inclusion_finished": "The node has been added.", + "interview_failed": "The device interview failed. Additional information may be available in the logs.", + "interview_started": "The device is being interviewed. This may take some time.", "introduction": "This wizard will guide you through adding a node to your Z-Wave network.", "secure_inclusion_warning": "Secure devices require additional bandwidth; too many secure devices can slow down your Z-Wave network. We recommend only using secure inclusion for devices that require it, like locks or garage door openers.", "start_inclusion": "Start Inclusion", diff --git a/translations/frontend/es.json b/translations/frontend/es.json index 25049a91f3..01459061e6 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -2917,7 +2917,9 @@ "controller_in_inclusion_mode": "Tu controlador Z-Wave ahora está en modo de inclusión.", "follow_device_instructions": "Sigue las instrucciones que vienen con el dispositivo para activar el emparejamiento en el dispositivo.", "inclusion_failed": "No se pudo agregar el nodo. Por favor, consulta los registros para obtener más información.", - "inclusion_finished": "Se ha agregado el nodo. Pueden tardar unos minutos en aparecer todas las entidades mientras terminamos de configurar el nodo en segundo plano.", + "inclusion_finished": "Se ha agregado el nodo.", + "interview_failed": "La entrevista del dispositivo falló. Es posible que haya información adicional disponible en los registros.", + "interview_started": "El dispositivo está siendo entrevistado. Esto puede llevar algún tiempo.", "introduction": "Este asistente te guiará para añadir un nodo a tu red Z-Wave.", "secure_inclusion_warning": "Los dispositivos seguros requieren ancho de banda adicional; demasiados dispositivos seguros pueden ralentizar tu red Z-Wave. Recomendamos usar solo la inclusión segura para dispositivos que lo requieran, como cerraduras o abre-puertas de garaje.", "start_inclusion": "Iniciar inclusión", diff --git a/translations/frontend/et.json b/translations/frontend/et.json index e59c6fe131..78e7590be4 100644 --- a/translations/frontend/et.json +++ b/translations/frontend/et.json @@ -2917,7 +2917,9 @@ "controller_in_inclusion_mode": "Z-Wave kontroller on nüüd kaasamise režiimis.", "follow_device_instructions": "Sidumise käivitamiseks järgi seadmega kaasas olnud juhiseid.", "inclusion_failed": "Sõlme ei saanud lisada. Lisateabe saamiseks vaata logi.", - "inclusion_finished": "Sõlm on lisatud. See võib võtta paar minutit, et kõik üksused ilmuksid kuni me lõpetame taustal sõlme loomise.", + "inclusion_finished": "Sõlm on lisatud.", + "interview_failed": "Seadme küsitlemine nurjus. Lisateave võib olla kättesaadav logides.", + "interview_started": "Seadet küsitletakse. See võib võtta aega.", "introduction": "See viisard juhendab sõlme lisamisel Z-Wave'i võrku.", "secure_inclusion_warning": "Turvalised seadmed vajavad täiendavat ribalaiust; liiga palju turvalisi seadmeid võib Z-Wave võrku aeglustada. Turvalist kaasamist soovitame kasutada ainult seadmete jaoks mis seda vajavad, näiteks lukud või garaažiukse avajad.", "start_inclusion": "Alusta kaasamist", diff --git a/translations/frontend/fi.json b/translations/frontend/fi.json index b0f919f978..250dd5ded7 100644 --- a/translations/frontend/fi.json +++ b/translations/frontend/fi.json @@ -113,6 +113,7 @@ }, "network": { "container": "Kontti", + "disabled": "Poistettu käytöstä", "header": "Verkko", "host": "Isäntä" }, @@ -170,6 +171,16 @@ "description": "Tämä lisäosa käyttää Ingressiä upottaakseen käyttöliittymänsä turvallisesti Home Assistantiin.", "title": "Ingress" }, + "label": { + "docker": "Docker", + "hardware": "Laitteisto", + "hass": "hass", + "hassio": "hassio", + "host": "Isäntä", + "host_pid": "isäntä pid", + "rating": "luokitus", + "stage": "vaihe" + }, "rating": { "description": "Home Assistant antaa jokaiselle lisäosalle turvallisuusluokituksen, joka kertoo lisäosan käyttöön liittyvistä riskeistä. Mitä enemmän käyttöoikeuksia lisäosa vaatii, sitä enemmän mahdollisia tietoturvariskejä se aiheuttaa, mikä alentaa pistemäärää.\n\nLuokituksen asteikko on 1–6, missä huonoin pistemäärä on 1 (heikoin turvallisuus ja suurimmat riskit) ja paras pistemäärä on 6 (turvallisin ja pienimmät riskit).", "title": "Lisäosan turvallisuusluokitus" @@ -218,6 +229,7 @@ "title": "Varoitus: Suojaustila ei ole käytössä!" }, "ram_usage": "Lisäosan muistinkäyttö", + "rebuild": "uudelleenrakenna", "restart": "käynnistä uudelleen", "start": "käynnistä", "stop": "pysäytä", @@ -331,7 +343,9 @@ }, "update": { "create_snapshot": "Luo tilannevedos kohteesta {name} ennen päivittämistä", - "snapshot": "Tilannevedos" + "snapshot": "Tilannevedos", + "snapshotting": "Luo tilannevedos kohteesta {name}", + "updating": "Päivitetään {name} versioon {version}" } }, "my": { @@ -339,13 +353,16 @@ }, "panel": { "dashboard": "Kojelauta", + "snapshots": "Tilannekuvat", "store": "Lisäosakauppa", "system": "Järjestelmä" }, "snapshot": { "addons": "Lisäosat", + "available_snapshots": "Saatavilla olevat tilannekuvat", "create": "Luo", "create_snapshot": "Luo tilannevedos", + "created": "Luotu ", "enter_password": "Syötä salasana.", "folder": { "addons/local": "Paikalliset lisäosat", @@ -366,7 +383,9 @@ "upload_snapshot": "Lähetä tilannevedos" }, "store": { - "no_results_found": "Ei tuloksia kohteesta {repository}." + "no_results_found": "Ei tuloksia kohteesta {repository}.", + "registries": "Rekisterit", + "repositories": "Tietovarastot" }, "system": { "core": { @@ -415,6 +434,7 @@ "leave_beta_description": "Vastaanota vakaita päivityksiä Home Assistantille, Supervisorille ja isännälle", "ram_usage": "Supervisorin muistinkäyttö", "reload_supervisor": "Lataa Supervisor uudelleen", + "search": "Hae", "share_diagnostics": "Jaa diagnostiikka", "share_diagnostics_description": "Jaa kaatumisraportit ja diagnostiikkatiedot.", "share_diagonstics_description": "Haluatko jakaa kaatumisraportit ja diagnostiikkatiedot automaattisesti, kun Supervisor havaitsee odottamattomia virheitä? {line_break} Tämän avulla voimme korjata ongelmat. Tiedot ovat vain Home Assistant Core -tiimin käytettävissä, eikä niitä jaeta muille. {line_break} Tiedot eivät sisällä yksityisiä tai arkaluontoisia tietoja, ja voit poistaa tämän käytöstä asetuksissa milloin tahansa.", @@ -509,6 +529,7 @@ }, "light": { "brightness": "Kirkkaus", + "color_brightness": "Värikirkkaus", "color_temperature": "Värilämpötila", "effect": "Efekti", "white_value": "Valkoisuusarvo" @@ -661,6 +682,9 @@ "today": "Tänään" }, "data-table": { + "clear": "Tyhjennä", + "filtering_by": "Suodatus", + "hidden": "{number} piilotettu", "no-data": "Ei dataa", "search": "Hae" }, @@ -724,7 +748,8 @@ "was_unlocked": "avattiin", "was_unplugged": "kytkettin irti", "was_unsafe": "oli vaarallinen" - } + }, + "show_trace": "Näytä jäljitys" }, "media-browser": { "audio_not_supported": "Selaimesi ei tue audioelementtiä.", @@ -773,6 +798,12 @@ "label": "Kuva", "unsupported_format": "Muotoa ei tueta, valitse JPEG-, PNG- tai GIF-kuva." }, + "related-filter-menu": { + "filter_by_area": "Suodata alueen mukaan", + "filter_by_device": "Suodata laitteen mukaan", + "filtered_by_area": "alue: {area_name}", + "filtered_by_device": "laite: {device_name}" + }, "related-items": { "area": "Alue", "automation": "Osa seuraavia automaatioita", @@ -1013,6 +1044,7 @@ "zone": "Alueet" }, "reload": { + "automation": "Automaatiot", "filesize": "Lataa tiedostokokokohteet uudelleen", "homekit": "Lataa HomeKit uudelleen", "input_boolean": "Lataa booleanit uudelleen", @@ -1076,6 +1108,14 @@ "zha_device_card": { "device_name_placeholder": "Vaihda laitteen nimi" } + }, + "zha_reconfigure_device": { + "attribute": "Määrite", + "button_hide": "Piilota yksityiskohdat", + "button_show": "Näytä yksityiskohdat", + "cluster_header": "Klusteri", + "configuring_alt": "Määrittää", + "reporting_header": "Raportoi" } }, "duration": { @@ -1089,6 +1129,11 @@ "config": { "no_template_editor_support": "Visuaalinen editori ei tue malleja", "no_type_provided": "Tyyppiä ei ole annettu." + }, + "supervisor": { + "ask": "Pyydä apua", + "reboot": "Yritä uudelleenkäynnistää isäntä ", + "system_health": "Tarkista järjestelmän kunto" } }, "login-form": { @@ -1121,7 +1166,8 @@ "caption": "Alueet", "data_table": { "area": "Alue", - "devices": "Laitteet" + "devices": "Laitteet", + "entities": "Kohteet" }, "delete": { "confirmation_text": "Tälle alueelle kuuluvien laitteiden osoitus poistetaan.", @@ -1133,6 +1179,7 @@ "create": "Luo", "default_name": "Uusi alue", "delete": "Poista", + "linked_entities_caption": "Kohteet", "name": "Nimi", "name_required": "Nimi on pakollinen", "unknown_error": "Tuntematon virhe", @@ -1196,8 +1243,11 @@ "action": "Toiminta", "extra_fields": { "code": "Koodi", + "humidity": "Kosteus", "message": "Viesti", - "title": "Otsikko" + "mode": "Tila", + "title": "Otsikko", + "value": "Arvo" }, "label": "Laite" }, @@ -1270,7 +1320,9 @@ "extra_fields": { "above": "Yli", "below": "Alle", - "for": "Kesto" + "for": "Kesto", + "hvac_mode": "HVAC-tila", + "preset_mode": "Esiasetettu tila" }, "label": "Laite" }, @@ -1572,10 +1624,12 @@ "remote": { "access_is_being_prepared": "Etäkäyttöä valmistellaan. Ilmoitamme sinulle, kun se on valmis.", "certificate_info": "Sertifikaatin tiedot", + "connected": "Yhdistetty", "info": "Home Assistant Cloud tarjoaa turvallisen etäyhteyden ollessasi poissa kotoa.", "instance_is_available": "Asennuksesi on saatavilla osoitteessa", "instance_will_be_available": "Asennuksesi tulee saataville", "link_learn_how_it_works": "Lisätietoja toiminnasta", + "not_connected": "Ei yhteyttä", "title": "Etähallinta" }, "sign_out": "Kirjaudu ulos", @@ -1717,6 +1771,19 @@ "description": "Muuta Home Assistantin yleisiä asetuksiasi", "section": { "core": { + "analytics": { + "preference": { + "diagnostics": { + "title": "Diagnostiikka" + }, + "statistics": { + "title": "Käyttötilastot" + }, + "usage_supervisor": { + "description": "Nimet, versiot ja ominaisuudet." + } + } + }, "core_config": { "edit_requires_storage": "Editori on poistettu käytöstä, koska asetuksia on annettu configuration.yaml:ssa.", "elevation": "Korkeus merenpinnasta", @@ -1899,7 +1966,11 @@ }, "filtering": { "clear": "Tyhjennä", - "filtering_by": "Suodatus" + "filtering_by": "Suodatus", + "show": "Näytä" + }, + "hassio": { + "button": "Määrittele" }, "header": "Säädä Home Assistantia", "helpers": { @@ -1948,6 +2019,7 @@ "license": "Julkaistu Apache 2.0-lisenssillä", "path_configuration": "Polku configuration.yaml-tiedostoon: {path}", "server": "palvelin", + "setup_time": "Asennusaika", "source": "Lähde:", "system_health_error": "Järjestelmän kunto-komponenttia ei ole ladattu. Lisää 'system_health:' kohteeseen configuration.yaml", "system_health": { @@ -1966,6 +2038,8 @@ "caption": "Integraatiot", "config_entry": { "area": "Alueessa {area}", + "check_the_logs": "Tarkista lokitiedot", + "configure": "Määrittele", "delete": "Poista", "delete_confirm": "Haluatko varmasti poistaa tämän integraation?", "device_unavailable": "laite ei saatavissa", @@ -1987,8 +2061,10 @@ "entity_unavailable": "kohde ei saatavilla", "firmware": "Laiteohjelmisto: {version}", "hub": "Yhdistetty kautta", + "logs": "Lokit", "manuf": "{manufacturer}", "no_area": "Ei aluetta", + "not_loaded": "Ei ladattu", "options": "Asetukset", "reload": "Lataa uudelleen", "reload_confirm": "Integraatio ladattiin uudelleen", @@ -1996,6 +2072,10 @@ "rename": "Nimeä uudelleen", "restart_confirm": "Käynnistä Home Assistant uudellen viimeistelläksesi tämän integraation poistamisen", "services": "{count} {count, plural,\n one {palvelu}\n other {palvelua}\n}", + "state": { + "loaded": "Ladattu", + "not_loaded": "Ei ladattu" + }, "system_options": "Järjestelmäasetukset", "unnamed_entry": "Nimeämätön merkintä" }, @@ -2012,6 +2092,7 @@ }, "finish": "Valmis", "loading_first_time": "Odota, kunnes integraatio on asennettu", + "next": "Seuraava", "not_all_required_fields": "Täytä kaikki pakolliset kentät.", "submit": "Lähetä" }, @@ -2022,6 +2103,7 @@ "disable": { "disabled_integrations": "{number} poistettu käytöstä", "hide_disabled": "Piilota käytöstä poistetut integraatiot", + "show": "Näytä", "show_disabled": "Näytä käytöstä poistetut integraatiot" }, "discovered": "Löydetty", @@ -2057,6 +2139,12 @@ "clear": "Tyhjennä", "description": "Tarkastele Home Assistant -lokeja", "details": "Lokitiedot ( {level} )", + "level": { + "critical": "KRIITTINEN", + "error": "VIRHE", + "info": "TIEDOT", + "warning": "VAROITUS" + }, "load_full_log": "Lataa Home Assistantin koko loki", "loading_log": "Ladataan virhelokia...", "multiple_messages": "Viesti esiintyi ensimmäisen kerran {time} ja tämän jälkeen {counter} kertaa", @@ -2334,6 +2422,8 @@ "add_scene": "Lisää tilanne", "delete_confirm": "Haluatko varmasti poistaa tämän tilanteen?", "delete_scene": "Poista tilanne", + "duplicate": "Kopioi", + "duplicate_scene": "Kopioi tilanne", "edit_scene": "Muokkaa tilannetta", "header": "Tilanne-editori", "headers": { @@ -2565,6 +2655,10 @@ "manufacturer_code_override": "Valmistajan koodin yliajo", "value": "Arvo" }, + "configuration_page": { + "shortcuts_title": "Pikanäppäimet", + "update_button": "Päivitä kokoonpano" + }, "device_pairing_card": { "CONFIGURED": "Määritys valmis", "CONFIGURED_status_text": "Alustetaan", @@ -2655,12 +2749,15 @@ "dashboard": { "driver_version": "Ohjaimen versio", "dump_not_ready_confirm": "Lataa", - "home_id": "Kodin ID" + "home_id": "Kodin ID", + "server_version": "Palvelinversio" }, "device_info": { - "node_ready": "Solmu valmis" + "node_ready": "Solmu valmis", + "zwave_info": "Z-Wave tiedot" }, "navigation": { + "logs": "Lokit", "network": "Verkko" }, "network_status": { @@ -3250,6 +3347,7 @@ "error_remove": "Asetusta ei voida poistaa: {error}", "error_save_yaml": "YAML-tiedostoa ei voi tallentaa: {error}", "header": "Muokkaa asetuksia", + "reload": "Lataa uudelleen", "resources_moved": "Resursseja ei enää lisätä Lovelace-kokoonpanoon, mutta ne voidaan lisätä Lovelace config -paneeliin.", "save": "Tallenna", "saved": "Tallennettu", @@ -3335,6 +3433,9 @@ "empty": "Sinulle ei ole yhtään viestiä", "playback_title": "Toista viesti" }, + "my": { + "documentation": "dokumentaatio" + }, "page-authorize": { "abort_intro": "Kirjautuminen on keskeytetty", "authorizing_client": "Olet antamassa pääsyn {clientId} Home Assistant -ympäristöösi.", @@ -3480,6 +3581,9 @@ } }, "page-onboarding": { + "analytics": { + "finish": "Seuraava" + }, "core-config": { "button_detect": "Havaitse", "finish": "Seuraava", @@ -3591,6 +3695,14 @@ "enable": "Ota käyttöön", "header": "Monivaiheisen tunnistautumisen moduulit" }, + "number_format": { + "dropdown_label": "Numeromuoto", + "formats": { + "language": "Automaattinen (käytä kieliasetusta)", + "none": "Ei mitään" + }, + "header": "Numeromuoto" + }, "push_notifications": { "add_device_prompt": { "input_label": "Laitteen nimi", diff --git a/translations/frontend/hu.json b/translations/frontend/hu.json index 7f5ae34c9f..7f79d1ea49 100644 --- a/translations/frontend/hu.json +++ b/translations/frontend/hu.json @@ -802,6 +802,7 @@ } }, "service-control": { + "integration_doc": "Integrációs dokumentáció", "required": "Ez a mező kötelező", "service_data": "Szolgáltatás adatai", "target": "Célok", @@ -1157,6 +1158,7 @@ "create": "Létrehozás", "default_name": "Új Terület", "delete": "Törlés", + "linked_entities_caption": "Entitások", "name": "Név", "name_required": "Név szükséges", "unknown_error": "Ismeretlen hiba", @@ -2048,6 +2050,7 @@ }, "finish": "Befejezés", "loading_first_time": "Kérlek várj, amíg az integráció telepítésre kerül", + "next": "Következő", "not_all_required_fields": "Nincs kitöltve minden szükséges mező.", "pick_flow_step": { "title": "Felfedeztük ezeket, be akarod állítani őket?" @@ -2606,6 +2609,13 @@ "manufacturer_code_override": "Gyártói kód felülbírálása", "value": "Érték" }, + "configuration_page": { + "shortcuts_title": "Parancsikonok", + "update_button": "Beállítások frissítése", + "zha_options": { + "title": "Globális beállítások" + } + }, "device_pairing_card": { "CONFIGURED": "A konfigurálás befejeződött", "CONFIGURED_status_text": "Inicializálás", @@ -2716,7 +2726,8 @@ "node_config": { "error_device_not_found": "Az eszköz nem található", "header": "Z-Wave eszköz konfigurálása", - "parameter_is_read_only": "Ez a paraméter csak olvasható" + "parameter_is_read_only": "Ez a paraméter csak olvasható", + "set_param_error": "Hiba történt." }, "node_status": { "unknown": "Ismeretlen" diff --git a/translations/frontend/it.json b/translations/frontend/it.json index 4737b24302..5a5c997ed3 100644 --- a/translations/frontend/it.json +++ b/translations/frontend/it.json @@ -2588,6 +2588,8 @@ "add_scene": "Aggiungi scena", "delete_confirm": "Sei sicuro di voler cancellare questa scena?", "delete_scene": "Cancella scena", + "duplicate": "Duplica", + "duplicate_scene": "Scena duplicata", "edit_scene": "Modifica scena", "header": "Editor di scene", "headers": { @@ -2915,7 +2917,9 @@ "controller_in_inclusion_mode": "Il tuo controller Z-Wave è ora in modalità inclusione.", "follow_device_instructions": "Segui le indicazioni fornite con il tuo dispositivo per attivare l'associazione sul dispositivo.", "inclusion_failed": "Impossibile aggiungere il nodo. Si prega di controllare i registri per ulteriori informazioni.", - "inclusion_finished": "Il nodo è stato aggiunto. Potrebbero essere necessari alcuni minuti prima che tutte le entità vengano visualizzate mentre finiamo di configurare il nodo in background.", + "inclusion_finished": "Il nodo è stato aggiunto.", + "interview_failed": "L'interrogazione al dispositivo non è riuscita. Ulteriori informazioni potrebbero essere disponibili nei registri.", + "interview_started": "Il dispositivo viene interrogato. Potrebbe volerci un po' di tempo.", "introduction": "Questa procedura ti guiderà nell'aggiunta di un nodo alla tua rete Z-Wave.", "secure_inclusion_warning": "I dispositivi protetti richiedono una larghezza di banda aggiuntiva; troppi dispositivi sicuri possono rallentare la tua rete Z-Wave. Si consiglia di utilizzare l'inclusione sicura solo per i dispositivi che lo richiedono, come serrature o apri porta da garage.", "start_inclusion": "Avvia inclusione", diff --git a/translations/frontend/pt.json b/translations/frontend/pt.json index 8d513ee8d0..6ad736bf3f 100644 --- a/translations/frontend/pt.json +++ b/translations/frontend/pt.json @@ -138,6 +138,9 @@ "apparmor": { "title": "AppArmor" }, + "auth_api": { + "title": "Autenticação do Home Assistant" + }, "docker_api": { "title": "Acesso completo ao Docker" }, @@ -147,6 +150,9 @@ "hassio_api": { "description": "O suplemento tem acesso à API do Supervisor, a pedido do autor do complemento. Por defeito, o complemento pode aceder à informação da versão do seu sistema. Quando o complemento solicita acesso de nível 'gestor' ou 'administrador' à API, obterá acesso para controlar múltiplas partes do seu sistema Home Assistant. Esta permissão é indicada por este crachá e terá um impacto negativo na pontuação de segurança do complemento." }, + "ingress": { + "title": "Ingress" + }, "label": { "apparmor": "AppArmor", "docker": "docker", @@ -525,7 +531,7 @@ "brightness": "Brilho", "color_temperature": "Temperatura de cor", "effect": "Efeito", - "white_value": "Quantidade de brancos" + "white_value": "Brilho" }, "lock": { "code": "Código", @@ -681,6 +687,8 @@ "today": "Hoje" }, "data-table": { + "clear": "Limpar", + "filtering_by": "A filtrar por", "no-data": "Dados do evento", "search": "Procurar" }, @@ -1139,9 +1147,11 @@ }, "zha_reconfigure_device": { "attribute": "Atributo", + "bind_header": "Associação", "button_hide": "Ocultar detalhes", "button_show": "Mostrar Detalhes", "configuring_alt": "A configurar", + "min_max_change": "min/max/alterar", "start_reconfiguration": "Iniciar reconfiguração" } }, @@ -1210,6 +1220,7 @@ "linked_entities_caption": "Entidades", "name": "Nome", "name_required": "Nome é obrigatório", + "no_linked_entities": "Não há entidades ligadas a essa área.", "unknown_error": "Erro desconhecido", "update": "Atualizar" }, @@ -2045,6 +2056,7 @@ "license": "Publicado sob a licença de Apache 2.0", "path_configuration": "Caminho para configuration.yaml: {path}", "server": "servidor", + "setup_time": "Tempo de inicialização", "source": "Fonte:", "system_health_error": "O componente System Health não está carregado. Adicione 'system_health:' ao configuration.yaml", "system_health": { @@ -2063,8 +2075,11 @@ "caption": "Integrações", "config_entry": { "area": "Em {area}", + "check_the_logs": "Verifique os logs", + "configure": "Configurar", "delete": "Eliminar", "delete_confirm": "Tem a certeza que pretende apagar esta integração?", + "depends_on_cloud": "Depende da nuvem", "device_unavailable": "Dispositivo indisponível", "devices": "{count} {count, plural,\n one {dispositivo}\n other {dispositivos}\n}", "disable_restart_confirm": "Reinicie o Home Assistant para termina a desactivação desta integração", @@ -2086,6 +2101,7 @@ "hub": "Conectado via", "manuf": "por {manufacturer}", "no_area": "Nenhuma Área", + "not_loaded": "Não carregado", "options": "Opções", "reload": "Recarregar", "reload_confirm": "A integração foi recarregada", @@ -2093,6 +2109,12 @@ "rename": "Renomear", "restart_confirm": "Reinicie o Home Assistant para concluir a remoção desta integração", "services": "{count} {count, plural,\n one {serviço}\n other {serviços}\n}", + "state": { + "loaded": "Carregado", + "migration_error": "Erro de migração", + "not_loaded": "Não carregado", + "setup_error": "Erro ao inicializar" + }, "system_options": "Opções do sistema", "unnamed_entry": "Entrada sem nome" }, @@ -2122,6 +2144,7 @@ "disable": { "disabled_integrations": "{number} desativado", "hide_disabled": "Ocultar integrações desativadas", + "show": "Mostrar", "show_disabled": "Mostrar integrações desativadas" }, "discovered": "Descoberto", @@ -2435,6 +2458,7 @@ "delete_confirm": "Tem certeza de que deseja apagar esta cena?", "delete_scene": "Eliminar cena", "duplicate": "Duplicado", + "duplicate_scene": "Duplicar cena", "edit_scene": "Editar cena", "header": "Editor de cenários", "headers": { @@ -2788,7 +2812,12 @@ "node_status": "Estado do Nó", "zwave_info": "Informações sobre Z-Wave" }, + "logs": { + "log_level": "Nível de log", + "title": "Z-Wave JS Logs" + }, "navigation": { + "logs": "Logs", "network": "Rede" }, "network_status": { @@ -2796,6 +2825,10 @@ "connecting": "A conectar", "unknown": "Desconhecido" }, + "node_config": { + "error_device_not_found": "Dispositivo não encontrado", + "parameter_is_read_only": "Este parâmetro é apenas de leitura." + }, "node_status": { "alive": "Ativo", "asleep": "Adormecido", @@ -2919,7 +2952,7 @@ "count_listeners": " ({count} escutas)", "data": "Dados do evento (YAML, opcional)", "description": "Dispare um evento aqui.", - "documentation": "Documentação de eventos.", + "documentation": "Documentação de eventos", "event_fired": "Evento {name} despoletado", "fire_event": "Executar Evento", "listen_to_events": "Ouça os eventos", @@ -2950,7 +2983,7 @@ "copy_id": "Copiar para a Área de Transferência", "current_entities": "Entidades atuais", "description1": "Coloque o nome de um dispositivo do Home Assistant.", - "description2": "Isto não irá comunicar com o dispositivo.", + "description2": "Se a entidade pertencer a um dispositivo, não haverá comunicação com o dispositivo.", "entity": "Entidade", "filter_attributes": "Filtrar atributos", "filter_entities": "Filtrar entidades", @@ -3320,7 +3353,7 @@ "duplicate": "Duplicar cartão", "edit": "Editar", "header": "Configuração do cartão", - "move": "Mover para Vista", + "move": "Mover para vista", "move_after": "Mover cartão após", "move_before": "Mover cartão antes de", "options": "Mais opções", @@ -3742,6 +3775,15 @@ "enable": "Ativar", "header": "Módulos de Autenticação por Multíplos-fatores" }, + "number_format": { + "dropdown_label": "Formatação numérica", + "formats": { + "comma_decimal": "1,234,567.89", + "decimal_comma": "1.234.567,89", + "space_comma": "1 234 567,89" + }, + "header": "Formatação numérica" + }, "push_notifications": { "add_device_prompt": { "input_label": "Nome do dispositivo", diff --git a/translations/frontend/ru.json b/translations/frontend/ru.json index 1ea87f29ea..7ae2bbe5fe 100644 --- a/translations/frontend/ru.json +++ b/translations/frontend/ru.json @@ -96,8 +96,8 @@ }, "state": { "default": { - "off": "Выкл", - "on": "Вкл", + "off": "Выключено", + "on": "Включено", "unavailable": "Недоступно", "unknown": "Неизвестно" } @@ -2917,7 +2917,9 @@ "controller_in_inclusion_mode": "Ваш контроллер Z-Wave находится в режиме подключения.", "follow_device_instructions": "Следуйте инструкциям к подключаемому устройству, чтобы инициировать сопряжение.", "inclusion_failed": "Не удалось добавить узел. Проверьте журналы для получения дополнительной информации.", - "inclusion_finished": "Узел добавлен. Настройка узла выполняется в фоновом режиме, поэтому может пройти несколько минут, пока все объекты появятся в интерфейсе.", + "inclusion_finished": "Узел добавлен.", + "interview_failed": "Опрос устройства не удался. Дополнительная информация может быть получена в журналах.", + "interview_started": "Устройство опрашивается, это может занять некоторое время.", "introduction": "Этот мастер поможет Вам добавить узел в Вашу сеть Z-Wave.", "secure_inclusion_warning": "Для защищенных устройств требуется дополнительная пропускная способность. Слишком много таких устройств может замедлить работу Вашей сети Z-Wave. Мы рекомендуем использовать безопасное подключение только для устройств, которым требуется дополнительная защита, например, для замков или открывателей гаражных ворот.", "start_inclusion": "Начать подключение", From 245bb639f21d5ed9020f386f027b1463350f36d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Tue, 18 May 2021 10:22:03 +0200 Subject: [PATCH 061/117] Fix URL to jinja template docs (#9198) --- src/panels/developer-tools/template/developer-tools-template.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/developer-tools/template/developer-tools-template.ts b/src/panels/developer-tools/template/developer-tools-template.ts index 5b344be5d8..9014942a11 100644 --- a/src/panels/developer-tools/template/developer-tools-template.ts +++ b/src/panels/developer-tools/template/developer-tools-template.ts @@ -105,7 +105,7 @@ class HaPanelDevTemplate extends LitElement {
` : null} -
+
diff --git a/src/components/ha-circular-progress.ts b/src/components/ha-circular-progress.ts index 7b69afa6b8..0e9e2db188 100644 --- a/src/components/ha-circular-progress.ts +++ b/src/components/ha-circular-progress.ts @@ -1,5 +1,5 @@ import { CircularProgress } from "@material/mwc-circular-progress"; -import { customElement, property } from "lit-element"; +import { customElement, property } from "lit/decorators"; @customElement("ha-circular-progress") // @ts-ignore diff --git a/src/components/ha-climate-state.ts b/src/components/ha-climate-state.ts index bc330ff3b1..e9a14f653c 100644 --- a/src/components/ha-climate-state.ts +++ b/src/components/ha-climate-state.ts @@ -1,13 +1,6 @@ import { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { formatNumber } from "../common/string/format_number"; import { CLIMATE_PRESET_NONE } from "../data/climate"; import type { HomeAssistant } from "../types"; diff --git a/src/components/ha-code-editor.ts b/src/components/ha-code-editor.ts index 678eef7304..1aae3d649c 100644 --- a/src/components/ha-code-editor.ts +++ b/src/components/ha-code-editor.ts @@ -1,13 +1,6 @@ import type { EditorView, KeyBinding, ViewUpdate } from "@codemirror/view"; -import { - customElement, - state, - property, - PropertyValues, - ReactiveElement, - css, - CSSResultGroup, -} from "lit-element"; +import { css, CSSResultGroup, PropertyValues, ReactiveElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import { loadCodeMirror } from "../resources/codemirror.ondemand"; diff --git a/src/components/ha-color-picker.js b/src/components/ha-color-picker.js index e692ef3076..f94018ab71 100644 --- a/src/components/ha-color-picker.js +++ b/src/components/ha-color-picker.js @@ -1,8 +1,8 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; -import { EventsMixin } from "../mixins/events-mixin"; import { hs2rgb, rgb2hs } from "../common/color/convert-color"; +import { EventsMixin } from "../mixins/events-mixin"; /** * Color-picker custom element * diff --git a/src/components/ha-combo-box.ts b/src/components/ha-combo-box.ts index be09112404..eb122e1c7e 100644 --- a/src/components/ha-combo-box.ts +++ b/src/components/ha-combo-box.ts @@ -5,17 +5,8 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import "@polymer/paper-listbox/paper-listbox"; import "@vaadin/vaadin-combo-box/theme/material/vaadin-combo-box-light"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import { PolymerChangedEvent } from "../polymer-types"; import { HomeAssistant } from "../types"; diff --git a/src/components/ha-cover-controls.ts b/src/components/ha-cover-controls.ts index bbe03b6af4..446d9e76e7 100644 --- a/src/components/ha-cover-controls.ts +++ b/src/components/ha-cover-controls.ts @@ -2,15 +2,13 @@ import type { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { computeCloseIcon, computeOpenIcon } from "../common/entity/cover_icon"; import { UNAVAILABLE } from "../data/entity"; import type { HomeAssistant } from "../types"; diff --git a/src/components/ha-cover-tilt-controls.ts b/src/components/ha-cover-tilt-controls.ts index 9ae7e1eb8d..6bc444cec5 100644 --- a/src/components/ha-cover-tilt-controls.ts +++ b/src/components/ha-cover-tilt-controls.ts @@ -2,15 +2,13 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { UNAVAILABLE } from "../data/entity"; import { HomeAssistant } from "../types"; import CoverEntity from "../util/cover-model"; diff --git a/src/components/ha-date-input.ts b/src/components/ha-date-input.ts index a7ec481461..d2289c464b 100644 --- a/src/components/ha-date-input.ts +++ b/src/components/ha-date-input.ts @@ -1,17 +1,9 @@ -import "@vaadin/vaadin-date-picker/theme/material/vaadin-date-picker-light"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - PropertyValues, - query, -} from "lit-element"; -import "@polymer/paper-input/paper-input"; -import { fireEvent } from "../common/dom/fire_event"; import { mdiCalendar } from "@mdi/js"; +import "@polymer/paper-input/paper-input"; +import "@vaadin/vaadin-date-picker/theme/material/vaadin-date-picker-light"; +import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; +import { customElement, property, query } from "lit/decorators"; +import { fireEvent } from "../common/dom/fire_event"; import "./ha-svg-icon"; const i18n = { diff --git a/src/components/ha-date-range-picker.ts b/src/components/ha-date-range-picker.ts index 0b67c7e50a..15d8df0d79 100644 --- a/src/components/ha-date-range-picker.ts +++ b/src/components/ha-date-range-picker.ts @@ -7,13 +7,12 @@ import "@polymer/paper-input/paper-input"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import { formatDateTime } from "../common/datetime/format_date_time"; import { computeRTLDirection } from "../common/util/compute_rtl"; import { HomeAssistant } from "../types"; diff --git a/src/components/ha-dialog.ts b/src/components/ha-dialog.ts index a38faff951..b776bdf6cb 100644 --- a/src/components/ha-dialog.ts +++ b/src/components/ha-dialog.ts @@ -1,14 +1,11 @@ -import "@material/mwc-dialog"; -import type { Dialog } from "@material/mwc-dialog"; -import { style } from "@material/mwc-dialog/mwc-dialog-css"; +import { Dialog } from "@material/mwc-dialog"; import { mdiClose } from "@mdi/js"; -import { css, CSSResultGroup, customElement, html } from "lit-element"; +import { css, CSSResultGroup, html } from "lit"; +import { customElement } from "lit/decorators"; import { computeRTLDirection } from "../common/util/compute_rtl"; -import type { Constructor, HomeAssistant } from "../types"; +import type { HomeAssistant } from "../types"; import "./ha-icon-button"; -const MwcDialog = customElements.get("mwc-dialog") as Constructor; - export const createCloseHeading = (hass: HomeAssistant, title: string) => html` ${title} html` `; @customElement("ha-dialog") -export class HaDialog extends MwcDialog { +// @ts-expect-error +export class HaDialog extends Dialog { public scrollToPos(x: number, y: number) { this.contentElement.scrollTo(x, y); } @@ -33,7 +31,7 @@ export class HaDialog extends MwcDialog { protected static get styles(): CSSResultGroup { return [ - style, + Dialog.styles, css` .mdc-dialog { --mdc-dialog-scroll-divider-color: var(--divider-color); diff --git a/src/components/ha-expansion-panel.ts b/src/components/ha-expansion-panel.ts index 0676b6a178..9bed7d4fcf 100644 --- a/src/components/ha-expansion-panel.ts +++ b/src/components/ha-expansion-panel.ts @@ -1,15 +1,7 @@ import { mdiChevronDown } from "@mdi/js"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { fireEvent } from "../common/dom/fire_event"; import "./ha-svg-icon"; diff --git a/src/components/ha-fab.ts b/src/components/ha-fab.ts index 9725630b6c..c2f58b8f0f 100644 --- a/src/components/ha-fab.ts +++ b/src/components/ha-fab.ts @@ -1,12 +1,8 @@ -import "@material/mwc-fab"; -import type { Fab } from "@material/mwc-fab"; -import { customElement } from "lit-element"; -import { Constructor } from "../types"; - -const MwcFab = customElements.get("mwc-fab") as Constructor; +import { Fab } from "@material/mwc-fab"; +import { customElement } from "lit/decorators"; @customElement("ha-fab") -export class HaFab extends MwcFab { +export class HaFab extends Fab { protected firstUpdated(changedProperties) { super.firstUpdated(changedProperties); this.style.setProperty("--mdc-theme-secondary", "var(--primary-color)"); diff --git a/src/components/ha-file-upload.ts b/src/components/ha-file-upload.ts index d3324d63c4..2eec7319c0 100644 --- a/src/components/ha-file-upload.ts +++ b/src/components/ha-file-upload.ts @@ -2,18 +2,9 @@ import "@material/mwc-icon-button/mwc-icon-button"; import { mdiClose } from "@mdi/js"; import "@polymer/iron-input/iron-input"; import "@polymer/paper-input/paper-input-container"; -import { - css, - customElement, - html, - state, - LitElement, - property, - PropertyValues, - query, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, html, LitElement, PropertyValues, TemplateResult } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { fireEvent } from "../common/dom/fire_event"; import "./ha-circular-progress"; import "./ha-svg-icon"; diff --git a/src/components/ha-form/ha-form-boolean.ts b/src/components/ha-form/ha-form-boolean.ts index 2eac24c33f..2bf264a498 100644 --- a/src/components/ha-form/ha-form-boolean.ts +++ b/src/components/ha-form/ha-form-boolean.ts @@ -1,15 +1,7 @@ import "@polymer/paper-checkbox/paper-checkbox"; import type { PaperCheckboxElement } from "@polymer/paper-checkbox/paper-checkbox"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import type { HaFormBooleanData, diff --git a/src/components/ha-form/ha-form-constant.ts b/src/components/ha-form/ha-form-constant.ts index e860191635..d05e9ac5f6 100644 --- a/src/components/ha-form/ha-form-constant.ts +++ b/src/components/ha-form/ha-form-constant.ts @@ -1,13 +1,12 @@ import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { HaFormConstantSchema, HaFormElement } from "./ha-form"; diff --git a/src/components/ha-form/ha-form-float.ts b/src/components/ha-form/ha-form-float.ts index 9720f0ffd2..edf3c13576 100644 --- a/src/components/ha-form/ha-form-float.ts +++ b/src/components/ha-form/ha-form-float.ts @@ -1,13 +1,7 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import { - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { HaFormElement, HaFormFloatData, HaFormFloatSchema } from "./ha-form"; diff --git a/src/components/ha-form/ha-form-integer.ts b/src/components/ha-form/ha-form-integer.ts index cb8fa55d46..6f0ec4cfab 100644 --- a/src/components/ha-form/ha-form-integer.ts +++ b/src/components/ha-form/ha-form-integer.ts @@ -2,16 +2,8 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import "@polymer/paper-slider/paper-slider"; import type { PaperSliderElement } from "@polymer/paper-slider/paper-slider"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { HaCheckbox } from "../ha-checkbox"; import "../ha-slider"; diff --git a/src/components/ha-form/ha-form-multi_select.ts b/src/components/ha-form/ha-form-multi_select.ts index c9424e4ec6..93ad92bd65 100644 --- a/src/components/ha-form/ha-form-multi_select.ts +++ b/src/components/ha-form/ha-form-multi_select.ts @@ -4,17 +4,8 @@ import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-listbox/paper-listbox"; import "@polymer/paper-menu-button/paper-menu-button"; import "@polymer/paper-ripple/paper-ripple"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../ha-icon"; import { diff --git a/src/components/ha-form/ha-form-positive_time_period_dict.ts b/src/components/ha-form/ha-form-positive_time_period_dict.ts index 453eaf2a68..04ec575981 100644 --- a/src/components/ha-form/ha-form-positive_time_period_dict.ts +++ b/src/components/ha-form/ha-form-positive_time_period_dict.ts @@ -1,11 +1,5 @@ -import { - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; import "../ha-time-input"; import { HaFormElement, HaFormTimeData, HaFormTimeSchema } from "./ha-form"; diff --git a/src/components/ha-form/ha-form-select.ts b/src/components/ha-form/ha-form-select.ts index 05ee346726..5cf9dc013d 100644 --- a/src/components/ha-form/ha-form-select.ts +++ b/src/components/ha-form/ha-form-select.ts @@ -1,15 +1,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../ha-paper-dropdown-menu"; import { HaFormElement, HaFormSelectData, HaFormSelectSchema } from "./ha-form"; diff --git a/src/components/ha-form/ha-form-string.ts b/src/components/ha-form/ha-form-string.ts index d78d793268..82e4520bfa 100644 --- a/src/components/ha-form/ha-form-string.ts +++ b/src/components/ha-form/ha-form-string.ts @@ -1,17 +1,9 @@ +import "@material/mwc-icon-button/mwc-icon-button"; import { mdiEye, mdiEyeOff } from "@mdi/js"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../ha-svg-icon"; import type { @@ -19,7 +11,6 @@ import type { HaFormStringData, HaFormStringSchema, } from "./ha-form"; -import "@material/mwc-icon-button/mwc-icon-button"; @customElement("ha-form-string") export class HaFormString extends LitElement implements HaFormElement { diff --git a/src/components/ha-form/ha-form.ts b/src/components/ha-form/ha-form.ts index 4b7f3ef7d8..1a4c02e319 100644 --- a/src/components/ha-form/ha-form.ts +++ b/src/components/ha-form/ha-form.ts @@ -1,11 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { dynamicElement } from "../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../common/dom/fire_event"; import { HaTimeData } from "../ha-time-input"; diff --git a/src/components/ha-formfield.ts b/src/components/ha-formfield.ts index 9b31ed66f5..e7c9232f1d 100644 --- a/src/components/ha-formfield.ts +++ b/src/components/ha-formfield.ts @@ -1,18 +1,12 @@ -import "@material/mwc-formfield"; -import type { Formfield } from "@material/mwc-formfield"; -import { style } from "@material/mwc-formfield/mwc-formfield-css"; -import { css, CSSResultGroup, customElement } from "lit-element"; -import { Constructor } from "../types"; - -const MwcFormfield = customElements.get( - "mwc-formfield" -) as Constructor; - +import { Formfield } from "@material/mwc-formfield"; +import { css, CSSResultGroup } from "lit"; +import { customElement } from "lit/decorators"; @customElement("ha-formfield") -export class HaFormfield extends MwcFormfield { +// @ts-expect-error +export class HaFormfield extends Formfield { protected static get styles(): CSSResultGroup { return [ - style, + Formfield.styles, css` :host(:not([alignEnd])) ::slotted(ha-switch) { margin-right: 10px; diff --git a/src/components/ha-gauge.ts b/src/components/ha-gauge.ts index 11db5a890f..19fb9a4572 100644 --- a/src/components/ha-gauge.ts +++ b/src/components/ha-gauge.ts @@ -1,14 +1,7 @@ -import { - css, - customElement, - state, - LitElement, - property, - PropertyValues, - svg, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; -import { styleMap } from "lit-html/directives/style-map"; +import { css, LitElement, PropertyValues, svg } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; +import { styleMap } from "lit/directives/style-map"; import { formatNumber } from "../common/string/format_number"; import { afterNextRender } from "../common/util/render-status"; import { FrontendTranslationData } from "../data/translation"; diff --git a/src/components/ha-header-bar.ts b/src/components/ha-header-bar.ts index 0677e96673..68111455af 100644 --- a/src/components/ha-header-bar.ts +++ b/src/components/ha-header-bar.ts @@ -1,6 +1,7 @@ // @ts-ignore import topAppBarStyles from "@material/top-app-bar/dist/mdc.top-app-bar.min.css"; -import { css, customElement, html, LitElement, unsafeCSS } from "lit-element"; +import { css, html, LitElement, unsafeCSS } from "lit"; +import { customElement } from "lit/decorators"; @customElement("ha-header-bar") export class HaHeaderBar extends LitElement { diff --git a/src/components/ha-help-tooltip.ts b/src/components/ha-help-tooltip.ts index 73e60e5799..1194f77b98 100644 --- a/src/components/ha-help-tooltip.ts +++ b/src/components/ha-help-tooltip.ts @@ -1,13 +1,7 @@ import { mdiHelpCircle } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "./ha-svg-icon"; @customElement("ha-help-tooltip") diff --git a/src/components/ha-hls-player.ts b/src/components/ha-hls-player.ts index ee9d20001b..857e2c1874 100644 --- a/src/components/ha-hls-player.ts +++ b/src/components/ha-hls-player.ts @@ -2,15 +2,12 @@ import type HlsType from "hls.js"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, query, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import { nextRender } from "../common/util/render-status"; import { getExternalConfig } from "../external_app/external_config"; diff --git a/src/components/ha-icon-button-arrow-next.ts b/src/components/ha-icon-button-arrow-next.ts index d6076d7ffd..a0c58a48ef 100644 --- a/src/components/ha-icon-button-arrow-next.ts +++ b/src/components/ha-icon-button-arrow-next.ts @@ -1,13 +1,7 @@ import "@material/mwc-icon-button/mwc-icon-button"; import { mdiArrowLeft, mdiArrowRight } from "@mdi/js"; -import { - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { HomeAssistant } from "../types"; import "./ha-svg-icon"; diff --git a/src/components/ha-icon-button-arrow-prev.ts b/src/components/ha-icon-button-arrow-prev.ts index 50ef9120ee..dc192b88fe 100644 --- a/src/components/ha-icon-button-arrow-prev.ts +++ b/src/components/ha-icon-button-arrow-prev.ts @@ -1,13 +1,7 @@ import "@material/mwc-icon-button/mwc-icon-button"; import { mdiArrowLeft, mdiArrowRight } from "@mdi/js"; -import { - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { HomeAssistant } from "../types"; import "./ha-svg-icon"; diff --git a/src/components/ha-icon-button-next.ts b/src/components/ha-icon-button-next.ts index 8b4df6eb54..8f3a039ca0 100644 --- a/src/components/ha-icon-button-next.ts +++ b/src/components/ha-icon-button-next.ts @@ -1,13 +1,7 @@ import "@material/mwc-icon-button"; import { mdiChevronLeft, mdiChevronRight } from "@mdi/js"; -import { - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { HomeAssistant } from "../types"; import "./ha-svg-icon"; diff --git a/src/components/ha-icon-button-prev.ts b/src/components/ha-icon-button-prev.ts index 3a962bc23a..9bad876137 100644 --- a/src/components/ha-icon-button-prev.ts +++ b/src/components/ha-icon-button-prev.ts @@ -1,13 +1,7 @@ import "@material/mwc-icon-button/mwc-icon-button"; import { mdiChevronLeft, mdiChevronRight } from "@mdi/js"; -import { - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { HomeAssistant } from "../types"; import "./ha-svg-icon"; diff --git a/src/components/ha-icon-button.ts b/src/components/ha-icon-button.ts index 3e57d5a9b6..1195a8517a 100644 --- a/src/components/ha-icon-button.ts +++ b/src/components/ha-icon-button.ts @@ -1,13 +1,6 @@ import "@material/mwc-icon-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "./ha-icon"; @customElement("ha-icon-button") diff --git a/src/components/ha-icon-input.ts b/src/components/ha-icon-input.ts index 11f310c91f..fb62e3addb 100644 --- a/src/components/ha-icon-input.ts +++ b/src/components/ha-icon-input.ts @@ -1,12 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { - css, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import "./ha-icon"; diff --git a/src/components/ha-icon.ts b/src/components/ha-icon.ts index ba1a4a74da..3d43596f10 100644 --- a/src/components/ha-icon.ts +++ b/src/components/ha-icon.ts @@ -2,14 +2,12 @@ import "@polymer/iron-icon/iron-icon"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import { debounce } from "../common/util/debounce"; import { CustomIcon, customIconsets } from "../data/custom_iconsets"; diff --git a/src/components/ha-label-badge.ts b/src/components/ha-label-badge.ts index 66aa2dc0bc..67569aeecb 100644 --- a/src/components/ha-label-badge.ts +++ b/src/components/ha-label-badge.ts @@ -3,11 +3,11 @@ import { CSSResultGroup, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import "./ha-icon"; class HaLabelBadge extends LitElement { diff --git a/src/components/ha-markdown-element.ts b/src/components/ha-markdown-element.ts index 840fc97395..e0df4e40b7 100644 --- a/src/components/ha-markdown-element.ts +++ b/src/components/ha-markdown-element.ts @@ -1,4 +1,5 @@ -import { customElement, property, ReactiveElement } from "lit-element"; +import { ReactiveElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import { renderMarkdown } from "../resources/render-markdown"; diff --git a/src/components/ha-markdown.ts b/src/components/ha-markdown.ts index b47e96e706..0f192bac32 100644 --- a/src/components/ha-markdown.ts +++ b/src/components/ha-markdown.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "./ha-markdown-element"; @customElement("ha-markdown") diff --git a/src/components/ha-menu-button.ts b/src/components/ha-menu-button.ts index 067bf93324..2249b6fa24 100644 --- a/src/components/ha-menu-button.ts +++ b/src/components/ha-menu-button.ts @@ -1,16 +1,8 @@ import "@material/mwc-icon-button"; import { mdiMenu } from "@mdi/js"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import { computeDomain } from "../common/entity/compute_domain"; import { subscribeNotifications } from "../data/persistent_notification"; diff --git a/src/components/ha-picture-upload.ts b/src/components/ha-picture-upload.ts index f63eaedf4a..5111b07644 100644 --- a/src/components/ha-picture-upload.ts +++ b/src/components/ha-picture-upload.ts @@ -2,14 +2,8 @@ import "@material/mwc-icon-button/mwc-icon-button"; import { mdiImagePlus } from "@mdi/js"; import "@polymer/iron-input/iron-input"; import "@polymer/paper-input/paper-input-container"; -import { - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import { createImage, generateImageThumbnailUrl } from "../data/image"; import { showAlertDialog } from "../dialogs/generic/show-dialog-box"; diff --git a/src/components/ha-radio.ts b/src/components/ha-radio.ts index 8796750a74..f1269e5a9f 100644 --- a/src/components/ha-radio.ts +++ b/src/components/ha-radio.ts @@ -1,12 +1,7 @@ -import "@material/mwc-radio"; -import type { Radio } from "@material/mwc-radio"; -import { customElement } from "lit-element"; -import type { Constructor } from "../types"; - -const MwcRadio = customElements.get("mwc-radio") as Constructor; - +import { Radio } from "@material/mwc-radio"; +import { customElement } from "lit/decorators"; @customElement("ha-radio") -export class HaRadio extends MwcRadio { +export class HaRadio extends Radio { public firstUpdated() { super.firstUpdated(); this.style.setProperty("--mdc-theme-secondary", "var(--primary-color)"); diff --git a/src/components/ha-related-items.ts b/src/components/ha-related-items.ts index 9bee1152b5..4da2605b80 100644 --- a/src/components/ha-related-items.ts +++ b/src/components/ha-related-items.ts @@ -2,14 +2,12 @@ import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import { AreaRegistryEntry, diff --git a/src/components/ha-relative-time.ts b/src/components/ha-relative-time.ts index 83ad795ac7..36da1ab190 100644 --- a/src/components/ha-relative-time.ts +++ b/src/components/ha-relative-time.ts @@ -1,9 +1,5 @@ -import { - customElement, - property, - PropertyValues, - ReactiveElement, -} from "lit-element"; +import { PropertyValues, ReactiveElement } from "lit"; +import { customElement, property } from "lit/decorators"; import relativeTime from "../common/datetime/relative_time"; import type { HomeAssistant } from "../types"; diff --git a/src/components/ha-selector/ha-selector-action.ts b/src/components/ha-selector/ha-selector-action.ts index 321e5f4f00..5a6fd5f6c3 100644 --- a/src/components/ha-selector/ha-selector-action.ts +++ b/src/components/ha-selector/ha-selector-action.ts @@ -1,11 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { Action } from "../../data/script"; import { ActionSelector } from "../../data/selector"; import "../../panels/config/automation/action/ha-automation-action"; diff --git a/src/components/ha-selector/ha-selector-addon.ts b/src/components/ha-selector/ha-selector-addon.ts index 923fb4c29e..30214933f1 100644 --- a/src/components/ha-selector/ha-selector-addon.ts +++ b/src/components/ha-selector/ha-selector-addon.ts @@ -1,4 +1,5 @@ -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { AddonSelector } from "../../data/selector"; import { HomeAssistant } from "../../types"; import "../ha-addon-picker"; diff --git a/src/components/ha-selector/ha-selector-area.ts b/src/components/ha-selector/ha-selector-area.ts index 5fb5621570..5d619bf0e8 100644 --- a/src/components/ha-selector/ha-selector-area.ts +++ b/src/components/ha-selector/ha-selector-area.ts @@ -1,4 +1,5 @@ -import { customElement, html, state, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { ConfigEntry, getConfigEntries } from "../../data/config_entries"; import { DeviceRegistryEntry } from "../../data/device_registry"; import { EntityRegistryEntry } from "../../data/entity_registry"; diff --git a/src/components/ha-selector/ha-selector-boolean.ts b/src/components/ha-selector/ha-selector-boolean.ts index 7299316b72..154ecc4c9a 100644 --- a/src/components/ha-selector/ha-selector-boolean.ts +++ b/src/components/ha-selector/ha-selector-boolean.ts @@ -1,11 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { HomeAssistant } from "../../types"; import "../ha-formfield"; diff --git a/src/components/ha-selector/ha-selector-device.ts b/src/components/ha-selector/ha-selector-device.ts index b528beb784..bdf945899c 100644 --- a/src/components/ha-selector/ha-selector-device.ts +++ b/src/components/ha-selector/ha-selector-device.ts @@ -1,4 +1,5 @@ -import { customElement, html, state, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { ConfigEntry, getConfigEntries } from "../../data/config_entries"; import { DeviceRegistryEntry } from "../../data/device_registry"; import { DeviceSelector } from "../../data/selector"; diff --git a/src/components/ha-selector/ha-selector-entity.ts b/src/components/ha-selector/ha-selector-entity.ts index 884905f7bb..a2cb042c72 100644 --- a/src/components/ha-selector/ha-selector-entity.ts +++ b/src/components/ha-selector/ha-selector-entity.ts @@ -1,5 +1,6 @@ import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; -import { customElement, html, state, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { computeStateDomain } from "../../common/entity/compute_state_domain"; import { subscribeEntityRegistry } from "../../data/entity_registry"; import { EntitySelector } from "../../data/selector"; diff --git a/src/components/ha-selector/ha-selector-number.ts b/src/components/ha-selector/ha-selector-number.ts index 8f64b386bf..244f97e2ce 100644 --- a/src/components/ha-selector/ha-selector-number.ts +++ b/src/components/ha-selector/ha-selector-number.ts @@ -1,13 +1,7 @@ import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { fireEvent } from "../../common/dom/fire_event"; import { NumberSelector } from "../../data/selector"; import { HomeAssistant } from "../../types"; diff --git a/src/components/ha-selector/ha-selector-object.ts b/src/components/ha-selector/ha-selector-object.ts index 208bbaa6d4..e003f28251 100644 --- a/src/components/ha-selector/ha-selector-object.ts +++ b/src/components/ha-selector/ha-selector-object.ts @@ -1,4 +1,5 @@ -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { HomeAssistant } from "../../types"; import "../ha-yaml-editor"; diff --git a/src/components/ha-selector/ha-selector-select.ts b/src/components/ha-selector/ha-selector-select.ts index ae19d099d5..450a6d7e6a 100644 --- a/src/components/ha-selector/ha-selector-select.ts +++ b/src/components/ha-selector/ha-selector-select.ts @@ -1,14 +1,8 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; -import { HomeAssistant } from "../../types"; import { SelectSelector } from "../../data/selector"; +import { HomeAssistant } from "../../types"; import "../ha-paper-dropdown-menu"; @customElement("ha-selector-select") diff --git a/src/components/ha-selector/ha-selector-target.ts b/src/components/ha-selector/ha-selector-target.ts index 814b69275c..6299f60bf1 100644 --- a/src/components/ha-selector/ha-selector-target.ts +++ b/src/components/ha-selector/ha-selector-target.ts @@ -8,15 +8,8 @@ import { HassServiceTarget, UnsubscribeFunc, } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { ConfigEntry, getConfigEntries } from "../../data/config_entries"; import { DeviceRegistryEntry } from "../../data/device_registry"; import { diff --git a/src/components/ha-selector/ha-selector-text.ts b/src/components/ha-selector/ha-selector-text.ts index 9d2fbbd248..25cddf58d8 100644 --- a/src/components/ha-selector/ha-selector-text.ts +++ b/src/components/ha-selector/ha-selector-text.ts @@ -1,9 +1,10 @@ -import { customElement, html, LitElement, property } from "lit-element"; -import { fireEvent } from "../../common/dom/fire_event"; -import { HomeAssistant } from "../../types"; -import "@polymer/paper-input/paper-textarea"; import "@polymer/paper-input/paper-input"; +import "@polymer/paper-input/paper-textarea"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; +import { fireEvent } from "../../common/dom/fire_event"; import { StringSelector } from "../../data/selector"; +import { HomeAssistant } from "../../types"; @customElement("ha-selector-text") export class HaTextSelector extends LitElement { diff --git a/src/components/ha-selector/ha-selector-time.ts b/src/components/ha-selector/ha-selector-time.ts index 8fb0d530c0..48b57def22 100644 --- a/src/components/ha-selector/ha-selector-time.ts +++ b/src/components/ha-selector/ha-selector-time.ts @@ -1,4 +1,5 @@ -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../common/dom/fire_event"; import { TimeSelector } from "../../data/selector"; diff --git a/src/components/ha-selector/ha-selector.ts b/src/components/ha-selector/ha-selector.ts index 9982e33831..d426ec0b49 100644 --- a/src/components/ha-selector/ha-selector.ts +++ b/src/components/ha-selector/ha-selector.ts @@ -1,4 +1,5 @@ -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { dynamicElement } from "../../common/dom/dynamic-element-directive"; import { Selector } from "../../data/selector"; import { HomeAssistant } from "../../types"; @@ -9,11 +10,11 @@ import "./ha-selector-boolean"; import "./ha-selector-device"; import "./ha-selector-entity"; import "./ha-selector-number"; -import "./ha-selector-target"; -import "./ha-selector-time"; import "./ha-selector-object"; -import "./ha-selector-text"; import "./ha-selector-select"; +import "./ha-selector-target"; +import "./ha-selector-text"; +import "./ha-selector-time"; @customElement("ha-selector") export class HaSelector extends LitElement { diff --git a/src/components/ha-service-control.ts b/src/components/ha-service-control.ts index 359183544d..a93b7aba26 100644 --- a/src/components/ha-service-control.ts +++ b/src/components/ha-service-control.ts @@ -4,17 +4,8 @@ import { HassServices, HassServiceTarget, } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - PropertyValues, - query, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../common/dom/fire_event"; import { computeDomain } from "../common/entity/compute_domain"; diff --git a/src/components/ha-service-picker.ts b/src/components/ha-service-picker.ts index 1f7d8449d2..2bc92b97c4 100644 --- a/src/components/ha-service-picker.ts +++ b/src/components/ha-service-picker.ts @@ -1,4 +1,5 @@ -import { html, state, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../common/dom/fire_event"; import { LocalizeFunc } from "../common/translations/localize"; diff --git a/src/components/ha-settings-row.ts b/src/components/ha-settings-row.ts index aa6f9d5707..a28738b265 100644 --- a/src/components/ha-settings-row.ts +++ b/src/components/ha-settings-row.ts @@ -1,13 +1,6 @@ import "@polymer/paper-item/paper-item-body"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; @customElement("ha-settings-row") export class HaSettingsRow extends LitElement { diff --git a/src/components/ha-sidebar.ts b/src/components/ha-sidebar.ts index a3fe63f50d..9cd8a320bd 100644 --- a/src/components/ha-sidebar.ts +++ b/src/components/ha-sidebar.ts @@ -15,18 +15,15 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import { css, - CSSResultGroup, - customElement, - eventOptions, - html, - state, - LitElement, - property, - PropertyValues, CSSResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { guard } from "lit-html/directives/guard"; + CSSResultGroup, + html, + LitElement, + PropertyValues, +} from "lit"; +import { customElement, eventOptions, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { guard } from "lit/directives/guard"; import memoizeOne from "memoize-one"; import { LocalStorage } from "../common/decorators/local-storage"; import { fireEvent } from "../common/dom/fire_event"; diff --git a/src/components/ha-svg-icon.ts b/src/components/ha-svg-icon.ts index b803d3bc6d..b8f6a3b5c7 100644 --- a/src/components/ha-svg-icon.ts +++ b/src/components/ha-svg-icon.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - LitElement, - property, - svg, - SVGTemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, LitElement, svg, SVGTemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; @customElement("ha-svg-icon") export class HaSvgIcon extends LitElement { diff --git a/src/components/ha-switch.ts b/src/components/ha-switch.ts index 77ce4b30dd..2ab7106190 100644 --- a/src/components/ha-switch.ts +++ b/src/components/ha-switch.ts @@ -1,14 +1,10 @@ -import "@material/mwc-switch"; -import type { Switch } from "@material/mwc-switch"; -import { style } from "@material/mwc-switch/mwc-switch-css"; -import { css, CSSResultGroup, customElement, property } from "lit-element"; +import { Switch } from "@material/mwc-switch"; +import { css, CSSResultGroup } from "lit"; +import { customElement, property } from "lit/decorators"; import { forwardHaptic } from "../data/haptics"; -import { Constructor } from "../types"; - -const MwcSwitch = customElements.get("mwc-switch") as Constructor; - @customElement("ha-switch") -export class HaSwitch extends MwcSwitch { +// @ts-expect-error +export class HaSwitch extends Switch { // Generate a haptic vibration. // Only set to true if the new value of the switch is applied right away when toggling. // Do not add haptic when a user is required to press save. @@ -27,9 +23,9 @@ export class HaSwitch extends MwcSwitch { }); } - protected static get styles(): CSSResultGroup { + static get styles(): CSSResultGroup { return [ - style, + Switch.styles, css` .mdc-switch.mdc-switch--checked .mdc-switch__thumb { background-color: var(--switch-checked-button-color); diff --git a/src/components/ha-tab.ts b/src/components/ha-tab.ts index 1306c7cb4e..ac0d81d921 100644 --- a/src/components/ha-tab.ts +++ b/src/components/ha-tab.ts @@ -1,19 +1,15 @@ import type { Ripple } from "@material/mwc-ripple"; import "@material/mwc-ripple/mwc-ripple"; import { RippleHandlers } from "@material/mwc-ripple/ripple-handlers"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { - css, - CSSResultGroup, customElement, eventOptions, - html, - state, - LitElement, property, queryAsync, - TemplateResult, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; + state, +} from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; import "./ha-icon"; import "./ha-svg-icon"; diff --git a/src/components/ha-tabs.ts b/src/components/ha-tabs.ts index 491d36462f..035663190f 100644 --- a/src/components/ha-tabs.ts +++ b/src/components/ha-tabs.ts @@ -2,7 +2,7 @@ import type { PaperIconButtonElement } from "@polymer/paper-icon-button/paper-ic import type { PaperTabElement } from "@polymer/paper-tabs/paper-tab"; import "@polymer/paper-tabs/paper-tabs"; import type { PaperTabsElement } from "@polymer/paper-tabs/paper-tabs"; -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import { Constructor } from "../types"; const PaperTabs = customElements.get( diff --git a/src/components/ha-target-picker.ts b/src/components/ha-target-picker.ts index b2ceeb39f1..3e2e40260f 100644 --- a/src/components/ha-target-picker.ts +++ b/src/components/ha-target-picker.ts @@ -14,18 +14,9 @@ import { HassServiceTarget, UnsubscribeFunc, } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - query, - unsafeCSS, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, unsafeCSS } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { fireEvent } from "../common/dom/fire_event"; import { ensureArray } from "../common/ensure-array"; import { computeDomain } from "../common/entity/compute_domain"; diff --git a/src/components/ha-time-input.ts b/src/components/ha-time-input.ts index e72e1a09d9..382ea4d569 100644 --- a/src/components/ha-time-input.ts +++ b/src/components/ha-time-input.ts @@ -1,11 +1,5 @@ -import { - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import "./paper-time-input"; diff --git a/src/components/ha-yaml-editor.ts b/src/components/ha-yaml-editor.ts index f0eabb168d..07a1ac0a04 100644 --- a/src/components/ha-yaml-editor.ts +++ b/src/components/ha-yaml-editor.ts @@ -1,12 +1,6 @@ import { safeDump, safeLoad } from "js-yaml"; -import { - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import "./ha-code-editor"; diff --git a/src/components/map/ha-location-editor.ts b/src/components/map/ha-location-editor.ts index 8a7954cba6..b731aaead2 100644 --- a/src/components/map/ha-location-editor.ts +++ b/src/components/map/ha-location-editor.ts @@ -11,13 +11,12 @@ import { import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { LeafletModuleType, diff --git a/src/components/map/ha-locations-editor.ts b/src/components/map/ha-locations-editor.ts index 2dda009670..b0b8008906 100644 --- a/src/components/map/ha-locations-editor.ts +++ b/src/components/map/ha-locations-editor.ts @@ -11,13 +11,12 @@ import { import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { LeafletModuleType, diff --git a/src/components/map/ha-map.ts b/src/components/map/ha-map.ts index 3e4df08b30..fd29d2a268 100644 --- a/src/components/map/ha-map.ts +++ b/src/components/map/ha-map.ts @@ -2,13 +2,12 @@ import { Circle, Layer, Map, Marker, TileLayer } from "leaflet"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import { LeafletModuleType, replaceTileLayer, diff --git a/src/components/media-player/dialog-media-player-browse.ts b/src/components/media-player/dialog-media-player-browse.ts index ba885213fa..6e5a54d973 100644 --- a/src/components/media-player/dialog-media-player-browse.ts +++ b/src/components/media-player/dialog-media-player-browse.ts @@ -1,13 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent, HASSDomEvent } from "../../common/dom/fire_event"; import type { MediaPickedEvent, diff --git a/src/components/media-player/ha-media-player-browse.ts b/src/components/media-player/ha-media-player-browse.ts index 1c7e093527..db5b8af6b3 100644 --- a/src/components/media-player/ha-media-player-browse.ts +++ b/src/components/media-player/ha-media-player-browse.ts @@ -8,19 +8,21 @@ import "@polymer/paper-tooltip/paper-tooltip"; import { css, CSSResultGroup, - customElement, - eventOptions, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { ifDefined } from "lit-html/directives/if-defined"; -import { styleMap } from "lit-html/directives/style-map"; +} from "lit"; +import { + customElement, + property, + state, + query, + eventOptions, +} from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { ifDefined } from "lit/directives/if-defined"; +import { styleMap } from "lit/directives/style-map"; import { fireEvent } from "../../common/dom/fire_event"; import { computeRTLDirection } from "../../common/util/compute_rtl"; import { debounce } from "../../common/util/debounce"; diff --git a/src/components/state-history-charts.ts b/src/components/state-history-charts.ts index 20abd72ae2..9be40220da 100644 --- a/src/components/state-history-charts.ts +++ b/src/components/state-history-charts.ts @@ -1,19 +1,18 @@ -import "./ha-circular-progress"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; +import { isComponentLoaded } from "../common/config/is_component_loaded"; +import { HistoryResult } from "../data/history"; +import type { HomeAssistant } from "../types"; +import "./ha-circular-progress"; import "./state-history-chart-line"; import "./state-history-chart-timeline"; -import { isComponentLoaded } from "../common/config/is_component_loaded"; -import type { HomeAssistant } from "../types"; -import { HistoryResult } from "../data/history"; @customElement("state-history-charts") class StateHistoryCharts extends LitElement { diff --git a/src/components/trace/ha-timeline.ts b/src/components/trace/ha-timeline.ts index 4ce8b7b495..3ca99b56d2 100644 --- a/src/components/trace/ha-timeline.ts +++ b/src/components/trace/ha-timeline.ts @@ -1,13 +1,6 @@ import { mdiCircleOutline } from "@mdi/js"; -import { - LitElement, - customElement, - html, - css, - property, - TemplateResult, - state, -} from "lit-element"; +import { css, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { buttonLinkStyle } from "../../resources/styles"; import "../ha-svg-icon"; diff --git a/src/components/trace/hat-graph-node.ts b/src/components/trace/hat-graph-node.ts index ae0b59aa87..5b0ba7ca64 100644 --- a/src/components/trace/hat-graph-node.ts +++ b/src/components/trace/hat-graph-node.ts @@ -1,5 +1,5 @@ -import { css, customElement, LitElement, property, svg } from "lit-element"; - +import { css, LitElement, svg } from "lit"; +import { customElement, property } from "lit/decorators"; import { NODE_SIZE, SPACING } from "./hat-graph"; @customElement("hat-graph-node") diff --git a/src/components/trace/hat-graph-spacer.ts b/src/components/trace/hat-graph-spacer.ts index 22c6770a1b..e30c05bd5a 100644 --- a/src/components/trace/hat-graph-spacer.ts +++ b/src/components/trace/hat-graph-spacer.ts @@ -1,5 +1,5 @@ -import { css, customElement, LitElement, property, svg } from "lit-element"; - +import { css, LitElement, svg } from "lit"; +import { customElement, property } from "lit/decorators"; import { NODE_SIZE, SPACING } from "./hat-graph"; @customElement("hat-graph-spacer") diff --git a/src/components/trace/hat-graph.ts b/src/components/trace/hat-graph.ts index c7e06ae663..93ecdf015e 100644 --- a/src/components/trace/hat-graph.ts +++ b/src/components/trace/hat-graph.ts @@ -1,12 +1,6 @@ -import { - css, - customElement, - html, - LitElement, - property, - svg, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, html, LitElement, svg } from "lit"; +import { customElement, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; export const BRANCH_HEIGHT = 20; export const SPACING = 10; diff --git a/src/components/trace/hat-logbook-note.ts b/src/components/trace/hat-logbook-note.ts index 5d5b1f9df7..8df890bbf5 100644 --- a/src/components/trace/hat-logbook-note.ts +++ b/src/components/trace/hat-logbook-note.ts @@ -1,4 +1,5 @@ -import { LitElement, css, html, customElement } from "lit-element"; +import { css, html, LitElement } from "lit"; +import { customElement } from "lit/decorators"; @customElement("hat-logbook-note") class HatLogbookNote extends LitElement { diff --git a/src/components/trace/hat-script-graph.ts b/src/components/trace/hat-script-graph.ts index 7b0755ee4e..aff37a1032 100644 --- a/src/components/trace/hat-script-graph.ts +++ b/src/components/trace/hat-script-graph.ts @@ -1,19 +1,4 @@ -import { - html, - LitElement, - property, - customElement, - PropertyValues, - css, -} from "lit-element"; import "@material/mwc-icon-button/mwc-icon-button"; -import { fireEvent } from "../../common/dom/fire_event"; -import "../ha-svg-icon"; -import { - AutomationTraceExtended, - ChooseActionTraceStep, - ConditionTraceStep, -} from "../../data/trace"; import { mdiAbTesting, mdiArrowUp, @@ -32,9 +17,11 @@ import { mdiTimerOutline, mdiTrafficLight, } from "@mdi/js"; -import "./hat-graph-node"; -import { classMap } from "lit-html/directives/class-map"; -import { NODE_SIZE, SPACING, NodeInfo } from "./hat-graph"; +import { css, html, LitElement, PropertyValues } from "lit"; +import { customElement, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { fireEvent } from "../../common/dom/fire_event"; +import { ensureArray } from "../../common/ensure-array"; import { Condition, Trigger } from "../../data/automation"; import { Action, @@ -48,7 +35,14 @@ import { WaitAction, WaitForTriggerAction, } from "../../data/script"; -import { ensureArray } from "../../common/ensure-array"; +import { + AutomationTraceExtended, + ChooseActionTraceStep, + ConditionTraceStep, +} from "../../data/trace"; +import "../ha-svg-icon"; +import { NodeInfo, NODE_SIZE, SPACING } from "./hat-graph"; +import "./hat-graph-node"; import "./hat-graph-spacer"; declare global { diff --git a/src/components/trace/hat-trace-timeline.ts b/src/components/trace/hat-trace-timeline.ts index 67c4eb1f04..c56332f30b 100644 --- a/src/components/trace/hat-trace-timeline.ts +++ b/src/components/trace/hat-trace-timeline.ts @@ -1,24 +1,3 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - PropertyValues, - TemplateResult, -} from "lit-element"; -import { formatDateTimeWithSeconds } from "../../common/datetime/format_date_time"; -import { - AutomationTraceExtended, - ChooseActionTraceStep, - getDataFromPath, - TriggerTraceStep, - isTriggerPath, -} from "../../data/trace"; -import { HomeAssistant } from "../../types"; -import "./ha-timeline"; -import type { HaTimeline } from "./ha-timeline"; import { mdiAlertCircle, mdiCircle, @@ -27,16 +6,36 @@ import { mdiProgressWrench, mdiRecordCircleOutline, } from "@mdi/js"; +import { + css, + CSSResultGroup, + html, + LitElement, + PropertyValues, + TemplateResult, +} from "lit"; +import { customElement, property } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; +import { formatDateTimeWithSeconds } from "../../common/datetime/format_date_time"; +import relativeTime from "../../common/datetime/relative_time"; +import { fireEvent } from "../../common/dom/fire_event"; import { LogbookEntry } from "../../data/logbook"; import { ChooseAction, ChooseActionChoice, getActionType, } from "../../data/script"; -import relativeTime from "../../common/datetime/relative_time"; -import { fireEvent } from "../../common/dom/fire_event"; import { describeAction } from "../../data/script_i18n"; -import { ifDefined } from "lit-html/directives/if-defined"; +import { + AutomationTraceExtended, + ChooseActionTraceStep, + getDataFromPath, + isTriggerPath, + TriggerTraceStep, +} from "../../data/trace"; +import { HomeAssistant } from "../../types"; +import "./ha-timeline"; +import type { HaTimeline } from "./ha-timeline"; const LOGBOOK_ENTRIES_BEFORE_FOLD = 2; diff --git a/src/components/user/ha-person-badge.ts b/src/components/user/ha-person-badge.ts index 07cdd916ac..9074ea7c9f 100644 --- a/src/components/user/ha-person-badge.ts +++ b/src/components/user/ha-person-badge.ts @@ -1,14 +1,7 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { styleMap } from "lit-html/directives/style-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { styleMap } from "lit/directives/style-map"; import { Person } from "../../data/person"; import { computeInitials } from "./ha-user-badge"; diff --git a/src/components/user/ha-user-badge.ts b/src/components/user/ha-user-badge.ts index 3e5411d8dc..86a7b9ea83 100644 --- a/src/components/user/ha-user-badge.ts +++ b/src/components/user/ha-user-badge.ts @@ -1,15 +1,7 @@ -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { styleMap } from "lit-html/directives/style-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { styleMap } from "lit/directives/style-map"; import { computeStateDomain } from "../../common/entity/compute_state_domain"; import { User } from "../../data/user"; import { CurrentUser, HomeAssistant } from "../../types"; diff --git a/src/components/user/ha-user-picker.ts b/src/components/user/ha-user-picker.ts index 9a028ad7c6..89e779d3cc 100644 --- a/src/components/user/ha-user-picker.ts +++ b/src/components/user/ha-user-picker.ts @@ -3,14 +3,8 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../common/dom/fire_event"; import { compare } from "../../common/string/compare"; diff --git a/src/components/user/ha-users-picker.ts b/src/components/user/ha-users-picker.ts index 886307f5f1..d0420b82dd 100644 --- a/src/components/user/ha-users-picker.ts +++ b/src/components/user/ha-users-picker.ts @@ -1,14 +1,7 @@ import { mdiClose } from "@mdi/js"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { guard } from "lit-html/directives/guard"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import { guard } from "lit/directives/guard"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../common/dom/fire_event"; import { fetchUsers, User } from "../../data/user"; diff --git a/src/data/automation_i18n.ts b/src/data/automation_i18n.ts index 8dc2746556..c819ee340e 100644 --- a/src/data/automation_i18n.ts +++ b/src/data/automation_i18n.ts @@ -1,4 +1,4 @@ -import { Trigger, Condition } from "./automation"; +import { Condition, Trigger } from "./automation"; export const describeTrigger = (trigger: Trigger) => `${trigger.platform} trigger`; diff --git a/src/data/script_i18n.ts b/src/data/script_i18n.ts index 3b20e12865..338cb7c234 100644 --- a/src/data/script_i18n.ts +++ b/src/data/script_i18n.ts @@ -7,13 +7,13 @@ import { Condition } from "./automation"; import { describeCondition, describeTrigger } from "./automation_i18n"; import { ActionType, - getActionType, - DelayAction, - SceneAction, - WaitForTriggerAction, ActionTypes, - VariablesAction, + DelayAction, EventAction, + getActionType, + SceneAction, + VariablesAction, + WaitForTriggerAction, } from "./script"; export const describeAction = ( diff --git a/src/data/trace.ts b/src/data/trace.ts index cf5f18e6c2..a8d294454d 100644 --- a/src/data/trace.ts +++ b/src/data/trace.ts @@ -1,5 +1,5 @@ import { strStartsWith } from "../common/string/starts-with"; -import { HomeAssistant, Context } from "../types"; +import { Context, HomeAssistant } from "../types"; import { BlueprintAutomationConfig, ManualAutomationConfig, diff --git a/src/data/weather.ts b/src/data/weather.ts index e15844c9f4..3c27c13418 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -9,8 +9,8 @@ import { HassEntityAttributeBase, HassEntityBase, } from "home-assistant-js-websocket"; -import { css, html, svg, SVGTemplateResult, TemplateResult } from "lit-element"; -import { styleMap } from "lit-html/directives/style-map"; +import { css, html, svg, SVGTemplateResult, TemplateResult } from "lit"; +import { styleMap } from "lit/directives/style-map"; import { formatNumber } from "../common/string/format_number"; import "../components/ha-icon"; import "../components/ha-svg-icon"; diff --git a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts index 442be29383..bd1f6bbcd1 100644 --- a/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts +++ b/src/dialogs/config-entry-system-options/dialog-config-entry-system-options.ts @@ -1,14 +1,6 @@ import "@material/mwc-button/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { computeRTLDirection } from "../../common/util/compute_rtl"; import "../../components/ha-circular-progress"; diff --git a/src/dialogs/config-flow/dialog-data-entry-flow.ts b/src/dialogs/config-flow/dialog-data-entry-flow.ts index 86529c24dc..abe31c81be 100644 --- a/src/dialogs/config-flow/dialog-data-entry-flow.ts +++ b/src/dialogs/config-flow/dialog-data-entry-flow.ts @@ -4,13 +4,12 @@ import type { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, state } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { computeRTL } from "../../common/util/compute_rtl"; import "../../components/ha-circular-progress"; @@ -41,9 +40,9 @@ import "./step-flow-create-entry"; import "./step-flow-external"; import "./step-flow-form"; import "./step-flow-loading"; +import "./step-flow-pick-flow"; import "./step-flow-pick-handler"; import "./step-flow-progress"; -import "./step-flow-pick-flow"; let instance = 0; diff --git a/src/dialogs/config-flow/show-dialog-config-flow.ts b/src/dialogs/config-flow/show-dialog-config-flow.ts index 207429fcfe..fc49d0bf1f 100644 --- a/src/dialogs/config-flow/show-dialog-config-flow.ts +++ b/src/dialogs/config-flow/show-dialog-config-flow.ts @@ -1,4 +1,4 @@ -import { html } from "lit-element"; +import { html } from "lit"; import { caseInsensitiveCompare } from "../../common/string/compare"; import { createConfigFlow, diff --git a/src/dialogs/config-flow/show-dialog-data-entry-flow.ts b/src/dialogs/config-flow/show-dialog-data-entry-flow.ts index 23c3961378..1f48db7e77 100644 --- a/src/dialogs/config-flow/show-dialog-data-entry-flow.ts +++ b/src/dialogs/config-flow/show-dialog-data-entry-flow.ts @@ -1,4 +1,4 @@ -import { TemplateResult } from "lit-html"; +import { TemplateResult } from "lit"; import { fireEvent } from "../../common/dom/fire_event"; import { HaFormSchema } from "../../components/ha-form/ha-form"; import { diff --git a/src/dialogs/config-flow/show-dialog-options-flow.ts b/src/dialogs/config-flow/show-dialog-options-flow.ts index e2346c660d..c138272920 100644 --- a/src/dialogs/config-flow/show-dialog-options-flow.ts +++ b/src/dialogs/config-flow/show-dialog-options-flow.ts @@ -1,4 +1,4 @@ -import { html } from "lit-element"; +import { html } from "lit"; import { ConfigEntry } from "../../data/config_entries"; import { createOptionsFlow, diff --git a/src/dialogs/config-flow/step-flow-abort.ts b/src/dialogs/config-flow/step-flow-abort.ts index 041e681e15..b581717f8b 100644 --- a/src/dialogs/config-flow/step-flow-abort.ts +++ b/src/dialogs/config-flow/step-flow-abort.ts @@ -1,12 +1,6 @@ import "@material/mwc-button"; -import { - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { DataEntryFlowStepAbort } from "../../data/data_entry_flow"; import { HomeAssistant } from "../../types"; diff --git a/src/dialogs/config-flow/step-flow-create-entry.ts b/src/dialogs/config-flow/step-flow-create-entry.ts index 8ee662ba66..2d08078c88 100644 --- a/src/dialogs/config-flow/step-flow-create-entry.ts +++ b/src/dialogs/config-flow/step-flow-create-entry.ts @@ -2,15 +2,8 @@ import "@material/mwc-button"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-area-picker"; import { DataEntryFlowStepCreateEntry } from "../../data/data_entry_flow"; diff --git a/src/dialogs/config-flow/step-flow-external.ts b/src/dialogs/config-flow/step-flow-external.ts index 28261e6433..419d9bcde5 100644 --- a/src/dialogs/config-flow/step-flow-external.ts +++ b/src/dialogs/config-flow/step-flow-external.ts @@ -1,13 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { DataEntryFlowStepExternal } from "../../data/data_entry_flow"; import { HomeAssistant } from "../../types"; import { FlowConfig } from "./show-dialog-data-entry-flow"; diff --git a/src/dialogs/config-flow/step-flow-form.ts b/src/dialogs/config-flow/step-flow-form.ts index f168cc68e2..403eccb3c8 100644 --- a/src/dialogs/config-flow/step-flow-form.ts +++ b/src/dialogs/config-flow/step-flow-form.ts @@ -3,13 +3,12 @@ import "@polymer/paper-tooltip/paper-tooltip"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-circular-progress"; import "../../components/ha-form/ha-form"; diff --git a/src/dialogs/config-flow/step-flow-loading.ts b/src/dialogs/config-flow/step-flow-loading.ts index c8df08ae34..bc10d71c7a 100644 --- a/src/dialogs/config-flow/step-flow-loading.ts +++ b/src/dialogs/config-flow/step-flow-loading.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../components/ha-circular-progress"; @customElement("step-flow-loading") diff --git a/src/dialogs/config-flow/step-flow-pick-flow.ts b/src/dialogs/config-flow/step-flow-pick-flow.ts index 94f4ae203e..0e407fad89 100644 --- a/src/dialogs/config-flow/step-flow-pick-flow.ts +++ b/src/dialogs/config-flow/step-flow-pick-flow.ts @@ -1,15 +1,8 @@ -import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item"; +import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-icon-next"; import { localizeConfigFlowTitle } from "../../data/config_flow"; diff --git a/src/dialogs/config-flow/step-flow-pick-handler.ts b/src/dialogs/config-flow/step-flow-pick-handler.ts index 4ab3e2eeda..421478857c 100644 --- a/src/dialogs/config-flow/step-flow-pick-handler.ts +++ b/src/dialogs/config-flow/step-flow-pick-handler.ts @@ -1,18 +1,10 @@ import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; import Fuse from "fuse.js"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { styleMap } from "lit-html/directives/style-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { styleMap } from "lit/directives/style-map"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../common/dom/fire_event"; import "../../common/search/search-input"; diff --git a/src/dialogs/config-flow/step-flow-progress.ts b/src/dialogs/config-flow/step-flow-progress.ts index 347a178d95..3235ec55cb 100644 --- a/src/dialogs/config-flow/step-flow-progress.ts +++ b/src/dialogs/config-flow/step-flow-progress.ts @@ -1,13 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../components/ha-circular-progress"; import { DataEntryFlowStepProgress } from "../../data/data_entry_flow"; import { HomeAssistant } from "../../types"; diff --git a/src/dialogs/config-flow/styles.ts b/src/dialogs/config-flow/styles.ts index b6e2b8d831..008fed7c1b 100644 --- a/src/dialogs/config-flow/styles.ts +++ b/src/dialogs/config-flow/styles.ts @@ -1,4 +1,4 @@ -import { css } from "lit-element"; +import { css } from "lit"; export const configFlowContentStyles = css` h2 { diff --git a/src/dialogs/domain-toggler/dialog-domain-toggler.ts b/src/dialogs/domain-toggler/dialog-domain-toggler.ts index e07d2d9b4a..82307abfe1 100644 --- a/src/dialogs/domain-toggler/dialog-domain-toggler.ts +++ b/src/dialogs/domain-toggler/dialog-domain-toggler.ts @@ -1,13 +1,6 @@ import "@material/mwc-button/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, state } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { createCloseHeading } from "../../components/ha-dialog"; import "../../components/ha-formfield"; diff --git a/src/dialogs/generic/dialog-box.ts b/src/dialogs/generic/dialog-box.ts index 5ccd33d199..e7e4bee7b2 100644 --- a/src/dialogs/generic/dialog-box.ts +++ b/src/dialogs/generic/dialog-box.ts @@ -1,16 +1,8 @@ import "@material/mwc-button/mwc-button"; import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-dialog"; import "../../components/ha-switch"; diff --git a/src/dialogs/generic/show-dialog-box.ts b/src/dialogs/generic/show-dialog-box.ts index bd3210c5fd..1350c91d18 100644 --- a/src/dialogs/generic/show-dialog-box.ts +++ b/src/dialogs/generic/show-dialog-box.ts @@ -1,4 +1,4 @@ -import { TemplateResult } from "lit-html"; +import { TemplateResult } from "lit"; import { fireEvent } from "../../common/dom/fire_event"; interface BaseDialogBoxParams { diff --git a/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts b/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts index 2571ae29fe..f8709344e3 100644 --- a/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts +++ b/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts @@ -5,17 +5,14 @@ import cropperCss from "cropperjs/dist/cropper.css"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, unsafeCSS, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import "../../components/ha-dialog"; import { haStyleDialog } from "../../resources/styles"; import type { HomeAssistant } from "../../types"; diff --git a/src/dialogs/more-info/controls/more-info-automation.ts b/src/dialogs/more-info/controls/more-info-automation.ts index cdd9fe7729..0584b977ed 100644 --- a/src/dialogs/more-info/controls/more-info-automation.ts +++ b/src/dialogs/more-info/controls/more-info-automation.ts @@ -1,14 +1,7 @@ import "@material/mwc-button"; import { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../components/ha-relative-time"; import { triggerAutomationActions } from "../../../data/automation"; import { UNAVAILABLE_STATES } from "../../../data/entity"; diff --git a/src/dialogs/more-info/controls/more-info-camera.ts b/src/dialogs/more-info/controls/more-info-camera.ts index 1dfcd4157e..bc571b4bc8 100644 --- a/src/dialogs/more-info/controls/more-info-camera.ts +++ b/src/dialogs/more-info/controls/more-info-camera.ts @@ -4,14 +4,13 @@ import { css, CSSResultGroup, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { supportsFeature } from "../../../common/entity/supports-feature"; +} from "lit"; +import { property, state } from "lit/decorators"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; +import { supportsFeature } from "../../../common/entity/supports-feature"; import "../../../components/ha-camera-stream"; import { CameraEntity, diff --git a/src/dialogs/more-info/controls/more-info-climate.ts b/src/dialogs/more-info/controls/more-info-climate.ts index bd80dfc223..7d21934698 100644 --- a/src/dialogs/more-info/controls/more-info-climate.ts +++ b/src/dialogs/more-info/controls/more-info-climate.ts @@ -6,11 +6,11 @@ import { CSSResultGroup, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { fireEvent } from "../../../common/dom/fire_event"; import { supportsFeature } from "../../../common/entity/supports-feature"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; diff --git a/src/dialogs/more-info/controls/more-info-counter.ts b/src/dialogs/more-info/controls/more-info-counter.ts index fcdff2f781..3e08b0e522 100644 --- a/src/dialogs/more-info/controls/more-info-counter.ts +++ b/src/dialogs/more-info/controls/more-info-counter.ts @@ -1,14 +1,7 @@ import "@material/mwc-button"; import { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { UNAVAILABLE_STATES } from "../../../data/entity"; import { HomeAssistant } from "../../../types"; diff --git a/src/dialogs/more-info/controls/more-info-default.ts b/src/dialogs/more-info/controls/more-info-default.ts index 443b39ed43..b30cc74a7c 100644 --- a/src/dialogs/more-info/controls/more-info-default.ts +++ b/src/dialogs/more-info/controls/more-info-default.ts @@ -1,11 +1,6 @@ import { HassEntity } from "home-assistant-js-websocket"; -import { - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../components/ha-attributes"; import { HomeAssistant } from "../../../types"; diff --git a/src/dialogs/more-info/controls/more-info-fan.js b/src/dialogs/more-info/controls/more-info-fan.js index 93bbe59396..f7eb73e011 100644 --- a/src/dialogs/more-info/controls/more-info-fan.js +++ b/src/dialogs/more-info/controls/more-info-fan.js @@ -11,9 +11,9 @@ import "../../../components/ha-icon-button"; import "../../../components/ha-labeled-slider"; import "../../../components/ha-paper-dropdown-menu"; import "../../../components/ha-switch"; +import { SUPPORT_SET_SPEED } from "../../../data/fan"; import { EventsMixin } from "../../../mixins/events-mixin"; import LocalizeMixin from "../../../mixins/localize-mixin"; -import { SUPPORT_SET_SPEED } from "../../../data/fan"; /* * @appliesMixin EventsMixin diff --git a/src/dialogs/more-info/controls/more-info-group.ts b/src/dialogs/more-info/controls/more-info-group.ts index 597cf1d5a4..c8b2e7bdbb 100644 --- a/src/dialogs/more-info/controls/more-info-group.ts +++ b/src/dialogs/more-info/controls/more-info-group.ts @@ -2,12 +2,12 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - state, + html, LitElement, - property, PropertyValues, -} from "lit-element"; -import { html, TemplateResult } from "lit-html"; + TemplateResult, +} from "lit"; +import { property, state } from "lit/decorators"; import { dynamicElement } from "../../../common/dom/dynamic-element-directive"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; import { GroupEntity } from "../../../data/group"; diff --git a/src/dialogs/more-info/controls/more-info-humidifier.ts b/src/dialogs/more-info/controls/more-info-humidifier.ts index 7a118a2521..43da799a16 100644 --- a/src/dialogs/more-info/controls/more-info-humidifier.ts +++ b/src/dialogs/more-info/controls/more-info-humidifier.ts @@ -6,11 +6,11 @@ import { CSSResultGroup, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { fireEvent } from "../../../common/dom/fire_event"; import { supportsFeature } from "../../../common/entity/supports-feature"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; diff --git a/src/dialogs/more-info/controls/more-info-light.ts b/src/dialogs/more-info/controls/more-info-light.ts index 1dffd398a4..f4d963a41a 100644 --- a/src/dialogs/more-info/controls/more-info-light.ts +++ b/src/dialogs/more-info/controls/more-info-light.ts @@ -3,16 +3,15 @@ import "@polymer/paper-listbox/paper-listbox"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { supportsFeature } from "../../../common/entity/supports-feature"; import "../../../components/ha-attributes"; +import "../../../components/ha-button-toggle-group"; import "../../../components/ha-color-picker"; import "../../../components/ha-icon-button"; import "../../../components/ha-labeled-slider"; @@ -28,7 +27,6 @@ import { SUPPORT_EFFECT, } from "../../../data/light"; import type { HomeAssistant } from "../../../types"; -import "../../../components/ha-button-toggle-group"; const toggleButtons = [ { label: "Color", value: "color" }, diff --git a/src/dialogs/more-info/controls/more-info-media_player.ts b/src/dialogs/more-info/controls/more-info-media_player.ts index c617a8f761..89bb143d3f 100644 --- a/src/dialogs/more-info/controls/more-info-media_player.ts +++ b/src/dialogs/more-info/controls/more-info-media_player.ts @@ -4,16 +4,8 @@ import { mdiPlayBoxMultiple } from "@mdi/js"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { supportsFeature } from "../../../common/entity/supports-feature"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; diff --git a/src/dialogs/more-info/controls/more-info-person.ts b/src/dialogs/more-info/controls/more-info-person.ts index 57e8e38470..f1b610d26d 100644 --- a/src/dialogs/more-info/controls/more-info-person.ts +++ b/src/dialogs/more-info/controls/more-info-person.ts @@ -1,14 +1,7 @@ import "@material/mwc-button"; import { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../common/dom/fire_event"; import "../../../components/ha-attributes"; diff --git a/src/dialogs/more-info/controls/more-info-remote.ts b/src/dialogs/more-info/controls/more-info-remote.ts index e144094c8d..c8e9c8b779 100644 --- a/src/dialogs/more-info/controls/more-info-remote.ts +++ b/src/dialogs/more-info/controls/more-info-remote.ts @@ -1,14 +1,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { supportsFeature } from "../../../common/entity/supports-feature"; import "../../../components/ha-attributes"; import "../../../components/ha-paper-dropdown-menu"; diff --git a/src/dialogs/more-info/controls/more-info-script.ts b/src/dialogs/more-info/controls/more-info-script.ts index 61005dda6a..39ce62214e 100644 --- a/src/dialogs/more-info/controls/more-info-script.ts +++ b/src/dialogs/more-info/controls/more-info-script.ts @@ -1,13 +1,6 @@ import { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../components/ha-relative-time"; import { HomeAssistant } from "../../../types"; diff --git a/src/dialogs/more-info/controls/more-info-sun.ts b/src/dialogs/more-info/controls/more-info-sun.ts index 9f8b49d71e..9de886b619 100644 --- a/src/dialogs/more-info/controls/more-info-sun.ts +++ b/src/dialogs/more-info/controls/more-info-sun.ts @@ -1,13 +1,6 @@ import { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { formatTime } from "../../../common/datetime/format_time"; import { formatNumber } from "../../../common/string/format_number"; import "../../../components/ha-relative-time"; diff --git a/src/dialogs/more-info/controls/more-info-timer.ts b/src/dialogs/more-info/controls/more-info-timer.ts index a9b07bfb81..92d06002bb 100644 --- a/src/dialogs/more-info/controls/more-info-timer.ts +++ b/src/dialogs/more-info/controls/more-info-timer.ts @@ -1,13 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../components/ha-attributes"; import { TimerEntity } from "../../../data/timer"; import { HomeAssistant } from "../../../types"; diff --git a/src/dialogs/more-info/controls/more-info-vacuum.ts b/src/dialogs/more-info/controls/more-info-vacuum.ts index 99716e91aa..ca6a5fb73b 100644 --- a/src/dialogs/more-info/controls/more-info-vacuum.ts +++ b/src/dialogs/more-info/controls/more-info-vacuum.ts @@ -1,14 +1,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { supportsFeature } from "../../../common/entity/supports-feature"; import "../../../components/ha-attributes"; import "../../../components/ha-icon"; diff --git a/src/dialogs/more-info/controls/more-info-weather.ts b/src/dialogs/more-info/controls/more-info-weather.ts index dc4a529985..3b69a35a7a 100644 --- a/src/dialogs/more-info/controls/more-info-weather.ts +++ b/src/dialogs/more-info/controls/more-info-weather.ts @@ -23,12 +23,12 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, + html, LitElement, - property, PropertyValues, -} from "lit-element"; -import { html, TemplateResult } from "lit-html"; + TemplateResult, +} from "lit"; +import { customElement, property } from "lit/decorators"; import { formatDateWeekday } from "../../../common/datetime/format_date"; import { formatTimeWeekday } from "../../../common/datetime/format_time"; import { formatNumber } from "../../../common/string/format_number"; diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 493c04f245..ff89f71c82 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -3,15 +3,9 @@ import "@material/mwc-icon-button"; import "@material/mwc-tab"; import "@material/mwc-tab-bar"; import { mdiClose, mdiCog, mdiPencil } from "@mdi/js"; -import { - css, - customElement, - html, - state, - LitElement, - property, -} from "lit-element"; -import { cache } from "lit-html/directives/cache"; +import { css, html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { cache } from "lit/directives/cache"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; import { DOMAINS_MORE_INFO_NO_HISTORY, @@ -31,11 +25,11 @@ import { haStyleDialog } from "../../resources/styles"; import "../../state-summary/state-card-content"; import { HomeAssistant } from "../../types"; import { showConfirmationDialog } from "../generic/show-dialog-box"; +import { replaceDialog } from "../make-dialog-manager"; import "./controls/more-info-default"; import "./ha-more-info-history"; import "./ha-more-info-logbook"; import "./more-info-content"; -import { replaceDialog } from "../make-dialog-manager"; const DOMAINS_NO_INFO = ["camera", "configurator"]; /** diff --git a/src/dialogs/more-info/ha-more-info-history.ts b/src/dialogs/more-info/ha-more-info-history.ts index 2374ccd7e4..6dcb3144de 100644 --- a/src/dialogs/more-info/ha-more-info-history.ts +++ b/src/dialogs/more-info/ha-more-info-history.ts @@ -1,12 +1,5 @@ -import { - customElement, - html, - state, - LitElement, - property, - PropertyValues, - TemplateResult, -} from "lit-element"; +import { html, LitElement, PropertyValues, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; import { throttle } from "../../common/util/throttle"; import "../../components/state-history-charts"; diff --git a/src/dialogs/more-info/ha-more-info-logbook.ts b/src/dialogs/more-info/ha-more-info-logbook.ts index 2af0eb69f4..16f6097d8b 100644 --- a/src/dialogs/more-info/ha-more-info-logbook.ts +++ b/src/dialogs/more-info/ha-more-info-logbook.ts @@ -1,24 +1,16 @@ -import { - css, - customElement, - html, - state, - LitElement, - property, - PropertyValues, - TemplateResult, -} from "lit-element"; +import { css, html, LitElement, PropertyValues, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; -import { closeDialog } from "../make-dialog-manager"; import { computeStateDomain } from "../../common/entity/compute_state_domain"; import { throttle } from "../../common/util/throttle"; import "../../components/ha-circular-progress"; import "../../components/state-history-charts"; -import { TraceContexts, loadTraceContexts } from "../../data/trace"; import { getLogbookData, LogbookEntry } from "../../data/logbook"; +import { loadTraceContexts, TraceContexts } from "../../data/trace"; import "../../panels/logbook/ha-logbook"; import { haStyle, haStyleScrollbar } from "../../resources/styles"; import { HomeAssistant } from "../../types"; +import { closeDialog } from "../make-dialog-manager"; @customElement("ha-more-info-logbook") export class MoreInfoLogbook extends LitElement { diff --git a/src/dialogs/more-info/more-info-content.ts b/src/dialogs/more-info/more-info-content.ts index 0c5ddab96c..2185206433 100644 --- a/src/dialogs/more-info/more-info-content.ts +++ b/src/dialogs/more-info/more-info-content.ts @@ -1,5 +1,6 @@ import { HassEntity } from "home-assistant-js-websocket"; -import { property, PropertyValues, ReactiveElement } from "lit-element"; +import { PropertyValues, ReactiveElement } from "lit"; +import { property } from "lit/decorators"; import dynamicContentUpdater from "../../common/dom/dynamic_content_updater"; import { importMoreInfoControl } from "../../panels/lovelace/custom-card-helpers"; import { HomeAssistant } from "../../types"; diff --git a/src/dialogs/notifications/configurator-notification-item.ts b/src/dialogs/notifications/configurator-notification-item.ts index eb998f76be..0ea19c0653 100644 --- a/src/dialogs/notifications/configurator-notification-item.ts +++ b/src/dialogs/notifications/configurator-notification-item.ts @@ -1,11 +1,6 @@ import "@material/mwc-button"; -import { - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { computeStateDisplay } from "../../common/entity/compute_state_display"; import { domainToName } from "../../data/integration"; diff --git a/src/dialogs/notifications/notification-item-template.ts b/src/dialogs/notifications/notification-item-template.ts index 28fb986784..8f6528550e 100644 --- a/src/dialogs/notifications/notification-item-template.ts +++ b/src/dialogs/notifications/notification-item-template.ts @@ -1,11 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement } from "lit/decorators"; import "../../components/ha-card"; @customElement("notification-item-template") diff --git a/src/dialogs/notifications/notification-item.ts b/src/dialogs/notifications/notification-item.ts index 41207b1db4..dfe95fdc77 100644 --- a/src/dialogs/notifications/notification-item.ts +++ b/src/dialogs/notifications/notification-item.ts @@ -1,12 +1,6 @@ import { HassEntity } from "home-assistant-js-websocket"; -import { - customElement, - html, - LitElement, - property, - PropertyValues, - TemplateResult, -} from "lit-element"; +import { html, LitElement, PropertyValues, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { PersistentNotification } from "../../data/persistent_notification"; import { HomeAssistant } from "../../types"; import "./configurator-notification-item"; diff --git a/src/dialogs/notifications/persistent-notification-item.ts b/src/dialogs/notifications/persistent-notification-item.ts index cb66b0fad8..c7a38d264b 100644 --- a/src/dialogs/notifications/persistent-notification-item.ts +++ b/src/dialogs/notifications/persistent-notification-item.ts @@ -1,14 +1,7 @@ import "@material/mwc-button"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { formatDateTime } from "../../common/datetime/format_date_time"; import "../../components/ha-markdown"; import "../../components/ha-relative-time"; diff --git a/src/dialogs/quick-bar/ha-quick-bar.ts b/src/dialogs/quick-bar/ha-quick-bar.ts index b398a9759c..ea8c9e2e9d 100644 --- a/src/dialogs/quick-bar/ha-quick-bar.ts +++ b/src/dialogs/quick-bar/ha-quick-bar.ts @@ -1,3 +1,4 @@ +import { Layout1d, scroll } from "@lit-labs/virtualizer"; import "@material/mwc-list/mwc-list"; import type { List } from "@material/mwc-list/mwc-list"; import { SingleSelectedEvent } from "@material/mwc-list/mwc-list-foundation"; @@ -11,18 +12,10 @@ import { mdiReload, mdiServerNetwork, } from "@mdi/js"; -import { - css, - customElement, - html, - state, - LitElement, - property, - query, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; -import { styleMap } from "lit-html/directives/style-map"; -import { scroll } from "lit-virtualizer"; +import { css, html, LitElement } from "lit"; +import { customElement, property, query, state } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; +import { styleMap } from "lit/directives/style-map"; import memoizeOne from "memoize-one"; import { canShowPage } from "../../common/config/can_show_page"; import { componentsWithService } from "../../common/config/components_with_service"; @@ -38,6 +31,7 @@ import { ScorableTextItem, } from "../../common/string/filter/sequence-matching"; import { debounce } from "../../common/util/debounce"; +import "../../components/ha-chip"; import "../../components/ha-circular-progress"; import "../../components/ha-dialog"; import "../../components/ha-header-bar"; @@ -52,7 +46,6 @@ import { showConfirmationDialog, } from "../generic/show-dialog-box"; import { QuickBarParams } from "./show-dialog-quick-bar"; -import "../../components/ha-chip"; interface QuickBarItem extends ScorableTextItem { primaryText: string; @@ -194,7 +187,9 @@ export class QuickBar extends LitElement { > ${scroll({ items, - renderItem: (item: QuickBarItem, index?: number) => + layout: Layout1d, + // @ts-expect-error + renderItem: (item: QuickBarItem, index) => this._renderItem(item, index), })} `} diff --git a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts index 62e9ae5c93..f4cf783ad3 100644 --- a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts +++ b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts @@ -5,16 +5,13 @@ import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { fireEvent } from "../../common/dom/fire_event"; import { SpeechRecognition } from "../../common/dom/speech-recognition"; import { uid } from "../../common/util/uid"; diff --git a/src/entrypoints/custom-panel.ts b/src/entrypoints/custom-panel.ts index 28b068fadc..856946d33b 100644 --- a/src/entrypoints/custom-panel.ts +++ b/src/entrypoints/custom-panel.ts @@ -1,18 +1,19 @@ // Compat needs to be first import import "../resources/compatibility"; +import "../resources/safari-14-attachshadow-patch"; + import { PolymerElement } from "@polymer/polymer"; +import { CSSResult } from "lit"; import { fireEvent } from "../common/dom/fire_event"; +import { isNavigationClick } from "../common/dom/is-navigation-click"; import { loadJS } from "../common/dom/load_resource"; import { webComponentsSupported } from "../common/feature-detect/support-web-components"; +import { navigate } from "../common/navigate"; import { CustomPanelInfo } from "../data/panel_custom"; -import "../resources/safari-14-attachshadow-patch"; +import { baseEntrypointStyles } from "../resources/styles"; import { createCustomPanelElement } from "../util/custom-panel/create-custom-panel-element"; import { loadCustomPanel } from "../util/custom-panel/load-custom-panel"; import { setCustomPanelProperties } from "../util/custom-panel/set-custom-panel-properties"; -import { baseEntrypointStyles } from "../resources/styles"; -import { CSSResult } from "lit-element"; -import { isNavigationClick } from "../common/dom/is-navigation-click"; -import { navigate } from "../common/navigate"; declare global { interface Window { diff --git a/src/entrypoints/service_worker.ts b/src/entrypoints/service_worker.ts index 0748a15e1f..e3f141fa54 100644 --- a/src/entrypoints/service_worker.ts +++ b/src/entrypoints/service_worker.ts @@ -2,7 +2,9 @@ // eslint-disable-next-line spaced-comment /// /* eslint-env serviceworker */ +import { CacheableResponsePlugin } from "workbox-cacheable-response"; import { cacheNames, RouteHandler } from "workbox-core"; +import { ExpirationPlugin } from "workbox-expiration"; import { cleanupOutdatedCaches, precacheAndRoute } from "workbox-precaching"; import { registerRoute, setCatchHandler } from "workbox-routing"; import { @@ -10,8 +12,6 @@ import { NetworkOnly, StaleWhileRevalidate, } from "workbox-strategies"; -import { CacheableResponsePlugin } from "workbox-cacheable-response"; -import { ExpirationPlugin } from "workbox-expiration"; const noFallBackRegEx = new RegExp( "/(api|static|auth|frontend_latest|frontend_es5|local)/.*" diff --git a/src/fake_data/provide_hass.ts b/src/fake_data/provide_hass.ts index e74cb69152..6249f441f5 100644 --- a/src/fake_data/provide_hass.ts +++ b/src/fake_data/provide_hass.ts @@ -8,7 +8,7 @@ import { DEFAULT_PANEL } from "../data/panel"; import { NumberFormat } from "../data/translation"; import { translationMetadata } from "../resources/translations-metadata"; import { HomeAssistant } from "../types"; -import { getTranslation, getLocalLanguage } from "../util/hass-translation"; +import { getLocalLanguage, getTranslation } from "../util/hass-translation"; import { demoConfig } from "./demo_config"; import { demoPanels } from "./demo_panels"; import { demoServices } from "./demo_services"; diff --git a/src/layouts/ha-init-page.ts b/src/layouts/ha-init-page.ts index 0d657ec304..0a4e730fde 100644 --- a/src/layouts/ha-init-page.ts +++ b/src/layouts/ha-init-page.ts @@ -1,5 +1,6 @@ import "@material/mwc-button"; -import { css, CSSResultGroup, html, LitElement, property } from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { property } from "lit/decorators"; import "../components/ha-circular-progress"; import { removeInitSkeleton } from "../util/init-skeleton"; diff --git a/src/layouts/hass-error-screen.ts b/src/layouts/hass-error-screen.ts index e80a37e0e8..de0b3f1fcf 100644 --- a/src/layouts/hass-error-screen.ts +++ b/src/layouts/hass-error-screen.ts @@ -1,16 +1,9 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { HomeAssistant } from "../types"; -import "../components/ha-menu-button"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../components/ha-icon-button-arrow-prev"; +import "../components/ha-menu-button"; +import { HomeAssistant } from "../types"; @customElement("hass-error-screen") class HassErrorScreen extends LitElement { diff --git a/src/layouts/hass-loading-screen.ts b/src/layouts/hass-loading-screen.ts index d2f08eb69f..529659ba0a 100644 --- a/src/layouts/hass-loading-screen.ts +++ b/src/layouts/hass-loading-screen.ts @@ -1,13 +1,6 @@ import "@polymer/app-layout/app-toolbar/app-toolbar"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../components/ha-circular-progress"; import "../components/ha-icon-button-arrow-prev"; import "../components/ha-menu-button"; diff --git a/src/layouts/hass-router-page.ts b/src/layouts/hass-router-page.ts index 4c88766031..17ed986ee3 100644 --- a/src/layouts/hass-router-page.ts +++ b/src/layouts/hass-router-page.ts @@ -1,4 +1,5 @@ -import { property, PropertyValues, ReactiveElement } from "lit-element"; +import { PropertyValues, ReactiveElement } from "lit"; +import { property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { navigate } from "../common/navigate"; import { Route } from "../types"; diff --git a/src/layouts/hass-subpage.ts b/src/layouts/hass-subpage.ts index 1b100c3892..58c4c376aa 100644 --- a/src/layouts/hass-subpage.ts +++ b/src/layouts/hass-subpage.ts @@ -1,13 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - eventOptions, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, eventOptions, property } from "lit/decorators"; import { restoreScroll } from "../common/decorators/restore-scroll"; import "../components/ha-icon-button-arrow-prev"; import "../components/ha-menu-button"; diff --git a/src/layouts/hass-tabs-subpage-data-table.ts b/src/layouts/hass-tabs-subpage-data-table.ts index de56e096cd..5ecfa2b722 100644 --- a/src/layouts/hass-tabs-subpage-data-table.ts +++ b/src/layouts/hass-tabs-subpage-data-table.ts @@ -1,18 +1,10 @@ import "@material/mwc-button/mwc-button"; import { mdiFilterVariant } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; -import { LocalizeFunc } from "../common/translations/localize"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; +import { LocalizeFunc } from "../common/translations/localize"; import { computeRTLDirection } from "../common/util/compute_rtl"; import "../components/data-table/ha-data-table"; import type { diff --git a/src/layouts/hass-tabs-subpage.ts b/src/layouts/hass-tabs-subpage.ts index 9b77850e4d..e7b787a0a2 100644 --- a/src/layouts/hass-tabs-subpage.ts +++ b/src/layouts/hass-tabs-subpage.ts @@ -2,16 +2,13 @@ import "@material/mwc-ripple"; import { css, CSSResultGroup, - customElement, - eventOptions, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, eventOptions, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import memoizeOne from "memoize-one"; import { isComponentLoaded } from "../common/config/is_component_loaded"; import { restoreScroll } from "../common/decorators/restore-scroll"; diff --git a/src/layouts/home-assistant-main.ts b/src/layouts/home-assistant-main.ts index 78e0630db0..add8b5c4c1 100644 --- a/src/layouts/home-assistant-main.ts +++ b/src/layouts/home-assistant-main.ts @@ -5,14 +5,12 @@ import type { AppDrawerElement } from "@polymer/app-layout/app-drawer/app-drawer import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent, HASSDomEvent } from "../common/dom/fire_event"; import { listenMediaQuery } from "../common/dom/media_query"; import { toggleAttribute } from "../common/dom/toggle_attribute"; diff --git a/src/layouts/home-assistant.ts b/src/layouts/home-assistant.ts index bbe799862c..1499e9a88f 100644 --- a/src/layouts/home-assistant.ts +++ b/src/layouts/home-assistant.ts @@ -1,5 +1,6 @@ -import { customElement, html, state, PropertyValues } from "lit-element"; import { isNavigationClick } from "../common/dom/is-navigation-click"; +import { html, PropertyValues } from "lit"; +import { customElement, state } from "lit/decorators"; import { navigate } from "../common/navigate"; import { getStorageDefaultPanelUrlPath } from "../data/panel"; import "../resources/custom-card-support"; @@ -45,7 +46,7 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { protected firstUpdated(changedProps) { super.firstUpdated(changedProps); - this._initialize(); + this._initializeHass(); setTimeout(() => registerServiceWorker(this), 1000); /* polyfill for paper-dropdown */ import("web-animations-js/web-animations-next-lite.min"); @@ -145,7 +146,7 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { } } - protected async _initialize() { + protected async _initializeHass() { try { let result; diff --git a/src/layouts/partial-panel-resolver.ts b/src/layouts/partial-panel-resolver.ts index cbc3cdfefb..454db3336d 100644 --- a/src/layouts/partial-panel-resolver.ts +++ b/src/layouts/partial-panel-resolver.ts @@ -4,7 +4,8 @@ import { STATE_RUNNING, STATE_STARTING, } from "home-assistant-js-websocket"; -import { customElement, property, PropertyValues } from "lit-element"; +import { PropertyValues } from "lit"; +import { customElement, property } from "lit/decorators"; import { deepActiveElement } from "../common/dom/deep-active-element"; import { deepEqual } from "../common/util/deep-equal"; import { getDefaultPanel } from "../data/panel"; diff --git a/src/layouts/supervisor-error-screen.ts b/src/layouts/supervisor-error-screen.ts index 7d35f95e73..34ab82fdf9 100644 --- a/src/layouts/supervisor-error-screen.ts +++ b/src/layouts/supervisor-error-screen.ts @@ -1,20 +1,19 @@ -import "../components/ha-card"; import "@material/mwc-button"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { HomeAssistant } from "../types"; +} from "lit"; +import { customElement, property } from "lit/decorators"; +import { atLeastVersion } from "../common/config/version"; +import { applyThemesOnElement } from "../common/dom/apply_themes_on_element"; +import "../components/ha-card"; import "../resources/ha-style"; import { haStyle } from "../resources/styles"; -import { applyThemesOnElement } from "../common/dom/apply_themes_on_element"; -import { atLeastVersion } from "../common/config/version"; +import { HomeAssistant } from "../types"; import "./hass-subpage"; @customElement("supervisor-error-screen") diff --git a/src/managers/notification-manager.ts b/src/managers/notification-manager.ts index 8c3de2c802..7eb9b410cd 100644 --- a/src/managers/notification-manager.ts +++ b/src/managers/notification-manager.ts @@ -1,14 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - html, - state, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property, state, query } from "lit/decorators"; import { computeRTL } from "../common/util/compute_rtl"; import "../components/ha-toast"; import type { HaToast } from "../components/ha-toast"; diff --git a/src/mixins/keyboard-shortcut-mixin.ts b/src/mixins/keyboard-shortcut-mixin.ts index 359f386dc8..c319135b94 100644 --- a/src/mixins/keyboard-shortcut-mixin.ts +++ b/src/mixins/keyboard-shortcut-mixin.ts @@ -1,4 +1,4 @@ -import { LitElement } from "lit-element"; +import { LitElement } from "lit"; import { Constructor } from "../types"; export const KeyboardShortcutMixin = >( diff --git a/src/mixins/lit-localize-lite-mixin.ts b/src/mixins/lit-localize-lite-mixin.ts index cc723a36ac..c9751e1837 100644 --- a/src/mixins/lit-localize-lite-mixin.ts +++ b/src/mixins/lit-localize-lite-mixin.ts @@ -1,7 +1,8 @@ -import { LitElement, property, PropertyValues } from "lit-element"; +import { LitElement, PropertyValues } from "lit"; +import { property } from "lit/decorators"; import { computeLocalize, LocalizeFunc } from "../common/translations/localize"; import { Constructor, Resources } from "../types"; -import { getTranslation, getLocalLanguage } from "../util/hass-translation"; +import { getLocalLanguage, getTranslation } from "../util/hass-translation"; const empty = () => ""; diff --git a/src/mixins/provide-hass-lit-mixin.ts b/src/mixins/provide-hass-lit-mixin.ts index 8ebe9ebc11..361d4e281c 100644 --- a/src/mixins/provide-hass-lit-mixin.ts +++ b/src/mixins/provide-hass-lit-mixin.ts @@ -1,4 +1,4 @@ -import { PropertyValues, ReactiveElement } from "lit-element"; +import { PropertyValues, ReactiveElement } from "lit"; import { Constructor, HomeAssistant } from "../types"; export interface ProvideHassElement { diff --git a/src/mixins/subscribe-mixin.ts b/src/mixins/subscribe-mixin.ts index e104737784..701d524175 100644 --- a/src/mixins/subscribe-mixin.ts +++ b/src/mixins/subscribe-mixin.ts @@ -1,5 +1,6 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { property, PropertyValues, ReactiveElement } from "lit-element"; +import { PropertyValues, ReactiveElement } from "lit"; +import { property } from "lit/decorators"; import { Constructor, HomeAssistant } from "../types"; export interface HassSubscribeElement { diff --git a/src/onboarding/action-badge.ts b/src/onboarding/action-badge.ts index c9f516084e..e97c9c5bd8 100644 --- a/src/onboarding/action-badge.ts +++ b/src/onboarding/action-badge.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../components/ha-icon"; @customElement("action-badge") diff --git a/src/onboarding/ha-onboarding.ts b/src/onboarding/ha-onboarding.ts index ea13d7c615..2a7c66bd9f 100644 --- a/src/onboarding/ha-onboarding.ts +++ b/src/onboarding/ha-onboarding.ts @@ -5,14 +5,9 @@ import { getAuth, subscribeConfig, } from "home-assistant-js-websocket"; -import { - customElement, - html, - state, - property, - PropertyValues, - TemplateResult, -} from "lit-element"; +import { html, PropertyValues, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { applyThemesOnElement } from "../common/dom/apply_themes_on_element"; import { HASSDomEvent } from "../common/dom/fire_event"; import { extractSearchParamsObject } from "../common/url/search-params"; import { subscribeOne } from "../common/util/subscribe-one"; @@ -29,10 +24,9 @@ import { litLocalizeLiteMixin } from "../mixins/lit-localize-lite-mixin"; import { HassElement } from "../state/hass-element"; import { HomeAssistant } from "../types"; import { registerServiceWorker } from "../util/register-service-worker"; +import "./onboarding-analytics"; import "./onboarding-create-user"; import "./onboarding-loading"; -import "./onboarding-analytics"; -import { applyThemesOnElement } from "../common/dom/apply_themes_on_element"; type OnboardingEvent = | { diff --git a/src/onboarding/integration-badge.ts b/src/onboarding/integration-badge.ts index b03acb8b02..7958ca7080 100644 --- a/src/onboarding/integration-badge.ts +++ b/src/onboarding/integration-badge.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../components/ha-icon"; import { brandsUrl } from "../util/brands-url"; diff --git a/src/onboarding/onboarding-analytics.ts b/src/onboarding/onboarding-analytics.ts index b22173a73c..60783b95f7 100644 --- a/src/onboarding/onboarding-analytics.ts +++ b/src/onboarding/onboarding-analytics.ts @@ -1,14 +1,6 @@ import "@material/mwc-button/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import { LocalizeFunc } from "../common/translations/localize"; import "../components/ha-analytics"; diff --git a/src/onboarding/onboarding-core-config.ts b/src/onboarding/onboarding-core-config.ts index 7a3380229d..f1bc58a83d 100644 --- a/src/onboarding/onboarding-core-config.ts +++ b/src/onboarding/onboarding-core-config.ts @@ -3,16 +3,8 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import type { LocalizeFunc } from "../common/translations/localize"; import "../components/map/ha-location-editor"; diff --git a/src/onboarding/onboarding-create-user.ts b/src/onboarding/onboarding-create-user.ts index 64250f91ce..c0c23aafdc 100644 --- a/src/onboarding/onboarding-create-user.ts +++ b/src/onboarding/onboarding-create-user.ts @@ -4,14 +4,12 @@ import { genClientId } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import { LocalizeFunc } from "../common/translations/localize"; import { onboardUserStep } from "../data/onboarding"; diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts index eee62415b3..9426c88ad4 100644 --- a/src/onboarding/onboarding-integrations.ts +++ b/src/onboarding/onboarding-integrations.ts @@ -2,14 +2,12 @@ import "@material/mwc-button/mwc-button"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, - state, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; import { compare } from "../common/string/compare"; import { LocalizeFunc } from "../common/translations/localize"; diff --git a/src/onboarding/onboarding-loading.ts b/src/onboarding/onboarding-loading.ts index 29005246dc..e9182332ec 100644 --- a/src/onboarding/onboarding-loading.ts +++ b/src/onboarding/onboarding-loading.ts @@ -1,11 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement } from "lit/decorators"; @customElement("onboarding-loading") class OnboardingLoading extends LitElement { diff --git a/src/onboarding/onboarding-restore-snapshot.ts b/src/onboarding/onboarding-restore-snapshot.ts index 835a31aff4..9d133d3b82 100644 --- a/src/onboarding/onboarding-restore-snapshot.ts +++ b/src/onboarding/onboarding-restore-snapshot.ts @@ -1,13 +1,6 @@ import "@material/mwc-button/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../hassio/src/components/hassio-ansi-to-html"; import { showHassioSnapshotDialog } from "../../hassio/src/dialogs/snapshot/show-dialog-hassio-snapshot"; import { showSnapshotUploadDialog } from "../../hassio/src/dialogs/snapshot/show-dialog-snapshot-upload"; diff --git a/src/panels/calendar/ha-full-calendar.ts b/src/panels/calendar/ha-full-calendar.ts index 71e5ebbb02..8fa4cf46cc 100644 --- a/src/panels/calendar/ha-full-calendar.ts +++ b/src/panels/calendar/ha-full-calendar.ts @@ -16,13 +16,12 @@ import { css, CSSResultGroup, html, - state, LitElement, - property, PropertyValues, TemplateResult, unsafeCSS, -} from "lit-element"; +} from "lit"; +import { property, state } from "lit/decorators"; import memoize from "memoize-one"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-button-toggle-group"; diff --git a/src/panels/calendar/ha-panel-calendar.ts b/src/panels/calendar/ha-panel-calendar.ts index 1f73721efc..1bbe4b68ed 100644 --- a/src/panels/calendar/ha-panel-calendar.ts +++ b/src/panels/calendar/ha-panel-calendar.ts @@ -5,15 +5,13 @@ import "@polymer/app-layout/app-toolbar/app-toolbar"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { styleMap } from "lit-html/directives/style-map"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { styleMap } from "lit/directives/style-map"; import { LocalStorage } from "../../common/decorators/local-storage"; import { HASSDomEvent } from "../../common/dom/fire_event"; import "../../components/ha-card"; diff --git a/src/panels/config/areas/dialog-area-registry-detail.ts b/src/panels/config/areas/dialog-area-registry-detail.ts index dcb29ffdf2..9d192b91ee 100644 --- a/src/panels/config/areas/dialog-area-registry-detail.ts +++ b/src/panels/config/areas/dialog-area-registry-detail.ts @@ -1,15 +1,8 @@ import "@material/mwc-button"; import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property, state } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import { navigate } from "../../../common/navigate"; import "../../../components/ha-dialog"; diff --git a/src/panels/config/areas/ha-config-area-page.ts b/src/panels/config/areas/ha-config-area-page.ts index 29d5269810..6b3e35a783 100644 --- a/src/panels/config/areas/ha-config-area-page.ts +++ b/src/panels/config/areas/ha-config-area-page.ts @@ -1,15 +1,7 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; import memoizeOne from "memoize-one"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { computeStateName } from "../../../common/entity/compute_state_name"; diff --git a/src/panels/config/areas/ha-config-areas-dashboard.ts b/src/panels/config/areas/ha-config-areas-dashboard.ts index cee1c49c53..e0888c063f 100644 --- a/src/panels/config/areas/ha-config-areas-dashboard.ts +++ b/src/panels/config/areas/ha-config-areas-dashboard.ts @@ -1,15 +1,8 @@ import { mdiPlus } from "@mdi/js"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { HASSDomEvent } from "../../../common/dom/fire_event"; import { navigate } from "../../../common/navigate"; diff --git a/src/panels/config/areas/ha-config-areas.ts b/src/panels/config/areas/ha-config-areas.ts index 725bf14cd9..dd9378e321 100644 --- a/src/panels/config/areas/ha-config-areas.ts +++ b/src/panels/config/areas/ha-config-areas.ts @@ -1,5 +1,6 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { customElement, state, property, PropertyValues } from "lit-element"; +import { PropertyValues } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { compare } from "../../../common/string/compare"; import { AreaRegistryEntry, diff --git a/src/panels/config/automation/action/ha-automation-action-row.ts b/src/panels/config/automation/action/ha-automation-action-row.ts index 5dfc358a5f..96719a003f 100644 --- a/src/panels/config/automation/action/ha-automation-action-row.ts +++ b/src/panels/config/automation/action/ha-automation-action-row.ts @@ -6,19 +6,11 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import type { PaperListboxElement } from "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - PropertyValues, - query, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { dynamicElement } from "../../../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../../../common/dom/fire_event"; +import { handleStructError } from "../../../../common/structs/handle-errors"; import "../../../../components/ha-button-menu"; import "../../../../components/ha-card"; import "../../../../components/ha-svg-icon"; @@ -27,7 +19,6 @@ import type { Action } from "../../../../data/script"; import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box"; import { haStyle } from "../../../../resources/styles"; import type { HomeAssistant } from "../../../../types"; -import { handleStructError } from "../../../../common/structs/handle-errors"; import "./types/ha-automation-action-choose"; import "./types/ha-automation-action-condition"; import "./types/ha-automation-action-delay"; diff --git a/src/panels/config/automation/action/ha-automation-action.ts b/src/panels/config/automation/action/ha-automation-action.ts index 9d2c266783..dfdf25b215 100644 --- a/src/panels/config/automation/action/ha-automation-action.ts +++ b/src/panels/config/automation/action/ha-automation-action.ts @@ -1,12 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-card"; import { Action } from "../../../../data/script"; diff --git a/src/panels/config/automation/action/types/ha-automation-action-choose.ts b/src/panels/config/automation/action/types/ha-automation-action-choose.ts index 2cc117665b..584d217b90 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-choose.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-choose.ts @@ -1,14 +1,8 @@ import { mdiDelete } from "@mdi/js"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - LitElement, - property, -} from "lit-element"; -import { html } from "lit-html"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { ensureArray } from "../../../../../common/ensure-array"; import { Condition } from "../../../../../data/automation"; diff --git a/src/panels/config/automation/action/types/ha-automation-action-condition.ts b/src/panels/config/automation/action/types/ha-automation-action-condition.ts index 03eb234832..6509d71c6c 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-condition.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-condition.ts @@ -1,4 +1,5 @@ -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { Condition } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; diff --git a/src/panels/config/automation/action/types/ha-automation-action-delay.ts b/src/panels/config/automation/action/types/ha-automation-action-delay.ts index b805a68b2d..ab9a3ed8ab 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-delay.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-delay.ts @@ -1,11 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { - customElement, - html, - LitElement, - property, - PropertyValues, -} from "lit-element"; +import { html, LitElement, PropertyValues } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { hasTemplate } from "../../../../../common/string/has-template"; import "../../../../../components/entity/ha-entity-picker"; diff --git a/src/panels/config/automation/action/types/ha-automation-action-device_id.ts b/src/panels/config/automation/action/types/ha-automation-action-device_id.ts index 535be0f254..1a4565f870 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-device_id.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-device_id.ts @@ -1,4 +1,5 @@ -import { customElement, html, state, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/device/ha-device-action-picker"; diff --git a/src/panels/config/automation/action/types/ha-automation-action-event.ts b/src/panels/config/automation/action/types/ha-automation-action-event.ts index 81fc2c10da..92b64fe634 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-event.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-event.ts @@ -1,12 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { - customElement, - LitElement, - property, - PropertyValues, - query, -} from "lit-element"; -import { html } from "lit-html"; +import { html, LitElement, PropertyValues } from "lit"; +import { customElement, property, query } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/entity/ha-entity-picker"; import "../../../../../components/ha-service-picker"; diff --git a/src/panels/config/automation/action/types/ha-automation-action-repeat.ts b/src/panels/config/automation/action/types/ha-automation-action-repeat.ts index 538fb94767..07249aeaf8 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-repeat.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-repeat.ts @@ -1,13 +1,8 @@ import "@polymer/paper-input/paper-input"; import type { PaperListboxElement } from "@polymer/paper-listbox"; import "@polymer/paper-listbox/paper-listbox"; -import { - CSSResultGroup, - customElement, - LitElement, - property, -} from "lit-element"; -import { html } from "lit-html"; +import { CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { Action, diff --git a/src/panels/config/automation/action/types/ha-automation-action-scene.ts b/src/panels/config/automation/action/types/ha-automation-action-scene.ts index 9b0610b187..6af3f06c40 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-scene.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-scene.ts @@ -1,4 +1,5 @@ -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/entity/ha-entity-picker"; import { SceneAction } from "../../../../../data/script"; diff --git a/src/panels/config/automation/action/types/ha-automation-action-service.ts b/src/panels/config/automation/action/types/ha-automation-action-service.ts index 7743800b30..eafbc88b60 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-service.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-service.ts @@ -1,22 +1,14 @@ import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - state, - LitElement, - property, - PropertyValues, -} from "lit-element"; -import { html } from "lit-html"; +import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { any, assert, object, optional, string } from "superstruct"; import { fireEvent } from "../../../../../common/dom/fire_event"; +import { hasTemplate } from "../../../../../common/string/has-template"; +import { entityIdOrAll } from "../../../../../common/structs/is-entity-id"; +import "../../../../../components/ha-service-control"; import { ServiceAction } from "../../../../../data/script"; import type { HomeAssistant } from "../../../../../types"; -import { entityIdOrAll } from "../../../../../common/structs/is-entity-id"; import { ActionElement } from "../ha-automation-action-row"; -import "../../../../../components/ha-service-control"; -import { hasTemplate } from "../../../../../common/string/has-template"; const actionStruct = object({ service: optional(string()), diff --git a/src/panels/config/automation/action/types/ha-automation-action-wait_for_trigger.ts b/src/panels/config/automation/action/types/ha-automation-action-wait_for_trigger.ts index 0d28d05c77..223eb40d9c 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-wait_for_trigger.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-wait_for_trigger.ts @@ -1,7 +1,7 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-input/paper-textarea"; -import { customElement, LitElement, property } from "lit-element"; -import { html } from "lit-html"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/ha-formfield"; import { WaitForTriggerAction } from "../../../../../data/script"; diff --git a/src/panels/config/automation/action/types/ha-automation-action-wait_template.ts b/src/panels/config/automation/action/types/ha-automation-action-wait_template.ts index ed6326a381..62e7a5bbb9 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-wait_template.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-wait_template.ts @@ -1,7 +1,7 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-input/paper-textarea"; -import { customElement, LitElement, property } from "lit-element"; -import { html } from "lit-html"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { WaitAction } from "../../../../../data/script"; import { HomeAssistant } from "../../../../../types"; diff --git a/src/panels/config/automation/blueprint-automation-editor.ts b/src/panels/config/automation/blueprint-automation-editor.ts index 14358dec95..a7ccc8c07c 100644 --- a/src/panels/config/automation/blueprint-automation-editor.ts +++ b/src/panels/config/automation/blueprint-automation-editor.ts @@ -2,15 +2,8 @@ import "@material/mwc-button/mwc-button"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; import "@polymer/paper-input/paper-textarea"; import { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - state, - LitElement, - property, -} from "lit-element"; -import { html } from "lit-html"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import "../../../components/entity/ha-entity-toggle"; import "../../../components/ha-blueprint-picker"; diff --git a/src/panels/config/automation/condition/ha-automation-condition-editor.ts b/src/panels/config/automation/condition/ha-automation-condition-editor.ts index 59c2ac55d3..014e40c55b 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-editor.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-editor.ts @@ -2,13 +2,8 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import type { PaperListboxElement } from "@polymer/paper-listbox/paper-listbox"; -import { - CSSResultGroup, - customElement, - html, - LitElement, - property, -} from "lit-element"; +import { CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { dynamicElement } from "../../../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-card"; diff --git a/src/panels/config/automation/condition/ha-automation-condition-row.ts b/src/panels/config/automation/condition/ha-automation-condition-row.ts index d1dbed74fa..8015055358 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-row.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-row.ts @@ -2,24 +2,17 @@ import { ActionDetail } from "@material/mwc-list/mwc-list-foundation"; import "@material/mwc-list/mwc-list-item"; import { mdiDotsVertical } from "@mdi/js"; import "@polymer/paper-item/paper-item"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-button-menu"; import "../../../../components/ha-card"; import "../../../../components/ha-icon-button"; import { Condition } from "../../../../data/automation"; import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box"; +import { haStyle } from "../../../../resources/styles"; import { HomeAssistant } from "../../../../types"; import "./ha-automation-condition-editor"; -import { haStyle } from "../../../../resources/styles"; export interface ConditionElement extends LitElement { condition: Condition; diff --git a/src/panels/config/automation/condition/ha-automation-condition.ts b/src/panels/config/automation/condition/ha-automation-condition.ts index 1105e7be11..513ca4c361 100644 --- a/src/panels/config/automation/condition/ha-automation-condition.ts +++ b/src/panels/config/automation/condition/ha-automation-condition.ts @@ -1,13 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - PropertyValues, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-card"; import { Condition } from "../../../../data/automation"; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-and.ts b/src/panels/config/automation/condition/types/ha-automation-condition-and.ts index 92148e5ffb..482d593d91 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-and.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-and.ts @@ -1,4 +1,4 @@ -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import { HaLogicalCondition } from "./ha-automation-condition-logical"; @customElement("ha-automation-condition-and") diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-device.ts b/src/panels/config/automation/condition/types/ha-automation-condition-device.ts index 2ba0ba91fc..74277a4680 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-device.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-device.ts @@ -1,4 +1,5 @@ -import { customElement, html, state, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/device/ha-device-condition-picker"; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-logical.ts b/src/panels/config/automation/condition/types/ha-automation-condition-logical.ts index 6d6fc40f77..47fbba8de6 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-logical.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-logical.ts @@ -1,4 +1,5 @@ -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { LogicalCondition } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-not.ts b/src/panels/config/automation/condition/types/ha-automation-condition-not.ts index 586346765e..82f8a95049 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-not.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-not.ts @@ -1,4 +1,4 @@ -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import { HaLogicalCondition } from "./ha-automation-condition-logical"; @customElement("ha-automation-condition-not") diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts b/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts index 71259efe5d..d953eb7c72 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-numeric_state.ts @@ -1,6 +1,7 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-input/paper-textarea"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../../../components/entity/ha-entity-picker"; import { NumericStateCondition } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-or.ts b/src/panels/config/automation/condition/types/ha-automation-condition-or.ts index 38152f3bbc..ca770ee816 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-or.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-or.ts @@ -1,4 +1,4 @@ -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import { HaLogicalCondition } from "./ha-automation-condition-logical"; @customElement("ha-automation-condition-or") diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-state.ts b/src/panels/config/automation/condition/types/ha-automation-condition-state.ts index d0f18b1ab7..1b841f0af9 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-state.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-state.ts @@ -1,5 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../../../components/entity/ha-entity-attribute-picker"; import "../../../../../components/entity/ha-entity-picker"; import { ForDict, StateCondition } from "../../../../../data/automation"; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-sun.ts b/src/panels/config/automation/condition/types/ha-automation-condition-sun.ts index becb62bf8c..bda9399539 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-sun.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-sun.ts @@ -2,7 +2,8 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; import type { PaperRadioGroupElement } from "@polymer/paper-radio-group/paper-radio-group"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import type { SunCondition } from "../../../../../data/automation"; import type { HomeAssistant } from "../../../../../types"; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-template.ts b/src/panels/config/automation/condition/types/ha-automation-condition-template.ts index 6f8fe2329e..d83eea64e2 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-template.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-template.ts @@ -1,5 +1,6 @@ import "@polymer/paper-input/paper-textarea"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { TemplateCondition } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; import { handleChangeEvent } from "../ha-automation-condition-row"; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-time.ts b/src/panels/config/automation/condition/types/ha-automation-condition-time.ts index fbbf6baa8b..5b0e56b350 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-time.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-time.ts @@ -1,14 +1,7 @@ import { Radio } from "@material/mwc-radio"; import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { computeRTLDirection } from "../../../../../common/util/compute_rtl"; import "../../../../../components/ha-formfield"; diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-zone.ts b/src/panels/config/automation/condition/types/ha-automation-condition-zone.ts index e84bd7766d..7511b1ff0d 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-zone.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-zone.ts @@ -1,5 +1,6 @@ import "@polymer/paper-radio-button/paper-radio-button"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { computeStateDomain } from "../../../../../common/entity/compute_state_domain"; import { hasLocation } from "../../../../../common/entity/has_location"; diff --git a/src/panels/config/automation/dialog-new-automation.ts b/src/panels/config/automation/dialog-new-automation.ts index bf854c2bce..3ab6c12b2b 100644 --- a/src/panels/config/automation/dialog-new-automation.ts +++ b/src/panels/config/automation/dialog-new-automation.ts @@ -1,14 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { fireEvent } from "../../../common/dom/fire_event"; import { nextRender } from "../../../common/util/render-status"; diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index b0780ea237..3df134e59b 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -15,14 +15,12 @@ import { css, CSSResultGroup, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { navigate } from "../../../common/navigate"; import { copyToClipboard } from "../../../common/util/copy-clipboard"; import "../../../components/ha-button-menu"; diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index 760069e16b..c7526a58da 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -8,16 +8,9 @@ import { mdiPlus, } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; +import { CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; import memoizeOne from "memoize-one"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { formatDateTime } from "../../../common/datetime/format_date_time"; @@ -26,9 +19,9 @@ import { computeStateName } from "../../../common/entity/compute_state_name"; import { navigate } from "../../../common/navigate"; import { DataTableColumnContainer } from "../../../components/data-table/ha-data-table"; import "../../../components/entity/ha-entity-toggle"; +import "../../../components/ha-button-related-filter-menu"; import "../../../components/ha-fab"; import "../../../components/ha-svg-icon"; -import "../../../components/ha-button-related-filter-menu"; import { AutomationEntity, triggerAutomationActions, diff --git a/src/panels/config/automation/ha-config-automation.ts b/src/panels/config/automation/ha-config-automation.ts index d9db28fac1..8a61fabf57 100644 --- a/src/panels/config/automation/ha-config-automation.ts +++ b/src/panels/config/automation/ha-config-automation.ts @@ -1,5 +1,6 @@ import { HassEntities } from "home-assistant-js-websocket"; -import { customElement, property, PropertyValues } from "lit-element"; +import { PropertyValues } from "lit"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; import { debounce } from "../../../common/util/debounce"; @@ -9,8 +10,8 @@ import { RouterOptions, } from "../../../layouts/hass-router-page"; import { HomeAssistant } from "../../../types"; -import "./ha-automation-picker"; import "./ha-automation-editor"; +import "./ha-automation-picker"; const equal = (a: AutomationEntity[], b: AutomationEntity[]): boolean => { if (a.length !== b.length) { diff --git a/src/panels/config/automation/manual-automation-editor.ts b/src/panels/config/automation/manual-automation-editor.ts index 492621e877..9dfdf01ec4 100644 --- a/src/panels/config/automation/manual-automation-editor.ts +++ b/src/panels/config/automation/manual-automation-editor.ts @@ -3,14 +3,8 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; import "@polymer/paper-input/paper-textarea"; import { PaperListboxElement } from "@polymer/paper-listbox"; import { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - LitElement, - property, -} from "lit-element"; -import { html } from "lit-html"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import "../../../components/entity/ha-entity-toggle"; import "../../../components/ha-card"; diff --git a/src/panels/config/automation/thingtalk/dialog-thingtalk.ts b/src/panels/config/automation/thingtalk/dialog-thingtalk.ts index 04d43a0b7c..467e293e6d 100644 --- a/src/panels/config/automation/thingtalk/dialog-thingtalk.ts +++ b/src/panels/config/automation/thingtalk/dialog-thingtalk.ts @@ -2,17 +2,8 @@ import "@material/mwc-button"; import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/dialog/ha-paper-dialog"; import "../../../../components/ha-circular-progress"; diff --git a/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts b/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts index 3a42951f93..af00652e8f 100644 --- a/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts +++ b/src/panels/config/automation/thingtalk/ha-thingtalk-placeholders.ts @@ -2,14 +2,12 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import { computeDomain } from "../../../../common/entity/compute_domain"; import { applyPatch, getPath } from "../../../../common/util/patch"; diff --git a/src/panels/config/automation/trace/ha-automation-trace-blueprint-config.ts b/src/panels/config/automation/trace/ha-automation-trace-blueprint-config.ts index 4f9d02403e..ca04091e79 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-blueprint-config.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-blueprint-config.ts @@ -1,15 +1,10 @@ import { safeDump } from "js-yaml"; -import { - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import "../../../../components/ha-icon-button"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../../components/ha-code-editor"; -import { HomeAssistant } from "../../../../types"; +import "../../../../components/ha-icon-button"; import { AutomationTraceExtended } from "../../../../data/trace"; +import { HomeAssistant } from "../../../../types"; @customElement("ha-automation-trace-blueprint-config") export class HaAutomationTraceBlueprintConfig extends LitElement { diff --git a/src/panels/config/automation/trace/ha-automation-trace-config.ts b/src/panels/config/automation/trace/ha-automation-trace-config.ts index 73a49f6649..3928656f82 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-config.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-config.ts @@ -1,16 +1,9 @@ import { safeDump } from "js-yaml"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { AutomationTraceExtended } from "../../../../data/trace"; -import "../../../../components/ha-icon-button"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../../components/ha-code-editor"; +import "../../../../components/ha-icon-button"; +import { AutomationTraceExtended } from "../../../../data/trace"; import { HomeAssistant } from "../../../../types"; @customElement("ha-automation-trace-config") diff --git a/src/panels/config/automation/trace/ha-automation-trace-logbook.ts b/src/panels/config/automation/trace/ha-automation-trace-logbook.ts index 54c78e201a..675d355662 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-logbook.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-logbook.ts @@ -1,15 +1,8 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import type { HomeAssistant } from "../../../../types"; -import type { LogbookEntry } from "../../../../data/logbook"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../../components/trace/hat-logbook-note"; +import type { LogbookEntry } from "../../../../data/logbook"; +import type { HomeAssistant } from "../../../../types"; import "../../../logbook/ha-logbook"; @customElement("ha-automation-trace-logbook") diff --git a/src/panels/config/automation/trace/ha-automation-trace-path-details.ts b/src/panels/config/automation/trace/ha-automation-trace-path-details.ts index 4afaa2abc5..1dab6866bc 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-path-details.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-path-details.ts @@ -1,30 +1,22 @@ import { safeDump } from "js-yaml"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { formatDateTimeWithSeconds } from "../../../../common/datetime/format_date_time"; +import "../../../../components/ha-code-editor"; +import "../../../../components/ha-icon-button"; +import type { NodeInfo } from "../../../../components/trace/hat-graph"; +import "../../../../components/trace/hat-logbook-note"; +import { LogbookEntry } from "../../../../data/logbook"; import { ActionTraceStep, AutomationTraceExtended, ChooseActionTraceStep, getDataFromPath, } from "../../../../data/trace"; -import "../../../../components/ha-icon-button"; -import "../../../../components/ha-code-editor"; -import type { NodeInfo } from "../../../../components/trace/hat-graph"; -import "../../../../components/trace/hat-logbook-note"; import { HomeAssistant } from "../../../../types"; -import { formatDateTimeWithSeconds } from "../../../../common/datetime/format_date_time"; -import { LogbookEntry } from "../../../../data/logbook"; -import { traceTabStyles } from "./styles"; import "../../../logbook/ha-logbook"; +import { traceTabStyles } from "./styles"; @customElement("ha-automation-trace-path-details") export class HaAutomationTracePathDetails extends LitElement { diff --git a/src/panels/config/automation/trace/ha-automation-trace-timeline.ts b/src/panels/config/automation/trace/ha-automation-trace-timeline.ts index e9861f6e7e..d379dc6934 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-timeline.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-timeline.ts @@ -1,18 +1,11 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import type { AutomationTraceExtended } from "../../../../data/trace"; -import type { HomeAssistant } from "../../../../types"; -import type { LogbookEntry } from "../../../../data/logbook"; -import "../../../../components/trace/hat-trace-timeline"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import type { NodeInfo } from "../../../../components/trace/hat-graph"; import "../../../../components/trace/hat-logbook-note"; +import "../../../../components/trace/hat-trace-timeline"; +import type { LogbookEntry } from "../../../../data/logbook"; +import type { AutomationTraceExtended } from "../../../../data/trace"; +import type { HomeAssistant } from "../../../../types"; @customElement("ha-automation-trace-timeline") export class HaAutomationTraceTimeline extends LitElement { diff --git a/src/panels/config/automation/trace/ha-automation-trace.ts b/src/panels/config/automation/trace/ha-automation-trace.ts index 2f0afc5fee..fefffacb80 100644 --- a/src/panels/config/automation/trace/ha-automation-trace.ts +++ b/src/panels/config/automation/trace/ha-automation-trace.ts @@ -1,47 +1,39 @@ import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; + mdiDownload, + mdiPencil, + mdiRayEndArrow, + mdiRayStartArrow, + mdiRefresh, +} from "@mdi/js"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { repeat } from "lit/directives/repeat"; +import { isComponentLoaded } from "../../../../common/config/is_component_loaded"; +import { formatDateTimeWithSeconds } from "../../../../common/datetime/format_date_time"; +import type { NodeInfo } from "../../../../components/trace/hat-graph"; +import "../../../../components/trace/hat-script-graph"; import { AutomationEntity } from "../../../../data/automation"; +import { + getLogbookDataForContext, + LogbookEntry, +} from "../../../../data/logbook"; import { AutomationTrace, AutomationTraceExtended, loadTrace, loadTraces, } from "../../../../data/trace"; -import "../../../../components/trace/hat-script-graph"; -import type { NodeInfo } from "../../../../components/trace/hat-graph"; +import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box"; import { haStyle } from "../../../../resources/styles"; import { HomeAssistant, Route } from "../../../../types"; import { configSections } from "../../ha-panel-config"; -import { - getLogbookDataForContext, - LogbookEntry, -} from "../../../../data/logbook"; -import { formatDateTimeWithSeconds } from "../../../../common/datetime/format_date_time"; -import { repeat } from "lit-html/directives/repeat"; -import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box"; -import "./ha-automation-trace-path-details"; -import "./ha-automation-trace-timeline"; +import "./ha-automation-trace-blueprint-config"; import "./ha-automation-trace-config"; import "./ha-automation-trace-logbook"; -import { classMap } from "lit-html/directives/class-map"; +import "./ha-automation-trace-path-details"; +import "./ha-automation-trace-timeline"; import { traceTabStyles } from "./styles"; -import { - mdiRayEndArrow, - mdiRayStartArrow, - mdiPencil, - mdiRefresh, - mdiDownload, -} from "@mdi/js"; -import "./ha-automation-trace-blueprint-config"; -import { isComponentLoaded } from "../../../../common/config/is_component_loaded"; @customElement("ha-automation-trace") export class HaAutomationTrace extends LitElement { diff --git a/src/panels/config/automation/trace/styles.ts b/src/panels/config/automation/trace/styles.ts index 4f236499c1..40878d304f 100644 --- a/src/panels/config/automation/trace/styles.ts +++ b/src/panels/config/automation/trace/styles.ts @@ -1,4 +1,4 @@ -import { css } from "lit-element"; +import { css } from "lit"; export const traceTabStyles = css` .tabs { diff --git a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts index ff84744b92..07b8b7373f 100644 --- a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts +++ b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts @@ -5,15 +5,8 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import type { PaperListboxElement } from "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { dynamicElement } from "../../../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-button-menu"; diff --git a/src/panels/config/automation/trigger/ha-automation-trigger.ts b/src/panels/config/automation/trigger/ha-automation-trigger.ts index e60df5d8a3..612780c9d4 100644 --- a/src/panels/config/automation/trigger/ha-automation-trigger.ts +++ b/src/panels/config/automation/trigger/ha-automation-trigger.ts @@ -1,12 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-card"; import { Trigger } from "../../../../data/automation"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts index e7145e58e3..51a579c2c6 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts @@ -1,4 +1,5 @@ -import { customElement, html, state, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/device/ha-device-picker"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts index 9d53e8ea0e..de11702140 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-event.ts @@ -1,6 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { customElement, LitElement, property } from "lit-element"; -import { html } from "lit-html"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/ha-yaml-editor"; import "../../../../../components/user/ha-users-picker"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-geo_location.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-geo_location.ts index b65fac6d92..55e08598d1 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-geo_location.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-geo_location.ts @@ -1,7 +1,8 @@ import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; import type { PaperRadioGroupElement } from "@polymer/paper-radio-group/paper-radio-group"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/entity/ha-entity-picker"; import type { GeoLocationTrigger } from "../../../../../data/automation"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-homeassistant.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-homeassistant.ts index f811e20f0b..1d45e6c5f6 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-homeassistant.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-homeassistant.ts @@ -1,7 +1,8 @@ import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; import type { PaperRadioGroupElement } from "@polymer/paper-radio-group/paper-radio-group"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import type { HassTrigger } from "../../../../../data/automation"; import type { HomeAssistant } from "../../../../../types"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-mqtt.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-mqtt.ts index 0450f37ff2..e3e997771f 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-mqtt.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-mqtt.ts @@ -1,5 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { MqttTrigger } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; import { diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts index 0c54205b2b..cf7cf64115 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-numeric_state.ts @@ -1,6 +1,7 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-input/paper-textarea"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../../../components/entity/ha-entity-picker"; import { ForDict, NumericStateTrigger } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts index c128904318..1ad3b18555 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-state.ts @@ -1,5 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../../../components/entity/ha-entity-attribute-picker"; import "../../../../../components/entity/ha-entity-picker"; import { ForDict, StateTrigger } from "../../../../../data/automation"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-sun.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-sun.ts index 3c2bb9cf62..d940a3e1cc 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-sun.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-sun.ts @@ -2,7 +2,8 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; import type { PaperRadioGroupElement } from "@polymer/paper-radio-group/paper-radio-group"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import type { SunTrigger } from "../../../../../data/automation"; import type { HomeAssistant } from "../../../../../types"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-tag.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-tag.ts index 7851562ec8..5accba1a25 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-tag.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-tag.ts @@ -1,12 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { - customElement, - html, - state, - LitElement, - property, - PropertyValues, -} from "lit-element"; +import { html, LitElement, PropertyValues } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { TagTrigger } from "../../../../../data/automation"; import { fetchTags, Tag } from "../../../../../data/tag"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts index 5e9483e0c8..2a40c2fc9d 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-template.ts @@ -1,5 +1,6 @@ import "@polymer/paper-input/paper-textarea"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { TemplateTrigger } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; import { handleChangeEvent } from "../ha-automation-trigger-row"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-time.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-time.ts index 821ca2ce97..ddb0404907 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-time.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-time.ts @@ -1,5 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { customElement, html, state, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../../../components/entity/ha-entity-picker"; import "../../../../../components/ha-formfield"; import "../../../../../components/ha-radio"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-time_pattern.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-time_pattern.ts index 1f0f081ad9..b1b0a74f4c 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-time_pattern.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-time_pattern.ts @@ -1,5 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { TimePatternTrigger } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; import { diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-webhook.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-webhook.ts index 3eb56a805e..4d90ec0219 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-webhook.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-webhook.ts @@ -1,5 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { WebhookTrigger } from "../../../../../data/automation"; import { HomeAssistant } from "../../../../../types"; import { handleChangeEvent } from "../ha-automation-trigger-row"; diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-zone.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-zone.ts index 4d93d61f6c..a8b4ba457e 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-zone.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-zone.ts @@ -1,7 +1,8 @@ import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; import type { PaperRadioGroupElement } from "@polymer/paper-radio-group/paper-radio-group"; -import { customElement, html, LitElement, property } from "lit-element"; +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { computeStateDomain } from "../../../../../common/entity/compute_state_domain"; import { hasLocation } from "../../../../../common/entity/has_location"; diff --git a/src/panels/config/blueprint/dialog-import-blueprint.ts b/src/panels/config/blueprint/dialog-import-blueprint.ts index 5a46f42037..db171c6449 100644 --- a/src/panels/config/blueprint/dialog-import-blueprint.ts +++ b/src/panels/config/blueprint/dialog-import-blueprint.ts @@ -1,21 +1,14 @@ -import "../../../components/ha-markdown"; import "@material/mwc-button"; import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import { - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import "../../../components/ha-circular-progress"; +import { createCloseHeading } from "../../../components/ha-dialog"; import "../../../components/ha-expansion-panel"; +import "../../../components/ha-markdown"; import { BlueprintImportResult, importBlueprint, @@ -23,7 +16,6 @@ import { } from "../../../data/blueprint"; import { haStyleDialog } from "../../../resources/styles"; import type { HomeAssistant } from "../../../types"; -import { createCloseHeading } from "../../../components/ha-dialog"; @customElement("ha-dialog-import-blueprint") class DialogImportBlueprint extends LitElement { diff --git a/src/panels/config/blueprint/ha-blueprint-overview.ts b/src/panels/config/blueprint/ha-blueprint-overview.ts index 299ee0d356..9f0618dc60 100644 --- a/src/panels/config/blueprint/ha-blueprint-overview.ts +++ b/src/panels/config/blueprint/ha-blueprint-overview.ts @@ -9,13 +9,12 @@ import { import "@polymer/paper-tooltip/paper-tooltip"; import { CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../common/dom/fire_event"; import { navigate } from "../../../common/navigate"; diff --git a/src/panels/config/blueprint/ha-config-blueprint.ts b/src/panels/config/blueprint/ha-config-blueprint.ts index efe7e82645..3ea73842da 100644 --- a/src/panels/config/blueprint/ha-config-blueprint.ts +++ b/src/panels/config/blueprint/ha-config-blueprint.ts @@ -1,4 +1,5 @@ -import { customElement, property, PropertyValues } from "lit-element"; +import { PropertyValues } from "lit"; +import { customElement, property } from "lit/decorators"; import { Blueprints, fetchBlueprints } from "../../../data/blueprint"; import { HassRouterPage, diff --git a/src/panels/config/cloud/account/cloud-alexa-pref.ts b/src/panels/config/cloud/account/cloud-alexa-pref.ts index 4d66bb7383..9b98f7d560 100644 --- a/src/panels/config/cloud/account/cloud-alexa-pref.ts +++ b/src/panels/config/cloud/account/cloud-alexa-pref.ts @@ -1,13 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property, state } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-card"; import "../../../../components/ha-switch"; diff --git a/src/panels/config/cloud/account/cloud-google-pref.ts b/src/panels/config/cloud/account/cloud-google-pref.ts index 8bb77a0413..b572e7a67e 100644 --- a/src/panels/config/cloud/account/cloud-google-pref.ts +++ b/src/panels/config/cloud/account/cloud-google-pref.ts @@ -1,14 +1,8 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/buttons/ha-call-api-button"; import "../../../../components/ha-card"; diff --git a/src/panels/config/cloud/account/cloud-remote-pref.ts b/src/panels/config/cloud/account/cloud-remote-pref.ts index 5449e7d9f0..a2973d250b 100644 --- a/src/panels/config/cloud/account/cloud-remote-pref.ts +++ b/src/panels/config/cloud/account/cloud-remote-pref.ts @@ -1,14 +1,7 @@ import "@material/mwc-button"; import "@polymer/paper-item/paper-item-body"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-card"; import "../../../../components/ha-switch"; diff --git a/src/panels/config/cloud/account/cloud-tts-pref.ts b/src/panels/config/cloud/account/cloud-tts-pref.ts index 04811cfe12..1b57e7b113 100644 --- a/src/panels/config/cloud/account/cloud-tts-pref.ts +++ b/src/panels/config/cloud/account/cloud-tts-pref.ts @@ -1,32 +1,24 @@ +import "@material/mwc-button"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu-light"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import memoizeOne from "memoize-one"; +import { fireEvent } from "../../../../common/dom/fire_event"; +import { caseInsensitiveCompare } from "../../../../common/string/compare"; import "../../../../components/ha-card"; -import "../../../../components/ha-switch"; import "../../../../components/ha-svg-icon"; +import "../../../../components/ha-switch"; import { CloudStatusLoggedIn, CloudTTSInfo, getCloudTTSInfo, updateCloudPref, } from "../../../../data/cloud"; -import type { HomeAssistant } from "../../../../types"; import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box"; import { translationMetadata } from "../../../../resources/translations-metadata"; -import { caseInsensitiveCompare } from "../../../../common/string/compare"; -import memoizeOne from "memoize-one"; -import { fireEvent } from "../../../../common/dom/fire_event"; +import type { HomeAssistant } from "../../../../types"; import { showTryTtsDialog } from "./show-dialog-cloud-tts-try"; @customElement("cloud-tts-pref") diff --git a/src/panels/config/cloud/account/cloud-webhooks.ts b/src/panels/config/cloud/account/cloud-webhooks.ts index 6ea5063adb..309e78b651 100644 --- a/src/panels/config/cloud/account/cloud-webhooks.ts +++ b/src/panels/config/cloud/account/cloud-webhooks.ts @@ -1,20 +1,12 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - PropertyValues, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { isComponentLoaded } from "../../../../common/config/is_component_loaded"; import "../../../../components/ha-card"; import "../../../../components/ha-circular-progress"; import "../../../../components/ha-settings-row"; import "../../../../components/ha-switch"; -import { isComponentLoaded } from "../../../../common/config/is_component_loaded"; import { CloudStatusLoggedIn, CloudWebhook, diff --git a/src/panels/config/cloud/account/dialog-cloud-tts-try.ts b/src/panels/config/cloud/account/dialog-cloud-tts-try.ts index 4fbc535016..9da9b5ca10 100644 --- a/src/panels/config/cloud/account/dialog-cloud-tts-try.ts +++ b/src/panels/config/cloud/account/dialog-cloud-tts-try.ts @@ -1,34 +1,25 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; -import { HomeAssistant } from "../../../../types"; -import { TryTtsDialogParams } from "./show-dialog-cloud-tts-try"; -import { haStyleDialog } from "../../../../resources/styles"; -import { fireEvent } from "../../../../common/dom/fire_event"; -import { convertTextToSpeech } from "../../../../data/tts"; -import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box"; +import { mdiPlayCircleOutline } from "@mdi/js"; import "@polymer/paper-input/paper-textarea"; -import "../../../../components/ha-paper-dropdown-menu"; -import { computeStateDomain } from "../../../../common/entity/compute_state_domain"; -import { computeStateName } from "../../../../common/entity/compute_state_name"; +import type { PaperTextareaElement } from "@polymer/paper-input/paper-textarea"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { supportsFeature } from "../../../../common/entity/supports-feature"; -import { SUPPORT_PLAY_MEDIA } from "../../../../data/media-player"; -import { createCloseHeading } from "../../../../components/ha-dialog"; -import { mdiPlayCircleOutline } from "@mdi/js"; import type { PaperListboxElement } from "@polymer/paper-listbox/paper-listbox"; -import type { PaperTextareaElement } from "@polymer/paper-input/paper-textarea"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { LocalStorage } from "../../../../common/decorators/local-storage"; +import { fireEvent } from "../../../../common/dom/fire_event"; +import { computeStateDomain } from "../../../../common/entity/compute_state_domain"; +import { computeStateName } from "../../../../common/entity/compute_state_name"; +import { supportsFeature } from "../../../../common/entity/supports-feature"; +import { createCloseHeading } from "../../../../components/ha-dialog"; +import "../../../../components/ha-paper-dropdown-menu"; +import { SUPPORT_PLAY_MEDIA } from "../../../../data/media-player"; +import { convertTextToSpeech } from "../../../../data/tts"; +import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box"; +import { haStyleDialog } from "../../../../resources/styles"; +import { HomeAssistant } from "../../../../types"; +import { TryTtsDialogParams } from "./show-dialog-cloud-tts-try"; @customElement("dialog-cloud-try-tts") export class DialogTryTts extends LitElement { diff --git a/src/panels/config/cloud/alexa/cloud-alexa.ts b/src/panels/config/cloud/alexa/cloud-alexa.ts index ab88d5d590..f3cdda6971 100644 --- a/src/panels/config/cloud/alexa/cloud-alexa.ts +++ b/src/panels/config/cloud/alexa/cloud-alexa.ts @@ -6,17 +6,9 @@ import { mdiCloseBox, mdiCloseBoxMultiple, } from "@mdi/js"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../../common/dom/fire_event"; import { computeDomain } from "../../../../common/entity/compute_domain"; diff --git a/src/panels/config/cloud/dialog-cloud-certificate/dialog-cloud-certificate.ts b/src/panels/config/cloud/dialog-cloud-certificate/dialog-cloud-certificate.ts index 64ccfb71e0..8351c20cc0 100644 --- a/src/panels/config/cloud/dialog-cloud-certificate/dialog-cloud-certificate.ts +++ b/src/panels/config/cloud/dialog-cloud-certificate/dialog-cloud-certificate.ts @@ -1,12 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import { formatDateTime } from "../../../../common/datetime/format_date_time"; import "../../../../components/dialog/ha-paper-dialog"; import type { HaPaperDialog } from "../../../../components/dialog/ha-paper-dialog"; diff --git a/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts b/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts index 8325ec4bd8..2fea1ef018 100644 --- a/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts +++ b/src/panels/config/cloud/dialog-manage-cloudhook/dialog-manage-cloudhook.ts @@ -2,7 +2,8 @@ import "@material/mwc-button"; import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import { css, CSSResultGroup, html, state, LitElement } from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { state } from "lit/decorators"; import "../../../../components/dialog/ha-paper-dialog"; import type { HaPaperDialog } from "../../../../components/dialog/ha-paper-dialog"; import { showConfirmationDialog } from "../../../../dialogs/generic/show-dialog-box"; diff --git a/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts b/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts index 179bd95684..29068eeb71 100644 --- a/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts +++ b/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts @@ -6,17 +6,9 @@ import { mdiCloseBox, mdiCloseBoxMultiple, } from "@mdi/js"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../../common/dom/fire_event"; import { computeDomain } from "../../../../common/entity/compute_domain"; diff --git a/src/panels/config/cloud/ha-config-cloud.ts b/src/panels/config/cloud/ha-config-cloud.ts index 7fbe569f82..62db01a437 100644 --- a/src/panels/config/cloud/ha-config-cloud.ts +++ b/src/panels/config/cloud/ha-config-cloud.ts @@ -1,5 +1,5 @@ import { PolymerElement } from "@polymer/polymer"; -import { customElement, state, property } from "lit-element"; +import { customElement, property, state } from "lit/decorators"; import { navigate } from "../../../common/navigate"; import { CloudStatus } from "../../../data/cloud"; import { diff --git a/src/panels/config/core/ha-config-analytics.ts b/src/panels/config/core/ha-config-analytics.ts index b533c4c407..1050e7f8ca 100644 --- a/src/panels/config/core/ha-config-analytics.ts +++ b/src/panels/config/core/ha-config-analytics.ts @@ -2,14 +2,12 @@ import "@material/mwc-button/mwc-button"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import "../../../components/ha-analytics"; import { analyticsLearnMore } from "../../../components/ha-analytics-learn-more"; diff --git a/src/panels/config/core/ha-config-core-form.ts b/src/panels/config/core/ha-config-core-form.ts index 848d89bbdf..322c2697c1 100644 --- a/src/panels/config/core/ha-config-core-form.ts +++ b/src/panels/config/core/ha-config-core-form.ts @@ -3,16 +3,8 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { UNIT_C } from "../../../common/const"; import "../../../components/ha-card"; diff --git a/src/panels/config/core/ha-config-name-form.ts b/src/panels/config/core/ha-config-name-form.ts index bbb9f16035..f99e073cb8 100644 --- a/src/panels/config/core/ha-config-name-form.ts +++ b/src/panels/config/core/ha-config-name-form.ts @@ -3,15 +3,8 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; -import { - css, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../components/ha-card"; import { ConfigUpdateValues, saveCoreConfig } from "../../../data/core"; import type { PolymerChangedEvent } from "../../../polymer-types"; diff --git a/src/panels/config/core/ha-config-url-form.ts b/src/panels/config/core/ha-config-url-form.ts index 9a26b83236..6c7e9f0468 100644 --- a/src/panels/config/core/ha-config-url-form.ts +++ b/src/panels/config/core/ha-config-url-form.ts @@ -1,16 +1,8 @@ import "@material/mwc-button/mwc-button"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../components/ha-card"; import { saveCoreConfig } from "../../../data/core"; import type { PolymerChangedEvent } from "../../../polymer-types"; diff --git a/src/panels/config/customize/ha-config-customize.ts b/src/panels/config/customize/ha-config-customize.ts index a79d356836..d6109546fc 100644 --- a/src/panels/config/customize/ha-config-customize.ts +++ b/src/panels/config/customize/ha-config-customize.ts @@ -1,11 +1,5 @@ -import { - css, - CSSResultGroup, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property } from "lit/decorators"; import "../../../components/ha-card"; import "../../../layouts/hass-loading-screen"; import "../../../layouts/hass-tabs-subpage"; diff --git a/src/panels/config/dashboard/ha-config-dashboard.ts b/src/panels/config/dashboard/ha-config-dashboard.ts index f4844895ea..f81527cce0 100644 --- a/src/panels/config/dashboard/ha-config-dashboard.ts +++ b/src/panels/config/dashboard/ha-config-dashboard.ts @@ -1,15 +1,8 @@ import { mdiCloudLock } from "@mdi/js"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import "../../../components/ha-card"; import "../../../components/ha-icon-next"; diff --git a/src/panels/config/dashboard/ha-config-navigation.ts b/src/panels/config/dashboard/ha-config-navigation.ts index 935cc544f1..ee08290b06 100644 --- a/src/panels/config/dashboard/ha-config-navigation.ts +++ b/src/panels/config/dashboard/ha-config-navigation.ts @@ -1,14 +1,7 @@ import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { canShowPage } from "../../../common/config/can_show_page"; import "../../../components/ha-card"; import "../../../components/ha-icon-next"; diff --git a/src/panels/config/devices/device-detail/ha-device-actions-card.ts b/src/panels/config/devices/device-detail/ha-device-actions-card.ts index a5d5e4507f..bec915a9e3 100644 --- a/src/panels/config/devices/device-detail/ha-device-actions-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-actions-card.ts @@ -1,4 +1,4 @@ -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import "../../../../components/ha-card"; import { DeviceAction, diff --git a/src/panels/config/devices/device-detail/ha-device-automation-card.ts b/src/panels/config/devices/device-detail/ha-device-automation-card.ts index ed4a1caa13..b77958e820 100644 --- a/src/panels/config/devices/device-detail/ha-device-automation-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-automation-card.ts @@ -1,11 +1,5 @@ -import { - css, - CSSResultGroup, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property } from "lit/decorators"; import "../../../../components/ha-card"; import "../../../../components/ha-chip-set"; import { showAutomationEditor } from "../../../../data/automation"; diff --git a/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts b/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts index 876289e04d..eb18201a25 100644 --- a/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts +++ b/src/panels/config/devices/device-detail/ha-device-automation-dialog.ts @@ -1,12 +1,6 @@ -import { - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import "@material/mwc-button/mwc-button"; +import { CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-dialog"; import { @@ -23,7 +17,6 @@ import "./ha-device-actions-card"; import "./ha-device-conditions-card"; import "./ha-device-triggers-card"; import { DeviceAutomationDialogParams } from "./show-dialog-device-automation"; -import "@material/mwc-button/mwc-button"; @customElement("dialog-device-automation") export class DialogDeviceAutomation extends LitElement { diff --git a/src/panels/config/devices/device-detail/ha-device-conditions-card.ts b/src/panels/config/devices/device-detail/ha-device-conditions-card.ts index 54f126667a..ffa084bf6c 100644 --- a/src/panels/config/devices/device-detail/ha-device-conditions-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-conditions-card.ts @@ -1,4 +1,4 @@ -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import "../../../../components/ha-card"; import { DeviceCondition, diff --git a/src/panels/config/devices/device-detail/ha-device-entities-card.ts b/src/panels/config/devices/device-detail/ha-device-entities-card.ts index 7a779b6065..5bb169256b 100644 --- a/src/panels/config/devices/device-detail/ha-device-entities-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-entities-card.ts @@ -4,13 +4,12 @@ import "@polymer/paper-item/paper-item-body"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import { computeDomain } from "../../../../common/entity/compute_domain"; import { domainIcon } from "../../../../common/entity/domain_icon"; import "../../../../components/entity/state-badge"; diff --git a/src/panels/config/devices/device-detail/ha-device-info-card.ts b/src/panels/config/devices/device-detail/ha-device-info-card.ts index bddb19aecb..f442246d0f 100644 --- a/src/panels/config/devices/device-detail/ha-device-info-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-info-card.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { AreaRegistryEntry } from "../../../../data/area_registry"; import { computeDeviceName, diff --git a/src/panels/config/devices/device-detail/ha-device-triggers-card.ts b/src/panels/config/devices/device-detail/ha-device-triggers-card.ts index ec14f55d35..bdf15ee03b 100644 --- a/src/panels/config/devices/device-detail/ha-device-triggers-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-triggers-card.ts @@ -1,4 +1,4 @@ -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import { DeviceTrigger, localizeDeviceAutomationTrigger, diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts index 3f0a740f93..f97427a067 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts @@ -1,13 +1,6 @@ import "@material/mwc-button/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, state } from "lit/decorators"; import { computeStateName } from "../../../../../../common/entity/compute_state_name"; import { computeRTLDirection } from "../../../../../../common/util/compute_rtl"; import "../../../../../../components/ha-dialog"; diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts index 54ab5b9403..4be0413450 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/ha-device-actions-mqtt.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { removeMQTTDeviceEntry } from "../../../../../../data/mqtt"; import { showConfirmationDialog } from "../../../../../../dialogs/generic/show-dialog-box"; diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts index afea8620fa..cc80ae4b6d 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts @@ -1,15 +1,7 @@ import { safeDump } from "js-yaml"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; @customElement("mqtt-discovery-payload") class MQTTDiscoveryPayload extends LitElement { diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts index 9bd2ec167a..734b4ae085 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts @@ -1,15 +1,7 @@ import { safeDump } from "js-yaml"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { formatTimeWithSeconds } from "../../../../../../common/datetime/format_time"; import { MQTTMessage } from "../../../../../../data/mqtt"; import { HomeAssistant } from "../../../../../../types"; diff --git a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts index 9fe72d2ff2..d932d2edc4 100644 --- a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts +++ b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts @@ -2,13 +2,12 @@ import "@material/mwc-button/mwc-button"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import { navigate } from "../../../../../../common/navigate"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { diff --git a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts index 3fab405b92..bfb4d7bba8 100644 --- a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts +++ b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-info-ozw.ts @@ -1,14 +1,12 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { fetchOZWNodeStatus, diff --git a/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts b/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts index 6b4009dd0e..33bc22a3a3 100644 --- a/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts +++ b/src/panels/config/devices/device-detail/integration-elements/tasmota/ha-device-actions-tasmota.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { removeTasmotaDeviceEntry } from "../../../../../../data/tasmota"; import { showConfirmationDialog } from "../../../../../../dialogs/generic/show-dialog-box"; diff --git a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts index 723b0f4425..cffd1ca1e2 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts @@ -1,14 +1,12 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { navigate } from "../../../../../../common/navigate"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { fetchZHADevice, ZHADevice } from "../../../../../../data/zha"; @@ -16,9 +14,9 @@ import { showConfirmationDialog } from "../../../../../../dialogs/generic/show-d import { haStyle } from "../../../../../../resources/styles"; import { HomeAssistant } from "../../../../../../types"; import { showZHAClusterDialog } from "../../../../integrations/integration-panels/zha/show-dialog-zha-cluster"; +import { showZHADeviceChildrenDialog } from "../../../../integrations/integration-panels/zha/show-dialog-zha-device-children"; import { showZHADeviceZigbeeInfoDialog } from "../../../../integrations/integration-panels/zha/show-dialog-zha-device-zigbee-info"; import { showZHAReconfigureDeviceDialog } from "../../../../integrations/integration-panels/zha/show-dialog-zha-reconfigure-device"; -import { showZHADeviceChildrenDialog } from "../../../../integrations/integration-panels/zha/show-dialog-zha-device-children"; @customElement("ha-device-actions-zha") export class HaDeviceActionsZha extends LitElement { diff --git a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts index 6aa0188b2b..28a3e3e0e6 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-info-zha.ts @@ -1,14 +1,12 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { fetchZHADevice, ZHADevice } from "../../../../../../data/zha"; import { haStyle } from "../../../../../../resources/styles"; diff --git a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-actions-zwave_js.ts b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-actions-zwave_js.ts index 6620ac62ad..e258e66835 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-actions-zwave_js.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-actions-zwave_js.ts @@ -2,14 +2,12 @@ import "@material/mwc-button/mwc-button"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { getIdentifiersFromDevice, diff --git a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts index c37856a5c2..f8558fc5fb 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zwave_js/ha-device-info-zwave_js.ts @@ -1,23 +1,20 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { DeviceRegistryEntry } from "../../../../../../data/device_registry"; import { - getIdentifiersFromDevice, fetchNodeStatus, + getIdentifiersFromDevice, + nodeStatus, ZWaveJSNode, ZWaveJSNodeIdentifiers, - nodeStatus, } from "../../../../../../data/zwave_js"; - import { haStyle } from "../../../../../../resources/styles"; import { HomeAssistant } from "../../../../../../types"; diff --git a/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts b/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts index a6536d8c56..5a36906c77 100644 --- a/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts +++ b/src/panels/config/devices/device-registry-detail/dialog-device-registry-detail.ts @@ -3,16 +3,8 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-area-picker"; import "../../../../components/ha-dialog"; diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index 4162a1a737..8211702ead 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -1,15 +1,7 @@ import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; import memoizeOne from "memoize-one"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index b6b2d2ff0b..683d62f778 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -2,16 +2,8 @@ import "@material/mwc-list/mwc-list-item"; import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; import { mdiCancel, mdiFilterVariant, mdiPlus } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { HASSDomEvent } from "../../../common/dom/fire_event"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; diff --git a/src/panels/config/devices/ha-config-devices.ts b/src/panels/config/devices/ha-config-devices.ts index 9252c18420..fe5625565c 100644 --- a/src/panels/config/devices/ha-config-devices.ts +++ b/src/panels/config/devices/ha-config-devices.ts @@ -1,5 +1,6 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { customElement, state, property, PropertyValues } from "lit-element"; +import { PropertyValues } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { AreaRegistryEntry, subscribeAreaRegistry, diff --git a/src/panels/config/entities/dialog-entity-editor.ts b/src/panels/config/entities/dialog-entity-editor.ts index 45f5058070..a9f02c9137 100644 --- a/src/panels/config/entities/dialog-entity-editor.ts +++ b/src/panels/config/entities/dialog-entity-editor.ts @@ -3,17 +3,9 @@ import "@material/mwc-tab"; import "@material/mwc-tab-bar"; import { mdiClose, mdiTune } from "@mdi/js"; import { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { cache } from "lit-html/directives/cache"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { cache } from "lit/directives/cache"; import { dynamicElement } from "../../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateName } from "../../../common/entity/compute_state_name"; @@ -26,13 +18,13 @@ import { ExtEntityRegistryEntry, getExtendedEntityRegistryEntry, } from "../../../data/entity_registry"; +import { replaceDialog } from "../../../dialogs/make-dialog-manager"; import { haStyleDialog } from "../../../resources/styles"; import type { HomeAssistant } from "../../../types"; import { documentationUrl } from "../../../util/documentation-url"; import { PLATFORMS_WITH_SETTINGS_TAB } from "./const"; import "./entity-registry-settings"; import type { EntityRegistryDetailDialogParams } from "./show-dialog-entity-editor"; -import { replaceDialog } from "../../../dialogs/make-dialog-manager"; interface Tabs { [key: string]: Tab; @@ -59,15 +51,12 @@ export class DialogEntityEditor extends LitElement { private _curTabIndex = 0; - public async showDialog( - params: EntityRegistryDetailDialogParams - ): Promise { + public showDialog(params: EntityRegistryDetailDialogParams): void { this._params = params; this._entry = undefined; this._settingsElementTag = undefined; this._extraTabs = {}; this._getEntityReg(); - await this.updateComplete; } public closeDialog(): void { diff --git a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts index d47479811b..8d48ffd2e6 100644 --- a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts +++ b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts @@ -1,15 +1,12 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { isComponentLoaded } from "../../../../../common/config/is_component_loaded"; import { dynamicElement } from "../../../../../common/dom/dynamic-element-directive"; import { fireEvent } from "../../../../../common/dom/fire_event"; diff --git a/src/panels/config/entities/entity-registry-basic-editor.ts b/src/panels/config/entities/entity-registry-basic-editor.ts index 027e9334da..af79a115aa 100644 --- a/src/panels/config/entities/entity-registry-basic-editor.ts +++ b/src/panels/config/entities/entity-registry-basic-editor.ts @@ -1,15 +1,7 @@ import "@polymer/paper-input/paper-input"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - css, - customElement, - html, - state, - LitElement, - property, - PropertyValues, - TemplateResult, -} from "lit-element"; +import { css, html, LitElement, PropertyValues, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { computeDomain } from "../../../common/entity/compute_domain"; import "../../../components/ha-area-picker"; import "../../../components/ha-switch"; diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index 4c83b7b795..36bc24b843 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -4,14 +4,12 @@ import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeDomain } from "../../../common/entity/compute_domain"; import { domainIcon } from "../../../common/entity/domain_icon"; diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index 5f6993e13f..59f9a4f548 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -13,19 +13,10 @@ import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-listbox/paper-listbox"; import "@polymer/paper-tooltip/paper-tooltip"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { styleMap } from "lit-html/directives/style-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { styleMap } from "lit/directives/style-map"; import memoize from "memoize-one"; import type { HASSDomEvent } from "../../../common/dom/fire_event"; import { computeDomain } from "../../../common/entity/compute_domain"; diff --git a/src/panels/config/ha-config-section.ts b/src/panels/config/ha-config-section.ts index f98ef27012..01211a9b7a 100644 --- a/src/panels/config/ha-config-section.ts +++ b/src/panels/config/ha-config-section.ts @@ -1,5 +1,6 @@ -import { css, customElement, html, LitElement, property } from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; @customElement("ha-config-section") export class HaConfigSection extends LitElement { diff --git a/src/panels/config/ha-entity-config.ts b/src/panels/config/ha-entity-config.ts index 838523efc9..87a3fa0687 100644 --- a/src/panels/config/ha-entity-config.ts +++ b/src/panels/config/ha-entity-config.ts @@ -2,14 +2,12 @@ import "@material/mwc-button"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, query } from "lit/decorators"; import "../../components/buttons/ha-progress-button"; import "../../components/entity/ha-entity-picker"; import "../../components/ha-card"; diff --git a/src/panels/config/ha-panel-config.ts b/src/panels/config/ha-panel-config.ts index 34583a8ad8..e31711cf99 100644 --- a/src/panels/config/ha-panel-config.ts +++ b/src/panels/config/ha-panel-config.ts @@ -22,7 +22,8 @@ import { import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { PolymerElement } from "@polymer/polymer"; -import { customElement, state, property, PropertyValues } from "lit-element"; +import { PropertyValues } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; import { listenMediaQuery } from "../../common/dom/media_query"; import { CloudStatus, fetchCloudStatus } from "../../data/cloud"; diff --git a/src/panels/config/helpers/dialog-helper-detail.ts b/src/panels/config/helpers/dialog-helper-detail.ts index 16e85a43f0..459b5524f7 100644 --- a/src/panels/config/helpers/dialog-helper-detail.ts +++ b/src/panels/config/helpers/dialog-helper-detail.ts @@ -1,18 +1,9 @@ import "@material/mwc-button/mwc-button"; import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { dynamicElement } from "../../../common/dom/dynamic-element-directive"; import { domainIcon } from "../../../common/entity/domain_icon"; diff --git a/src/panels/config/helpers/forms/ha-counter-form.ts b/src/panels/config/helpers/forms/ha-counter-form.ts index 460bd0b9d2..607fa64af0 100644 --- a/src/panels/config/helpers/forms/ha-counter-form.ts +++ b/src/panels/config/helpers/forms/ha-counter-form.ts @@ -1,14 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-icon-input"; import "../../../../components/ha-switch"; diff --git a/src/panels/config/helpers/forms/ha-input_boolean-form.ts b/src/panels/config/helpers/forms/ha-input_boolean-form.ts index 18ca1f4741..419819d4f2 100644 --- a/src/panels/config/helpers/forms/ha-input_boolean-form.ts +++ b/src/panels/config/helpers/forms/ha-input_boolean-form.ts @@ -1,14 +1,6 @@ import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-icon-input"; import { InputBoolean } from "../../../../data/input_boolean"; diff --git a/src/panels/config/helpers/forms/ha-input_datetime-form.ts b/src/panels/config/helpers/forms/ha-input_datetime-form.ts index 03eb3f08c6..362fe30c90 100644 --- a/src/panels/config/helpers/forms/ha-input_datetime-form.ts +++ b/src/panels/config/helpers/forms/ha-input_datetime-form.ts @@ -1,16 +1,8 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-icon-input"; import { InputDateTime } from "../../../../data/input_datetime"; diff --git a/src/panels/config/helpers/forms/ha-input_number-form.ts b/src/panels/config/helpers/forms/ha-input_number-form.ts index c049b5790c..ec3288ebab 100644 --- a/src/panels/config/helpers/forms/ha-input_number-form.ts +++ b/src/panels/config/helpers/forms/ha-input_number-form.ts @@ -1,16 +1,8 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-icon-input"; import { InputNumber } from "../../../../data/input_number"; diff --git a/src/panels/config/helpers/forms/ha-input_select-form.ts b/src/panels/config/helpers/forms/ha-input_select-form.ts index 1aba9c2d23..fbb15f7f6e 100644 --- a/src/panels/config/helpers/forms/ha-input_select-form.ts +++ b/src/panels/config/helpers/forms/ha-input_select-form.ts @@ -3,17 +3,8 @@ import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-icon-button"; import "../../../../components/ha-icon-input"; diff --git a/src/panels/config/helpers/forms/ha-input_text-form.ts b/src/panels/config/helpers/forms/ha-input_text-form.ts index a63d8580eb..4de30e62d2 100644 --- a/src/panels/config/helpers/forms/ha-input_text-form.ts +++ b/src/panels/config/helpers/forms/ha-input_text-form.ts @@ -1,16 +1,8 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-icon-input"; import { InputText } from "../../../../data/input_text"; diff --git a/src/panels/config/helpers/forms/ha-timer-form.ts b/src/panels/config/helpers/forms/ha-timer-form.ts index e8a83ad32c..2842226ce5 100644 --- a/src/panels/config/helpers/forms/ha-timer-form.ts +++ b/src/panels/config/helpers/forms/ha-timer-form.ts @@ -1,13 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../common/dom/fire_event"; import "../../../../components/ha-icon-input"; import { DurationDict, Timer } from "../../../../data/timer"; diff --git a/src/panels/config/helpers/ha-config-helpers.ts b/src/panels/config/helpers/ha-config-helpers.ts index 41535926b2..40371e8607 100644 --- a/src/panels/config/helpers/ha-config-helpers.ts +++ b/src/panels/config/helpers/ha-config-helpers.ts @@ -5,15 +5,8 @@ import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-listbox/paper-listbox"; import "@polymer/paper-tooltip/paper-tooltip"; import { HassEntity } from "home-assistant-js-websocket"; -import { - customElement, - html, - state, - LitElement, - property, - PropertyValues, - TemplateResult, -} from "lit-element"; +import { html, LitElement, PropertyValues, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoize from "memoize-one"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; import { domainIcon } from "../../../common/entity/domain_icon"; diff --git a/src/panels/config/info/ha-config-info.ts b/src/panels/config/info/ha-config-info.ts index 7d2911ca45..d849eaeada 100644 --- a/src/panels/config/info/ha-config-info.ts +++ b/src/panels/config/info/ha-config-info.ts @@ -1,11 +1,5 @@ -import { - css, - CSSResultGroup, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property } from "lit/decorators"; import "../../../layouts/hass-tabs-subpage"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; diff --git a/src/panels/config/info/integrations-card.ts b/src/panels/config/info/integrations-card.ts index eb0c876148..2c31c9a354 100644 --- a/src/panels/config/info/integrations-card.ts +++ b/src/panels/config/info/integrations-card.ts @@ -1,13 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import "../../../components/ha-card"; import { diff --git a/src/panels/config/info/system-health-card.ts b/src/panels/config/info/system-health-card.ts index 85728fec70..28c139609a 100644 --- a/src/panels/config/info/system-health-card.ts +++ b/src/panels/config/info/system-health-card.ts @@ -4,18 +4,11 @@ import { ActionDetail } from "@material/mwc-list/mwc-list-foundation"; import "@material/mwc-list/mwc-list-item"; import { mdiContentCopy } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - CSSResultGroup, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property, state } from "lit/decorators"; +import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { formatDateTime } from "../../../common/datetime/format_date_time"; import { copyToClipboard } from "../../../common/util/copy-clipboard"; -import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import "../../../components/ha-button-menu"; import "../../../components/ha-card"; import "../../../components/ha-circular-progress"; diff --git a/src/panels/config/integrations/ha-config-flow-card.ts b/src/panels/config/integrations/ha-config-flow-card.ts index fd6769b22c..369b4dca7a 100644 --- a/src/panels/config/integrations/ha-config-flow-card.ts +++ b/src/panels/config/integrations/ha-config-flow-card.ts @@ -1,12 +1,6 @@ -import { - customElement, - LitElement, - property, - css, - html, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { fireEvent } from "../../../common/dom/fire_event"; import { ATTENTION_SOURCES, diff --git a/src/panels/config/integrations/ha-config-integrations.ts b/src/panels/config/integrations/ha-config-integrations.ts index e2cdcc6187..3446189e09 100644 --- a/src/panels/config/integrations/ha-config-integrations.ts +++ b/src/panels/config/integrations/ha-config-integrations.ts @@ -7,20 +7,25 @@ import type { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; import memoizeOne from "memoize-one"; +import type { HASSDomEvent } from "../../../common/dom/fire_event"; import { navigate } from "../../../common/navigate"; +import "../../../common/search/search-input"; import { caseInsensitiveCompare } from "../../../common/string/compare"; +import type { LocalizeFunc } from "../../../common/translations/localize"; import { extractSearchParam } from "../../../common/url/search-params"; import { nextRender } from "../../../common/util/render-status"; +import "../../../components/ha-button-menu"; +import "../../../components/ha-checkbox"; +import "../../../components/ha-fab"; +import "../../../components/ha-svg-icon"; import { ConfigEntry, getConfigEntries } from "../../../data/config_entries"; import { getConfigFlowInProgressCollection, @@ -44,25 +49,16 @@ import { } from "../../../data/integration"; import { showConfigFlowDialog } from "../../../dialogs/config-flow/show-dialog-config-flow"; import { showConfirmationDialog } from "../../../dialogs/generic/show-dialog-box"; -import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; -import { haStyle } from "../../../resources/styles"; -import { configSections } from "../ha-panel-config"; - -import type { HomeAssistant, Route } from "../../../types"; -import type { HASSDomEvent } from "../../../common/dom/fire_event"; -import type { LocalizeFunc } from "../../../common/translations/localize"; -import type { HaIntegrationCard } from "./ha-integration-card"; - -import "../../../common/search/search-input"; -import "../../../components/ha-button-menu"; -import "../../../components/ha-fab"; -import "../../../components/ha-checkbox"; -import "../../../components/ha-svg-icon"; import "../../../layouts/hass-loading-screen"; import "../../../layouts/hass-tabs-subpage"; -import "./ha-integration-card"; +import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; +import { haStyle } from "../../../resources/styles"; +import type { HomeAssistant, Route } from "../../../types"; +import { configSections } from "../ha-panel-config"; import "./ha-config-flow-card"; import "./ha-ignored-config-entry-card"; +import "./ha-integration-card"; +import type { HaIntegrationCard } from "./ha-integration-card"; export interface ConfigEntryUpdatedEvent { entry: ConfigEntry; diff --git a/src/panels/config/integrations/ha-ignored-config-entry-card.ts b/src/panels/config/integrations/ha-ignored-config-entry-card.ts index cbd6c476b7..34c7c32dc3 100644 --- a/src/panels/config/integrations/ha-ignored-config-entry-card.ts +++ b/src/panels/config/integrations/ha-ignored-config-entry-card.ts @@ -1,11 +1,5 @@ -import { - customElement, - LitElement, - property, - css, - html, - TemplateResult, -} from "lit-element"; +import { css, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import { deleteConfigEntry } from "../../../data/config_entries"; import type { IntegrationManifest } from "../../../data/integration"; diff --git a/src/panels/config/integrations/ha-integration-action-card.ts b/src/panels/config/integrations/ha-integration-action-card.ts index 2470067684..8f24451007 100644 --- a/src/panels/config/integrations/ha-integration-action-card.ts +++ b/src/panels/config/integrations/ha-integration-action-card.ts @@ -1,11 +1,5 @@ -import { - TemplateResult, - html, - customElement, - LitElement, - property, - css, -} from "lit-element"; +import { css, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import type { IntegrationManifest } from "../../../data/integration"; import type { HomeAssistant } from "../../../types"; import "./ha-integration-header"; diff --git a/src/panels/config/integrations/ha-integration-card.ts b/src/panels/config/integrations/ha-integration-card.ts index 615e359862..cbd7de5aab 100644 --- a/src/panels/config/integrations/ha-integration-card.ts +++ b/src/panels/config/integrations/ha-integration-card.ts @@ -1,26 +1,19 @@ -import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; -import "@material/mwc-list/mwc-list-item"; -import "@polymer/paper-listbox"; import "@material/mwc-button"; -import "@polymer/paper-item"; -import "@polymer/paper-tooltip/paper-tooltip"; +import "@material/mwc-list/mwc-list-item"; +import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; import { mdiAlertCircle, mdiDotsVertical, mdiOpenInNew } from "@mdi/js"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import "@polymer/paper-item"; +import "@polymer/paper-listbox"; +import "@polymer/paper-tooltip/paper-tooltip"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { fireEvent } from "../../../common/dom/fire_event"; import { shouldHandleRequestSelectedEvent } from "../../../common/mwc/handle-request-selected-event"; -import "../../../components/ha-icon-next"; import "../../../components/ha-button-menu"; -import "../../../components/ha-svg-icon"; import "../../../components/ha-card"; +import "../../../components/ha-icon-next"; +import "../../../components/ha-svg-icon"; import { ConfigEntry, deleteConfigEntry, diff --git a/src/panels/config/integrations/ha-integration-header.ts b/src/panels/config/integrations/ha-integration-header.ts index 29cf8d3544..cd189da48b 100644 --- a/src/panels/config/integrations/ha-integration-header.ts +++ b/src/panels/config/integrations/ha-integration-header.ts @@ -1,14 +1,8 @@ -import "../../../components/ha-svg-icon"; -import { mdiPackageVariant, mdiCloud } from "@mdi/js"; +import { mdiCloud, mdiPackageVariant } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - html, - customElement, - property, - LitElement, - TemplateResult, -} from "lit-element"; +import { css, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import "../../../components/ha-svg-icon"; import { domainToName, IntegrationManifest } from "../../../data/integration"; import { HomeAssistant } from "../../../types"; import { brandsUrl } from "../../../util/brands-url"; diff --git a/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts index 827e6aef6b..2edd27c8db 100644 --- a/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts @@ -1,15 +1,7 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../../../components/ha-card"; import "../../../../../components/ha-code-editor"; import { getConfigEntries } from "../../../../../data/config_entries"; diff --git a/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts index 22b3ab4a54..c3fd96ce4f 100644 --- a/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-subscribe-card.ts @@ -1,15 +1,7 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { formatTime } from "../../../../../common/datetime/format_time"; import "../../../../../components/ha-card"; import { MQTTMessage, subscribeMQTTTopic } from "../../../../../data/mqtt"; diff --git a/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts b/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts index 1f8faf19bb..8a0dd34174 100644 --- a/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts +++ b/src/panels/config/integrations/integration-panels/ozw/dialog-ozw-refresh-node.ts @@ -1,14 +1,12 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../../../components/ha-circular-progress"; import "../../../../../components/ha-code-editor"; import { createCloseHeading } from "../../../../../components/ha-dialog"; diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts index 8856c3a24c..5d4f673eff 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts @@ -2,16 +2,8 @@ import "@material/mwc-button/mwc-button"; import { mdiCheckCircle, mdiCircle, mdiCloseCircle, mdiZWave } from "@mdi/js"; import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { navigate } from "../../../../../common/navigate"; import "../../../../../components/ha-card"; import "../../../../../components/ha-icon-next"; diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-config-router.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-config-router.ts index ba31c90f06..ad2d2e38fe 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-config-router.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-config-router.ts @@ -1,4 +1,4 @@ -import { customElement, property } from "lit-element"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { HassRouterPage, diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts index 10f5e38d97..aa56687d6c 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts @@ -1,16 +1,8 @@ import "@material/mwc-button/mwc-button"; import { mdiCheckCircle, mdiCircle, mdiCloseCircle } from "@mdi/js"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { navigate } from "../../../../../common/navigate"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts index da9f5175a3..9de8234c6b 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts @@ -1,14 +1,7 @@ import "@material/mwc-button/mwc-button"; import { mdiAlert, mdiCheck } from "@mdi/js"; -import { - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { HASSDomEvent } from "../../../../../common/dom/fire_event"; import { navigate } from "../../../../../common/navigate"; diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-network-router.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-network-router.ts index e16133ba01..0294ff9b0f 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-network-router.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-network-router.ts @@ -1,5 +1,5 @@ import { mdiNetwork, mdiServerNetwork } from "@mdi/js"; -import { customElement, property } from "lit-element"; +import { customElement, property } from "lit/decorators"; import { HassRouterPage, RouterOptions, diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts index ec55e61569..4eeda2d481 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts @@ -1,14 +1,6 @@ import "@material/mwc-button/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { navigate } from "../../../../../common/navigate"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts index b8a6bcf5bd..af7d2089e0 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts @@ -1,14 +1,6 @@ import "@material/mwc-button/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { navigate } from "../../../../../common/navigate"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-node-router.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-node-router.ts index 45a922f8b7..5168e21138 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-node-router.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-node-router.ts @@ -1,5 +1,5 @@ import { mdiNetwork, mdiWrench } from "@mdi/js"; -import { customElement, property } from "lit-element"; +import { customElement, property } from "lit/decorators"; import { navigate } from "../../../../../common/navigate"; import { HassRouterPage, diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts index 8af5413706..1565588e57 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-cluster.ts @@ -1,13 +1,11 @@ import { CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { HASSDomEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/ha-code-editor"; import { createCloseHeading } from "../../../../../components/ha-dialog"; diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-children.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-children.ts index b8330b5826..f726df4231 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-children.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-children.ts @@ -1,12 +1,4 @@ -import { - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import memoizeOne from "memoize-one"; import { computeRTLDirection } from "../../../../../common/util/compute_rtl"; import "../../../../../components/ha-code-editor"; @@ -22,6 +14,7 @@ import type { import "../../../../../components/ha-circular-progress"; import { fetchDevices, ZHADevice } from "../../../../../data/zha"; import { fireEvent } from "../../../../../common/dom/fire_event"; +import { customElement, property, state } from "lit/decorators"; export interface DeviceRowData extends DataTableRowData { id: string; diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts index 17bb63f3f8..cd24720b6a 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-device-zigbee-info.ts @@ -1,12 +1,5 @@ -import { - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../../../components/ha-code-editor"; import { createCloseHeading } from "../../../../../components/ha-dialog"; import { haStyleDialog } from "../../../../../resources/styles"; diff --git a/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts b/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts index 1e82acbb8d..bf3ce73ead 100644 --- a/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts +++ b/src/panels/config/integrations/integration-panels/zha/dialog-zha-reconfigure-device.ts @@ -1,19 +1,11 @@ -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { mdiCheckCircle, mdiCloseCircle } from "@mdi/js"; import "@material/mwc-button/mwc-button"; -import { haStyleDialog } from "../../../../../resources/styles"; -import { HomeAssistant } from "../../../../../types"; -import { ZHAReconfigureDeviceDialogParams } from "./show-dialog-zha-reconfigure-device"; +import { mdiCheckCircle, mdiCloseCircle } from "@mdi/js"; +import { UnsubscribeFunc } from "home-assistant-js-websocket"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/ha-circular-progress"; +import { createCloseHeading } from "../../../../../components/ha-dialog"; import "../../../../../components/ha-svg-icon"; import { AttributeConfigurationStatus, @@ -26,9 +18,9 @@ import { ZHA_CHANNEL_MSG_BIND, ZHA_CHANNEL_MSG_CFG_RPT, } from "../../../../../data/zha"; -import { fireEvent } from "../../../../../common/dom/fire_event"; -import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { createCloseHeading } from "../../../../../components/ha-dialog"; +import { haStyleDialog } from "../../../../../resources/styles"; +import { HomeAssistant } from "../../../../../types"; +import { ZHAReconfigureDeviceDialogParams } from "./show-dialog-zha-reconfigure-device"; @customElement("dialog-zha-reconfigure-device") class DialogZHAReconfigureDevice extends LitElement { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts index c68bba9760..654cd3b4be 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-add-devices-page.ts @@ -4,14 +4,12 @@ import "@polymer/paper-input/paper-textarea"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../../../components/ha-circular-progress"; import "../../../../../components/ha-icon-button"; import "../../../../../components/ha-service-description"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts index 840d2ebea3..b628231d84 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts @@ -1,17 +1,8 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - PropertyValues, - query, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import type { HASSDomEvent } from "../../../../../common/dom/fire_event"; import { navigate } from "../../../../../common/navigate"; import type { SelectionChangedEvent } from "../../../../../components/data-table/ha-data-table"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts b/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts index 69e3c2f120..0d7a815256 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-cluster-attributes.ts @@ -7,12 +7,11 @@ import { css, CSSResultGroup, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { property, state } from "lit/decorators"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; import "../../../../../components/ha-icon-button"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts b/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts index bae849aff9..5ffcf61637 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-cluster-commands.ts @@ -6,12 +6,11 @@ import { css, CSSResultGroup, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { property, state } from "lit/decorators"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; import "../../../../../components/ha-icon-button"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts b/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts index cfaa1a1717..e29bcbe10d 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-clusters-data-table.ts @@ -1,11 +1,5 @@ -import { - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; import memoizeOne from "memoize-one"; import { computeRTLDirection } from "../../../../../common/util/compute_rtl"; import "../../../../../components/data-table/ha-data-table"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts b/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts index 46b4c6caea..4559fafe9e 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-clusters.ts @@ -5,12 +5,11 @@ import { css, CSSResultGroup, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { property, state } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts index 4fcef9343c..87ed324256 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts @@ -1,4 +1,4 @@ -import { customElement, property } from "lit-element"; +import { customElement, property } from "lit/decorators"; import { navigate } from "../../../../../common/navigate"; import { HassRouterPage, diff --git a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts index d8241f67a9..0b1014d78c 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard.ts @@ -5,13 +5,11 @@ import "@polymer/paper-item/paper-item-body"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; import { computeRTL } from "../../../../../common/util/compute_rtl"; import "../../../../../components/ha-card"; import "../../../../../components/ha-fab"; @@ -27,6 +25,7 @@ import { updateZHAConfiguration, ZHAConfiguration, } from "../../../../../data/zha"; +import { customElement, property } from "lit/decorators"; export const zhaTabs: PageNavigation[] = [ { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts index 5cbd2a947e..36c71f8536 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-binding.ts @@ -5,14 +5,12 @@ import "@polymer/paper-listbox/paper-listbox"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; import "../../../../../components/ha-icon-button"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts index eeae2aa242..f1dbb1a254 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts @@ -1,16 +1,7 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-listbox/paper-listbox"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - state, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { fireEvent } from "../../../../../common/dom/fire_event"; import { computeStateName } from "../../../../../common/entity/compute_state_name"; import "../../../../../components/buttons/ha-call-service-button"; @@ -34,6 +25,7 @@ import { EntityRegistryStateEntry } from "../../../devices/ha-config-device-page import { compare } from "../../../../../common/string/compare"; import { getIeeeTail } from "./functions"; import { slugify } from "../../../../../common/string/slugify"; +import { customElement, property, state } from "lit/decorators"; @customElement("zha-device-card") class ZHADeviceCard extends SubscribeMixin(LitElement) { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts index d0d79c8dd3..3a3ce48f09 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-endpoint-data-table.ts @@ -1,13 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; import memoizeOne from "memoize-one"; import { computeRTLDirection } from "../../../../../common/util/compute_rtl"; import "../../../../../components/data-table/ha-data-table"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts index 4721363bc6..0fc745cf81 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-pairing-status-card.ts @@ -1,16 +1,8 @@ import "@polymer/paper-input/paper-input"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/entity/state-badge"; import "../../../../../components/ha-area-picker"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts b/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts index 571d5c7101..201c139c69 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-group-binding.ts @@ -5,15 +5,12 @@ import "@polymer/paper-listbox/paper-listbox"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import type { HASSDomEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/buttons/ha-call-service-button"; import { SelectionChangedEvent } from "../../../../../components/data-table/ha-data-table"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts index 2a52714a02..d26a92f275 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts @@ -1,15 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - PropertyValues, - query, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { HASSDomEvent } from "../../../../../common/dom/fire_event"; import { navigate } from "../../../../../common/navigate"; import { SelectionChangedEvent } from "../../../../../components/data-table/ha-data-table"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts b/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts index b11428b9fa..3eff559dcc 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts @@ -3,13 +3,12 @@ import { mdiPlus } from "@mdi/js"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { HASSDomEvent } from "../../../../../common/dom/fire_event"; import { navigate } from "../../../../../common/navigate"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts index ac195ca760..bd9d3cee82 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts @@ -1,14 +1,4 @@ -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - PropertyValues, - query, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; import "@material/mwc-button"; import { navigate } from "../../../../../common/navigate"; @@ -30,6 +20,7 @@ import { DeviceRegistryEntry } from "../../../../../data/device_registry"; import "../../../../../components/ha-checkbox"; import type { HaCheckbox } from "../../../../../components/ha-checkbox"; import { zhaTabs } from "./zha-config-dashboard"; +import { customElement, property, query, state } from "lit/decorators"; @customElement("zha-network-visualization-page") export class ZHANetworkVisualizationPage extends LitElement { diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-config-router.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-config-router.ts index 70d5a07b0b..e5c53c9b53 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-config-router.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-config-router.ts @@ -1,10 +1,10 @@ -import { customElement, property } from "lit-element"; +import { customElement, property } from "lit/decorators"; +import { navigate } from "../../../../../common/navigate"; import { HassRouterPage, RouterOptions, } from "../../../../../layouts/hass-router-page"; import { HomeAssistant } from "../../../../../types"; -import { navigate } from "../../../../../common/navigate"; @customElement("zwave-config-router") class ZWaveConfigRouter extends HassRouterPage { diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts index 114c146bdf..fa05774fc2 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts @@ -1,45 +1,37 @@ +import "@material/mwc-button/mwc-button"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; -import "@material/mwc-button/mwc-button"; -import "../../../../../components/ha-icon-button"; -import "../../../../../components/ha-circular-progress"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - state, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { isComponentLoaded } from "../../../../../common/config/is_component_loaded"; +import { computeStateName } from "../../../../../common/entity/compute_state_name"; +import { navigate } from "../../../../../common/navigate"; import "../../../../../components/buttons/ha-call-api-button"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; +import "../../../../../components/ha-circular-progress"; import "../../../../../components/ha-icon"; -import { - fetchNetworkStatus, - ZWaveNetworkStatus, - ZWAVE_NETWORK_STATE_STOPPED, - fetchMigrationConfig, - ZWaveMigrationConfig, - startOzwConfigFlow, -} from "../../../../../data/zwave"; -import { haStyle } from "../../../../../resources/styles"; -import type { HomeAssistant, Route } from "../../../../../types"; -import "../../../ha-config-section"; -import "../../../../../layouts/hass-subpage"; -import { showConfigFlowDialog } from "../../../../../dialogs/config-flow/show-dialog-config-flow"; -import { migrateZwave, OZWMigrationData } from "../../../../../data/ozw"; -import { navigate } from "../../../../../common/navigate"; -import { showAlertDialog } from "../../../../../dialogs/generic/show-dialog-box"; -import { computeStateName } from "../../../../../common/entity/compute_state_name"; +import "../../../../../components/ha-icon-button"; import { computeDeviceName, subscribeDeviceRegistry, } from "../../../../../data/device_registry"; -import { isComponentLoaded } from "../../../../../common/config/is_component_loaded"; +import { migrateZwave, OZWMigrationData } from "../../../../../data/ozw"; +import { + fetchMigrationConfig, + fetchNetworkStatus, + startOzwConfigFlow, + ZWaveMigrationConfig, + ZWaveNetworkStatus, + ZWAVE_NETWORK_STATE_STOPPED, +} from "../../../../../data/zwave"; +import { showConfigFlowDialog } from "../../../../../dialogs/config-flow/show-dialog-config-flow"; +import { showAlertDialog } from "../../../../../dialogs/generic/show-dialog-box"; +import "../../../../../layouts/hass-subpage"; +import { haStyle } from "../../../../../resources/styles"; +import type { HomeAssistant, Route } from "../../../../../types"; +import "../../../ha-config-section"; @customElement("zwave-migration") export class ZwaveMigration extends LitElement { diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts index e162edacc9..12d0284cc1 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-network.ts @@ -1,14 +1,6 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../../../components/buttons/ha-call-api-button"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts index 4bc1542a51..3a846334b6 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-node-config.ts @@ -5,14 +5,12 @@ import "@polymer/paper-listbox/paper-listbox"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; import { diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts index 719a57a493..1e6750c6af 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-values.ts @@ -1,16 +1,8 @@ import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../../../components/buttons/ha-call-service-button"; import "../../../../../components/ha-card"; import { ZWaveValue } from "../../../../../data/zwave"; diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts index 0de86314ba..9e2f4e8874 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts @@ -2,22 +2,14 @@ import "@material/mwc-button/mwc-button"; import { mdiCheckCircle, mdiCloseCircle } from "@mdi/js"; import "../../../../../components/ha-switch"; import "../../../../../components/ha-formfield"; -import { - CSSResultGroup, - customElement, - html, - LitElement, - property, - state, - TemplateResult, - css, -} from "lit-element"; +import { CSSResultGroup, html, LitElement, TemplateResult, css } from "lit"; import "../../../../../components/ha-circular-progress"; import { createCloseHeading } from "../../../../../components/ha-dialog"; import { haStyleDialog } from "../../../../../resources/styles"; import { HomeAssistant } from "../../../../../types"; import { ZWaveJSAddNodeDialogParams } from "./show-dialog-zwave_js-add-node"; import { fireEvent } from "../../../../../common/dom/fire_event"; +import { customElement, property, state } from "lit/decorators"; export interface ZWaveJSAddNodeDevice { id: string; diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-reinterview-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-reinterview-node.ts index f15acf8846..c3bfd90433 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-reinterview-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-reinterview-node.ts @@ -1,23 +1,15 @@ import "@material/mwc-button/mwc-button"; import { mdiCheckCircle, mdiCloseCircle } from "@mdi/js"; -import { - CSSResult, - customElement, - html, - LitElement, - property, - state, - TemplateResult, - css, -} from "lit-element"; +import { UnsubscribeFunc } from "home-assistant-js-websocket"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/ha-circular-progress"; import { createCloseHeading } from "../../../../../components/ha-dialog"; +import { reinterviewNode } from "../../../../../data/zwave_js"; import { haStyleDialog } from "../../../../../resources/styles"; import { HomeAssistant } from "../../../../../types"; import { ZWaveJSReinterviewNodeDialogParams } from "./show-dialog-zwave_js-reinterview-node"; -import { fireEvent } from "../../../../../common/dom/fire_event"; -import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { reinterviewNode } from "../../../../../data/zwave_js"; @customElement("dialog-zwave_js-reinterview-node") class DialogZWaveJSReinterviewNode extends LitElement { @@ -212,7 +204,7 @@ class DialogZWaveJSReinterviewNode extends LitElement { fireEvent(this, "dialog-closed", { dialog: this.localName }); } - static get styles(): CSSResult[] { + static get styles(): CSSResultGroup { return [ haStyleDialog, css` diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts index 5c575d41e2..a6f7018940 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts @@ -1,21 +1,13 @@ import "@material/mwc-button/mwc-button"; -import { - CSSResultGroup, - customElement, - html, - LitElement, - property, - state, - TemplateResult, - css, -} from "lit-element"; +import { mdiCheckCircle, mdiCloseCircle } from "@mdi/js"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/ha-circular-progress"; import { createCloseHeading } from "../../../../../components/ha-dialog"; import { haStyleDialog } from "../../../../../resources/styles"; import { HomeAssistant } from "../../../../../types"; import { ZWaveJSRemoveNodeDialogParams } from "./show-dialog-zwave_js-remove-node"; -import { mdiCheckCircle, mdiCloseCircle } from "@mdi/js"; -import { fireEvent } from "../../../../../common/dom/fire_event"; export interface ZWaveJSRemovedNode { node_id: number; diff --git a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts index 5e082e90e7..6a9580cb7f 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts @@ -1,20 +1,12 @@ import "@material/mwc-button/mwc-button"; import "@material/mwc-icon-button/mwc-icon-button"; import { mdiCheckCircle, mdiCircle, mdiRefresh } from "@mdi/js"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import "../../../../../components/ha-card"; -import "../../../../../components/ha-svg-icon"; import "../../../../../components/ha-icon-next"; +import "../../../../../components/ha-svg-icon"; import { getSignedPath } from "../../../../../data/auth"; import { fetchDataCollectionStatus, diff --git a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-router.ts b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-router.ts index 2973f17c3b..b20a1b0661 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-router.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-router.ts @@ -1,4 +1,3 @@ -import { customElement, property } from "lit-element"; import { HassRouterPage, RouterOptions, @@ -8,6 +7,7 @@ import { navigate } from "../../../../../common/navigate"; import { PageNavigation } from "../../../../../layouts/hass-tabs-subpage"; import { mdiServerNetwork, mdiMathLog } from "@mdi/js"; +import { customElement, property } from "lit/decorators"; export const configTabs: PageNavigation[] = [ { diff --git a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts index d8efb4ed06..90e0d44edd 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts @@ -1,27 +1,19 @@ -import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - css, - html, - property, - customElement, - LitElement, - CSSResultArray, - state, - query, -} from "lit-element"; -import "@polymer/paper-listbox/paper-listbox"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; +import "@polymer/paper-listbox/paper-listbox"; +import { UnsubscribeFunc } from "home-assistant-js-websocket"; +import { css, CSSResultArray, html, LitElement } from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { fetchZWaveJSLogConfig, setZWaveJSLogLevel, subscribeZWaveJSLogs, ZWaveJSLogConfig, } from "../../../../../data/zwave_js"; +import "../../../../../layouts/hass-tabs-subpage"; import { SubscribeMixin } from "../../../../../mixins/subscribe-mixin"; +import { haStyle } from "../../../../../resources/styles"; import { HomeAssistant, Route } from "../../../../../types"; import { configTabs } from "./zwave_js-config-router"; -import "../../../../../layouts/hass-tabs-subpage"; -import { haStyle } from "../../../../../resources/styles"; @customElement("zwave_js-logs") class ZWaveJSLogs extends SubscribeMixin(LitElement) { diff --git a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts index 47a81f57e7..b58c12ec53 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-node-config.ts @@ -1,31 +1,37 @@ -import { - mdiCheckCircle, - mdiCircle, - mdiProgressClock, - mdiCloseCircle, -} from "@mdi/js"; -import "../../../../../components/ha-settings-row"; -import "@polymer/paper-item/paper-item"; -import "@polymer/paper-listbox/paper-listbox"; -import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; import "@material/mwc-button/mwc-button"; import "@material/mwc-icon-button/mwc-icon-button"; +import { + mdiCheckCircle, + mdiCircle, + mdiCloseCircle, + mdiProgressClock, +} from "@mdi/js"; +import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; +import "@polymer/paper-item/paper-item"; +import "@polymer/paper-listbox/paper-listbox"; +import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import memoizeOne from "memoize-one"; import { debounce } from "../../../../../common/util/debounce"; import "../../../../../components/ha-card"; -import "../../../../../components/ha-svg-icon"; import "../../../../../components/ha-icon-next"; +import "../../../../../components/ha-settings-row"; +import "../../../../../components/ha-svg-icon"; import "../../../../../components/ha-switch"; +import { + computeDeviceName, + DeviceRegistryEntry, + subscribeDeviceRegistry, +} from "../../../../../data/device_registry"; import { fetchNodeConfigParameters, setNodeConfigParameter, @@ -33,19 +39,11 @@ import { ZWaveJSSetConfigParamResult, } from "../../../../../data/zwave_js"; import "../../../../../layouts/hass-tabs-subpage"; +import { SubscribeMixin } from "../../../../../mixins/subscribe-mixin"; import { haStyle } from "../../../../../resources/styles"; import type { HomeAssistant, Route } from "../../../../../types"; import "../../../ha-config-section"; import { configTabs } from "./zwave_js-config-router"; -import { - DeviceRegistryEntry, - computeDeviceName, - subscribeDeviceRegistry, -} from "../../../../../data/device_registry"; -import { SubscribeMixin } from "../../../../../mixins/subscribe-mixin"; -import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import memoizeOne from "memoize-one"; -import { classMap } from "lit-html/directives/class-map"; const icons = { accepted: mdiCheckCircle, diff --git a/src/panels/config/logs/dialog-system-log-detail.ts b/src/panels/config/logs/dialog-system-log-detail.ts index 2eed2d9224..51e2483d73 100644 --- a/src/panels/config/logs/dialog-system-log-detail.ts +++ b/src/panels/config/logs/dialog-system-log-detail.ts @@ -1,15 +1,8 @@ import "@material/mwc-icon-button/mwc-icon-button"; import { mdiClose, mdiContentCopy, mdiPackageVariant } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - CSSResultGroup, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property, state } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import { copyToClipboard } from "../../../common/util/copy-clipboard"; import "../../../components/ha-dialog"; diff --git a/src/panels/config/logs/error-log-card.ts b/src/panels/config/logs/error-log-card.ts index 1f10e7a5a1..b096fb93ad 100644 --- a/src/panels/config/logs/error-log-card.ts +++ b/src/panels/config/logs/error-log-card.ts @@ -1,13 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property, state } from "lit/decorators"; import "../../../components/ha-icon-button"; import { fetchErrorLog } from "../../../data/error_log"; import { HomeAssistant } from "../../../types"; diff --git a/src/panels/config/logs/ha-config-logs.ts b/src/panels/config/logs/ha-config-logs.ts index a2166e3ba4..13ef1137dc 100644 --- a/src/panels/config/logs/ha-config-logs.ts +++ b/src/panels/config/logs/ha-config-logs.ts @@ -1,13 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - query, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, query } from "lit/decorators"; import "../../../layouts/hass-tabs-subpage"; import { haStyle } from "../../../resources/styles"; import { HomeAssistant, Route } from "../../../types"; diff --git a/src/panels/config/logs/system-log-card.ts b/src/panels/config/logs/system-log-card.ts index 61d03b3da9..bc59a07457 100644 --- a/src/panels/config/logs/system-log-card.ts +++ b/src/panels/config/logs/system-log-card.ts @@ -1,15 +1,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../components/buttons/ha-call-service-button"; import "../../../components/buttons/ha-progress-button"; import "../../../components/ha-card"; diff --git a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts index 5748d93f78..423afb32a7 100644 --- a/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts +++ b/src/panels/config/lovelace/dashboards/dialog-lovelace-dashboard-detail.ts @@ -1,14 +1,6 @@ import "@material/mwc-button/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { slugify } from "../../../../common/string/slugify"; import { computeRTLDirection } from "../../../../common/util/compute_rtl"; import { createCloseHeading } from "../../../../components/ha-dialog"; diff --git a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts index 2eef3839fe..ebe0b30dec 100644 --- a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts +++ b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts @@ -1,14 +1,7 @@ import { mdiPlus } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - customElement, - html, - state, - LitElement, - property, - PropertyValues, - TemplateResult, -} from "lit-element"; +import { html, LitElement, PropertyValues, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoize from "memoize-one"; import { navigate } from "../../../../common/navigate"; import { compare } from "../../../../common/string/compare"; diff --git a/src/panels/config/lovelace/ha-config-lovelace.ts b/src/panels/config/lovelace/ha-config-lovelace.ts index 1f12645d3b..2c09c81569 100644 --- a/src/panels/config/lovelace/ha-config-lovelace.ts +++ b/src/panels/config/lovelace/ha-config-lovelace.ts @@ -1,4 +1,4 @@ -import { customElement, property } from "lit-element"; +import { customElement, property } from "lit/decorators"; import { HassRouterPage, RouterOptions, diff --git a/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts b/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts index 48836d8a46..66b45c2394 100644 --- a/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts +++ b/src/panels/config/lovelace/resources/dialog-lovelace-resource-detail.ts @@ -2,16 +2,8 @@ import "@material/mwc-button/mwc-button"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { createCloseHeading } from "../../../../components/ha-dialog"; import "../../../../components/ha-paper-dropdown-menu"; import { diff --git a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts index 8366b52051..3497bd1a73 100644 --- a/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts +++ b/src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts @@ -3,15 +3,8 @@ import "@polymer/paper-checkbox/paper-checkbox"; import "@polymer/paper-dropdown-menu/paper-dropdown-menu"; import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - customElement, - html, - state, - LitElement, - property, - PropertyValues, - TemplateResult, -} from "lit-element"; +import { html, LitElement, PropertyValues, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoize from "memoize-one"; import { compare } from "../../../../common/string/compare"; import { diff --git a/src/panels/config/person/dialog-person-detail.ts b/src/panels/config/person/dialog-person-detail.ts index d9fb7f3dca..88dce3ce2c 100644 --- a/src/panels/config/person/dialog-person-detail.ts +++ b/src/panels/config/person/dialog-person-detail.ts @@ -1,14 +1,7 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; import "../../../components/entity/ha-entities-picker"; diff --git a/src/panels/config/person/ha-config-person.ts b/src/panels/config/person/ha-config-person.ts index 3452320425..e67bb715f6 100644 --- a/src/panels/config/person/ha-config-person.ts +++ b/src/panels/config/person/ha-config-person.ts @@ -1,15 +1,8 @@ import { mdiPlus } from "@mdi/js"; import "@polymer/paper-item/paper-icon-item"; import "@polymer/paper-item/paper-item-body"; -import { - css, - CSSResultGroup, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property, state } from "lit/decorators"; import { compare } from "../../../common/string/compare"; import "../../../components/ha-card"; import "../../../components/ha-fab"; diff --git a/src/panels/config/scene/ha-config-scene.ts b/src/panels/config/scene/ha-config-scene.ts index 275a00200f..ae0742e754 100644 --- a/src/panels/config/scene/ha-config-scene.ts +++ b/src/panels/config/scene/ha-config-scene.ts @@ -1,5 +1,6 @@ import { HassEntities } from "home-assistant-js-websocket"; -import { customElement, property, PropertyValues } from "lit-element"; +import { PropertyValues } from "lit"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; import { debounce } from "../../../common/util/debounce"; diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts index 846f209485..d887231989 100644 --- a/src/panels/config/scene/ha-scene-dashboard.ts +++ b/src/panels/config/scene/ha-scene-dashboard.ts @@ -8,26 +8,18 @@ import { mdiPlus, } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateName } from "../../../common/entity/compute_state_name"; import { stateIcon } from "../../../common/entity/state_icon"; import { DataTableColumnContainer } from "../../../components/data-table/ha-data-table"; +import "../../../components/ha-button-related-filter-menu"; import "../../../components/ha-fab"; import "../../../components/ha-icon"; import "../../../components/ha-svg-icon"; -import "../../../components/ha-button-related-filter-menu"; import { forwardHaptic } from "../../../data/haptics"; import { activateScene, SceneEntity } from "../../../data/scene"; import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; diff --git a/src/panels/config/scene/ha-scene-editor.ts b/src/panels/config/scene/ha-scene-editor.ts index 953535dbc8..9fcfffd70e 100644 --- a/src/panels/config/scene/ha-scene-editor.ts +++ b/src/panels/config/scene/ha-scene-editor.ts @@ -13,15 +13,13 @@ import { HassEvent } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeDomain } from "../../../common/entity/compute_domain"; diff --git a/src/panels/config/script/ha-config-script.ts b/src/panels/config/script/ha-config-script.ts index 6efe063b55..f1c11a2b84 100644 --- a/src/panels/config/script/ha-config-script.ts +++ b/src/panels/config/script/ha-config-script.ts @@ -1,5 +1,6 @@ import { HassEntities } from "home-assistant-js-websocket"; -import { customElement, property, PropertyValues } from "lit-element"; +import { PropertyValues } from "lit"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; import { debounce } from "../../../common/util/debounce"; diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index fc17217056..4d0cec0df5 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -15,14 +15,12 @@ import { css, CSSResultGroup, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { computeObjectId } from "../../../common/entity/compute_object_id"; import { navigate } from "../../../common/navigate"; import { slugify } from "../../../common/string/slugify"; diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index aa2e527815..c52efb19df 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -7,16 +7,8 @@ import { mdiPlus, } from "@mdi/js"; import { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { formatDateTime } from "../../../common/datetime/format_date_time"; import { fireEvent } from "../../../common/dom/fire_event"; diff --git a/src/panels/config/server_control/ha-config-server-control.ts b/src/panels/config/server_control/ha-config-server-control.ts index 8eb165aa71..3a5c7ae56e 100644 --- a/src/panels/config/server_control/ha-config-server-control.ts +++ b/src/panels/config/server_control/ha-config-server-control.ts @@ -2,16 +2,8 @@ import "@material/mwc-button"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { componentsWithService } from "../../../common/config/components_with_service"; import "../../../components/buttons/ha-call-service-button"; import "../../../components/ha-card"; diff --git a/src/panels/config/tags/dialog-tag-detail.ts b/src/panels/config/tags/dialog-tag-detail.ts index 0f7f551110..9d7f322336 100644 --- a/src/panels/config/tags/dialog-tag-detail.ts +++ b/src/panels/config/tags/dialog-tag-detail.ts @@ -1,15 +1,7 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import { createCloseHeading } from "../../../components/ha-dialog"; import "../../../components/ha-formfield"; diff --git a/src/panels/config/tags/ha-config-tags.ts b/src/panels/config/tags/ha-config-tags.ts index 9c138eabe3..b8745a6117 100644 --- a/src/panels/config/tags/ha-config-tags.ts +++ b/src/panels/config/tags/ha-config-tags.ts @@ -6,14 +6,8 @@ import { mdiPlus, mdiRobot, } from "@mdi/js"; -import { - customElement, - html, - state, - LitElement, - property, - PropertyValues, -} from "lit-element"; +import { html, LitElement, PropertyValues } from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { DataTableColumnContainer } from "../../../components/data-table/ha-data-table"; import "../../../components/ha-card"; diff --git a/src/panels/config/tags/tag-image.ts b/src/panels/config/tags/tag-image.ts index eae822f0b7..ce5a5826c4 100644 --- a/src/panels/config/tags/tag-image.ts +++ b/src/panels/config/tags/tag-image.ts @@ -1,12 +1,6 @@ import { mdiNfcVariant } from "@mdi/js"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../components/ha-svg-icon"; import { TagRowData } from "./ha-config-tags"; diff --git a/src/panels/config/users/dialog-add-user.ts b/src/panels/config/users/dialog-add-user.ts index 850157a63f..64f9d4723d 100644 --- a/src/panels/config/users/dialog-add-user.ts +++ b/src/panels/config/users/dialog-add-user.ts @@ -3,14 +3,12 @@ import "@polymer/paper-input/paper-input"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; import "../../../components/ha-circular-progress"; import "../../../components/ha-dialog"; diff --git a/src/panels/config/users/dialog-user-detail.ts b/src/panels/config/users/dialog-user-detail.ts index 864aaef4c4..f7f47b0157 100644 --- a/src/panels/config/users/dialog-user-detail.ts +++ b/src/panels/config/users/dialog-user-detail.ts @@ -1,16 +1,8 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { computeRTLDirection } from "../../../common/util/compute_rtl"; import { createCloseHeading } from "../../../components/ha-dialog"; import "../../../components/ha-formfield"; diff --git a/src/panels/config/users/ha-config-users.ts b/src/panels/config/users/ha-config-users.ts index 74dde61fc3..13807febd4 100644 --- a/src/panels/config/users/ha-config-users.ts +++ b/src/panels/config/users/ha-config-users.ts @@ -1,11 +1,6 @@ import { mdiPlus } from "@mdi/js"; -import { - customElement, - LitElement, - property, - PropertyValues, -} from "lit-element"; -import { html } from "lit-html"; +import { html, LitElement, PropertyValues } from "lit"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import { HASSDomEvent } from "../../../common/dom/fire_event"; import { diff --git a/src/panels/config/zone/dialog-zone-detail.ts b/src/panels/config/zone/dialog-zone-detail.ts index 380d6ed767..ac4cedc32a 100644 --- a/src/panels/config/zone/dialog-zone-detail.ts +++ b/src/panels/config/zone/dialog-zone-detail.ts @@ -1,14 +1,7 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; -import { - css, - CSSResultGroup, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../../common/dom/fire_event"; import { addDistanceToCoord } from "../../../common/location/add_distance_to_coord"; diff --git a/src/panels/config/zone/ha-config-zone.ts b/src/panels/config/zone/ha-config-zone.ts index 328ff27072..3d4082b580 100644 --- a/src/panels/config/zone/ha-config-zone.ts +++ b/src/panels/config/zone/ha-config-zone.ts @@ -1,4 +1,3 @@ -import "../../../components/ha-fab"; import "@material/mwc-icon-button"; import { mdiPencil, mdiPencilOff, mdiPlus } from "@mdi/js"; import "@polymer/paper-item/paper-icon-item"; @@ -9,21 +8,19 @@ import { HassEntity, UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; +} from "lit"; +import { customElement, property, state, query } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; import memoizeOne from "memoize-one"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; import { navigate } from "../../../common/navigate"; import { compare } from "../../../common/string/compare"; import "../../../components/ha-card"; +import "../../../components/ha-fab"; import "../../../components/ha-svg-icon"; import "../../../components/map/ha-locations-editor"; import type { diff --git a/src/panels/custom/ha-panel-custom.ts b/src/panels/custom/ha-panel-custom.ts index 0956624db4..02eb6f7f5c 100644 --- a/src/panels/custom/ha-panel-custom.ts +++ b/src/panels/custom/ha-panel-custom.ts @@ -1,4 +1,5 @@ -import { property, PropertyValues, ReactiveElement } from "lit-element"; +import { PropertyValues, ReactiveElement } from "lit"; +import { property } from "lit/decorators"; import { navigate } from "../../common/navigate"; import { CustomPanelInfo } from "../../data/panel_custom"; import { HomeAssistant, Route } from "../../types"; diff --git a/src/panels/developer-tools/developer-tools-router.ts b/src/panels/developer-tools/developer-tools-router.ts index 903948a168..efc0c01ddc 100644 --- a/src/panels/developer-tools/developer-tools-router.ts +++ b/src/panels/developer-tools/developer-tools-router.ts @@ -1,5 +1,5 @@ import { PolymerElement } from "@polymer/polymer"; -import { customElement, property } from "lit-element"; +import { customElement, property } from "lit/decorators"; import { HassRouterPage, RouterOptions } from "../../layouts/hass-router-page"; import { HomeAssistant } from "../../types"; diff --git a/src/panels/developer-tools/event/event-subscribe-card.ts b/src/panels/developer-tools/event/event-subscribe-card.ts index 3bdc41acbc..cfa8a67be6 100644 --- a/src/panels/developer-tools/event/event-subscribe-card.ts +++ b/src/panels/developer-tools/event/event-subscribe-card.ts @@ -1,16 +1,8 @@ import "@material/mwc-button"; import "@polymer/paper-input/paper-input"; import { HassEvent } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { formatTime } from "../../../common/datetime/format_time"; import "../../../components/ha-card"; import { PolymerChangedEvent } from "../../../polymer-types"; diff --git a/src/panels/developer-tools/ha-panel-developer-tools.ts b/src/panels/developer-tools/ha-panel-developer-tools.ts index 5ff7069cd6..f8504f64c3 100644 --- a/src/panels/developer-tools/ha-panel-developer-tools.ts +++ b/src/panels/developer-tools/ha-panel-developer-tools.ts @@ -1,15 +1,8 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; import "@polymer/paper-tabs/paper-tab"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { navigate } from "../../common/navigate"; import "../../components/ha-icon-button"; import "../../components/ha-menu-button"; diff --git a/src/panels/developer-tools/service/developer-tools-service.ts b/src/panels/developer-tools/service/developer-tools-service.ts index 882dfab821..0cb879496d 100644 --- a/src/panels/developer-tools/service/developer-tools-service.ts +++ b/src/panels/developer-tools/service/developer-tools-service.ts @@ -1,15 +1,8 @@ import { mdiHelpCircle } from "@mdi/js"; import { ERR_CONNECTION_LOST } from "home-assistant-js-websocket"; import { safeLoad } from "js-yaml"; -import { - css, - CSSResultGroup, - html, - state, - LitElement, - property, - query, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { property, query, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { LocalStorage } from "../../../common/decorators/local-storage"; import { computeDomain } from "../../../common/entity/compute_domain"; diff --git a/src/panels/developer-tools/state/developer-tools-state.js b/src/panels/developer-tools/state/developer-tools-state.js index 7bedfd8a42..5d7cd84cc4 100644 --- a/src/panels/developer-tools/state/developer-tools-state.js +++ b/src/panels/developer-tools/state/developer-tools-state.js @@ -1,7 +1,7 @@ import "@material/mwc-button"; import { - mdiInformationOutline, mdiClipboardTextMultipleOutline, + mdiInformationOutline, } from "@mdi/js"; import "@polymer/paper-checkbox/paper-checkbox"; import "@polymer/paper-input/paper-input"; @@ -11,6 +11,7 @@ import { PolymerElement } from "@polymer/polymer/polymer-element"; import { safeDump, safeLoad } from "js-yaml"; import { formatDateTimeWithSeconds } from "../../../common/datetime/format_date_time"; import { computeRTL } from "../../../common/util/compute_rtl"; +import { copyToClipboard } from "../../../common/util/copy-clipboard"; import "../../../components/entity/ha-entity-picker"; import "../../../components/ha-code-editor"; import "../../../components/ha-svg-icon"; @@ -18,7 +19,6 @@ import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import { EventsMixin } from "../../../mixins/events-mixin"; import LocalizeMixin from "../../../mixins/localize-mixin"; import "../../../styles/polymer-ha-style"; -import { copyToClipboard } from "../../../common/util/copy-clipboard"; const ERROR_SENTINEL = {}; /* diff --git a/src/panels/developer-tools/template/developer-tools-template.ts b/src/panels/developer-tools/template/developer-tools-template.ts index 9014942a11..670ae744b2 100644 --- a/src/panels/developer-tools/template/developer-tools-template.ts +++ b/src/panels/developer-tools/template/developer-tools-template.ts @@ -1,15 +1,8 @@ import "@material/mwc-button/mwc-button"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - property, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { debounce } from "../../../common/util/debounce"; import "../../../components/ha-circular-progress"; import "../../../components/ha-code-editor"; diff --git a/src/panels/history/ha-panel-history.ts b/src/panels/history/ha-panel-history.ts index 59b89758c4..31737c8874 100644 --- a/src/panels/history/ha-panel-history.ts +++ b/src/panels/history/ha-panel-history.ts @@ -1,7 +1,7 @@ import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; -import { css, state, LitElement, property, PropertyValues } from "lit-element"; -import { html } from "lit-html"; +import { css, html, LitElement, PropertyValues } from "lit"; +import { property, state } from "lit/decorators"; import { computeRTL } from "../../common/util/compute_rtl"; import "../../components/entity/ha-entity-picker"; import "../../components/ha-circular-progress"; diff --git a/src/panels/logbook/ha-logbook.ts b/src/panels/logbook/ha-logbook.ts index f87af09c26..e748085b01 100644 --- a/src/panels/logbook/ha-logbook.ts +++ b/src/panels/logbook/ha-logbook.ts @@ -1,16 +1,14 @@ +import { Layout1d, scroll } from "@lit-labs/virtualizer"; import { css, CSSResultGroup, - customElement, - eventOptions, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { scroll } from "lit-virtualizer"; +} from "lit"; +import { customElement, eventOptions, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { DOMAINS_WITH_DYNAMIC_PICTURE } from "../../common/const"; import { formatDate } from "../../common/datetime/format_date"; import { formatTimeWithSeconds } from "../../common/datetime/format_time"; @@ -22,8 +20,8 @@ import { computeRTL, emitRTLDirection } from "../../common/util/compute_rtl"; import "../../components/entity/state-badge"; import "../../components/ha-circular-progress"; import "../../components/ha-relative-time"; -import { TraceContexts } from "../../data/trace"; import { LogbookEntry } from "../../data/logbook"; +import { TraceContexts } from "../../data/trace"; import { haStyle, haStyleScrollbar } from "../../resources/styles"; import { HomeAssistant } from "../../types"; @@ -101,7 +99,9 @@ class HaLogbook extends LitElement { ${this.virtualize ? scroll({ items: this.entries, - renderItem: (item: LogbookEntry, index?: number) => + layout: Layout1d, + // @ts-expect-error + renderItem: (item: LogbookEntry, index) => this._renderLogbookItem(item, index), }) : this.entries.map((item, index) => @@ -349,7 +349,7 @@ class HaLogbook extends LitElement { color: var(--primary-color); } - .uni-virtualizer-host { + :host([virtualize]) .container { display: block; position: relative; contain: strict; @@ -357,7 +357,7 @@ class HaLogbook extends LitElement { overflow: auto; } - .uni-virtualizer-host > * { + .container > * { box-sizing: border-box; } diff --git a/src/panels/logbook/ha-panel-logbook.ts b/src/panels/logbook/ha-panel-logbook.ts index b08497a2a9..9c93f077ee 100644 --- a/src/panels/logbook/ha-panel-logbook.ts +++ b/src/panels/logbook/ha-panel-logbook.ts @@ -1,15 +1,9 @@ import { mdiRefresh } from "@mdi/js"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; -import { - css, - customElement, - html, - state, - LitElement, - property, - PropertyValues, -} from "lit-element"; +import { css, html, LitElement, PropertyValues } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { isComponentLoaded } from "../../common/config/is_component_loaded"; import { computeRTL } from "../../common/util/compute_rtl"; import "../../components/entity/ha-entity-picker"; import "../../components/ha-circular-progress"; @@ -17,19 +11,18 @@ import "../../components/ha-date-range-picker"; import type { DateRangePickerRanges } from "../../components/ha-date-range-picker"; import "../../components/ha-icon-button"; import "../../components/ha-menu-button"; -import { TraceContexts, loadTraceContexts } from "../../data/trace"; import { clearLogbookCache, getLogbookData, LogbookEntry, } from "../../data/logbook"; import { fetchPersons } from "../../data/person"; +import { loadTraceContexts, TraceContexts } from "../../data/trace"; import { fetchUsers } from "../../data/user"; import "../../layouts/ha-app-layout"; import { haStyle } from "../../resources/styles"; import { HomeAssistant } from "../../types"; import "./ha-logbook"; -import { isComponentLoaded } from "../../common/config/is_component_loaded"; @customElement("ha-panel-logbook") export class HaPanelLogbook extends LitElement { diff --git a/src/panels/lovelace/badges/hui-entity-filter-badge.ts b/src/panels/lovelace/badges/hui-entity-filter-badge.ts index b89135e7e1..a45799695a 100644 --- a/src/panels/lovelace/badges/hui-entity-filter-badge.ts +++ b/src/panels/lovelace/badges/hui-entity-filter-badge.ts @@ -1,4 +1,5 @@ -import { state, property, PropertyValues, ReactiveElement } from "lit-element"; +import { PropertyValues, ReactiveElement } from "lit"; +import { property, state } from "lit/decorators"; import { HomeAssistant } from "../../../types"; import { evaluateFilter } from "../common/evaluate-filter"; import { processConfigEntities } from "../common/process-config-entities"; diff --git a/src/panels/lovelace/badges/hui-error-badge.ts b/src/panels/lovelace/badges/hui-error-badge.ts index e80abd8379..f15a5b0490 100644 --- a/src/panels/lovelace/badges/hui-error-badge.ts +++ b/src/panels/lovelace/badges/hui-error-badge.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, state } from "lit/decorators"; import "../../../components/ha-label-badge"; import { HomeAssistant } from "../../../types"; import { LovelaceBadge } from "../types"; diff --git a/src/panels/lovelace/badges/hui-state-label-badge.ts b/src/panels/lovelace/badges/hui-state-label-badge.ts index d94354c3a2..9ccceba1e8 100644 --- a/src/panels/lovelace/badges/hui-state-label-badge.ts +++ b/src/panels/lovelace/badges/hui-state-label-badge.ts @@ -1,13 +1,6 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; import "../../../components/entity/ha-state-label-badge"; import { ActionHandlerEvent } from "../../../data/lovelace"; import { HomeAssistant } from "../../../types"; diff --git a/src/panels/lovelace/cards/hui-alarm-panel-card.ts b/src/panels/lovelace/cards/hui-alarm-panel-card.ts index 8d20bf51a2..8b29c7f8a6 100644 --- a/src/panels/lovelace/cards/hui-alarm-panel-card.ts +++ b/src/panels/lovelace/cards/hui-alarm-panel-card.ts @@ -3,16 +3,13 @@ import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { fireEvent } from "../../../common/dom/fire_event"; import "../../../components/ha-card"; diff --git a/src/panels/lovelace/cards/hui-button-card.ts b/src/panels/lovelace/cards/hui-button-card.ts index 4f6af27840..931147d268 100644 --- a/src/panels/lovelace/cards/hui-button-card.ts +++ b/src/panels/lovelace/cards/hui-button-card.ts @@ -5,18 +5,20 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, + html, + LitElement, + PropertyValues, + TemplateResult, +} from "lit"; +import { customElement, eventOptions, - html, - state, - LitElement, property, - PropertyValues, queryAsync, - TemplateResult, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; -import { styleMap } from "lit-html/directives/style-map"; + state, +} from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; +import { styleMap } from "lit/directives/style-map"; import { DOMAINS_TOGGLE } from "../../../common/const"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { computeActiveState } from "../../../common/entity/compute_active_state"; diff --git a/src/panels/lovelace/cards/hui-calendar-card.ts b/src/panels/lovelace/cards/hui-calendar-card.ts index 48e31d5f8c..13b5bcc8b3 100644 --- a/src/panels/lovelace/cards/hui-calendar-card.ts +++ b/src/panels/lovelace/cards/hui-calendar-card.ts @@ -1,15 +1,12 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state, query } from "lit/decorators"; import { HA_COLOR_PALETTE } from "../../../common/const"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { HASSDomEvent } from "../../../common/dom/fire_event"; diff --git a/src/panels/lovelace/cards/hui-conditional-card.ts b/src/panels/lovelace/cards/hui-conditional-card.ts index d89e609278..6b0ba014ee 100644 --- a/src/panels/lovelace/cards/hui-conditional-card.ts +++ b/src/panels/lovelace/cards/hui-conditional-card.ts @@ -1,4 +1,4 @@ -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import { LovelaceCardConfig } from "../../../data/lovelace"; import { computeCardSize } from "../common/compute-card-size"; import { HuiConditionalBase } from "../components/hui-conditional-base"; diff --git a/src/panels/lovelace/cards/hui-empty-state-card.ts b/src/panels/lovelace/cards/hui-empty-state-card.ts index b56c23201b..333cad59a4 100644 --- a/src/panels/lovelace/cards/hui-empty-state-card.ts +++ b/src/panels/lovelace/cards/hui-empty-state-card.ts @@ -1,13 +1,6 @@ import "@material/mwc-button/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../components/ha-card"; import { HomeAssistant } from "../../../types"; import { LovelaceCard } from "../types"; diff --git a/src/panels/lovelace/cards/hui-entities-card.ts b/src/panels/lovelace/cards/hui-entities-card.ts index 92d05914d6..a74f934beb 100644 --- a/src/panels/lovelace/cards/hui-entities-card.ts +++ b/src/panels/lovelace/cards/hui-entities-card.ts @@ -1,13 +1,12 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, state } from "lit/decorators"; import { DOMAINS_TOGGLE } from "../../../common/const"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { computeDomain } from "../../../common/entity/compute_domain"; @@ -69,18 +68,18 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard { set hass(hass: HomeAssistant) { this._hass = hass; - this.shadowRoot!.querySelectorAll("#states > div > *").forEach( - (element: unknown) => { + this.shadowRoot + ?.querySelectorAll("#states > div > *") + .forEach((element: unknown) => { (element as LovelaceRow).hass = hass; - } - ); + }); if (this._headerElement) { this._headerElement.hass = hass; } if (this._footerElement) { this._footerElement.hass = hass; } - const entitiesToggle = this.shadowRoot!.querySelector( + const entitiesToggle = this.shadowRoot?.querySelector( "hui-entities-toggle" ); if (entitiesToggle) { diff --git a/src/panels/lovelace/cards/hui-entity-button-card.ts b/src/panels/lovelace/cards/hui-entity-button-card.ts index 0cb0b7eb43..e6b79249ba 100644 --- a/src/panels/lovelace/cards/hui-entity-button-card.ts +++ b/src/panels/lovelace/cards/hui-entity-button-card.ts @@ -1,4 +1,4 @@ -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import { HuiButtonCard } from "./hui-button-card"; @customElement("hui-entity-button-card") diff --git a/src/panels/lovelace/cards/hui-entity-card.ts b/src/panels/lovelace/cards/hui-entity-card.ts index 7bb0479984..fa7d14d970 100644 --- a/src/panels/lovelace/cards/hui-entity-card.ts +++ b/src/panels/lovelace/cards/hui-entity-card.ts @@ -1,14 +1,12 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; diff --git a/src/panels/lovelace/cards/hui-entity-filter-card.ts b/src/panels/lovelace/cards/hui-entity-filter-card.ts index 517b08a13b..ed1db86230 100644 --- a/src/panels/lovelace/cards/hui-entity-filter-card.ts +++ b/src/panels/lovelace/cards/hui-entity-filter-card.ts @@ -1,4 +1,5 @@ -import { state, property, PropertyValues, ReactiveElement } from "lit-element"; +import { PropertyValues, ReactiveElement } from "lit"; +import { property, state } from "lit/decorators"; import { LovelaceCardConfig } from "../../../data/lovelace"; import { HomeAssistant } from "../../../types"; import { computeCardSize } from "../common/compute-card-size"; diff --git a/src/panels/lovelace/cards/hui-error-card.ts b/src/panels/lovelace/cards/hui-error-card.ts index 14f1ceabae..747b700166 100644 --- a/src/panels/lovelace/cards/hui-error-card.ts +++ b/src/panels/lovelace/cards/hui-error-card.ts @@ -1,13 +1,6 @@ import { safeDump } from "js-yaml"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, state } from "lit/decorators"; import { HomeAssistant } from "../../../types"; import { LovelaceCard } from "../types"; import { ErrorCardConfig } from "./types"; diff --git a/src/panels/lovelace/cards/hui-gauge-card.ts b/src/panels/lovelace/cards/hui-gauge-card.ts index 9560e015c3..f87a9081e8 100644 --- a/src/panels/lovelace/cards/hui-gauge-card.ts +++ b/src/panels/lovelace/cards/hui-gauge-card.ts @@ -2,15 +2,13 @@ import { HassEntity } from "home-assistant-js-websocket/dist/types"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { styleMap } from "lit-html/directives/style-map"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { styleMap } from "lit/directives/style-map"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateName } from "../../../common/entity/compute_state_name"; diff --git a/src/panels/lovelace/cards/hui-glance-card.ts b/src/panels/lovelace/cards/hui-glance-card.ts index 88ed26415d..87265c6d81 100644 --- a/src/panels/lovelace/cards/hui-glance-card.ts +++ b/src/panels/lovelace/cards/hui-glance-card.ts @@ -1,16 +1,14 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { ifDefined } from "lit-html/directives/if-defined"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { ifDefined } from "lit/directives/if-defined"; import relativeTime from "../../../common/datetime/relative_time"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { computeDomain } from "../../../common/entity/compute_domain"; diff --git a/src/panels/lovelace/cards/hui-grid-card.ts b/src/panels/lovelace/cards/hui-grid-card.ts index b2033890fd..504d8e1a0c 100644 --- a/src/panels/lovelace/cards/hui-grid-card.ts +++ b/src/panels/lovelace/cards/hui-grid-card.ts @@ -1,8 +1,8 @@ -import { css, CSSResultGroup } from "lit-element"; +import { css, CSSResultGroup } from "lit"; import { computeCardSize } from "../common/compute-card-size"; +import { LovelaceCardEditor } from "../types"; import { HuiStackCard } from "./hui-stack-card"; import { GridCardConfig } from "./types"; -import { LovelaceCardEditor } from "../types"; const DEFAULT_COLUMNS = 3; const SQUARE_ROW_HEIGHTS_BY_COLUMNS = { diff --git a/src/panels/lovelace/cards/hui-history-graph-card.ts b/src/panels/lovelace/cards/hui-history-graph-card.ts index 69b230718f..b17a1ad1e0 100644 --- a/src/panels/lovelace/cards/hui-history-graph-card.ts +++ b/src/panels/lovelace/cards/hui-history-graph-card.ts @@ -1,15 +1,13 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { throttle } from "../../../common/util/throttle"; import "../../../components/ha-card"; import "../../../components/state-history-charts"; diff --git a/src/panels/lovelace/cards/hui-horizontal-stack-card.ts b/src/panels/lovelace/cards/hui-horizontal-stack-card.ts index 6f3b18bb82..349f5867b7 100644 --- a/src/panels/lovelace/cards/hui-horizontal-stack-card.ts +++ b/src/panels/lovelace/cards/hui-horizontal-stack-card.ts @@ -1,4 +1,4 @@ -import { css, CSSResultGroup } from "lit-element"; +import { css, CSSResultGroup } from "lit"; import { computeCardSize } from "../common/compute-card-size"; import { HuiStackCard } from "./hui-stack-card"; diff --git a/src/panels/lovelace/cards/hui-humidifier-card.ts b/src/panels/lovelace/cards/hui-humidifier-card.ts index c6c5651f01..8d514aea5c 100644 --- a/src/panels/lovelace/cards/hui-humidifier-card.ts +++ b/src/panels/lovelace/cards/hui-humidifier-card.ts @@ -3,15 +3,13 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, svg, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateName } from "../../../common/entity/compute_state_name"; diff --git a/src/panels/lovelace/cards/hui-iframe-card.ts b/src/panels/lovelace/cards/hui-iframe-card.ts index fe97a15281..6ac89599a3 100644 --- a/src/panels/lovelace/cards/hui-iframe-card.ts +++ b/src/panels/lovelace/cards/hui-iframe-card.ts @@ -1,13 +1,6 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { styleMap } from "lit-html/directives/style-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import { styleMap } from "lit/directives/style-map"; import parseAspectRatio from "../../../common/util/parse-aspect-ratio"; import "../../../components/ha-card"; import { LovelaceCard, LovelaceCardEditor } from "../types"; diff --git a/src/panels/lovelace/cards/hui-light-card.ts b/src/panels/lovelace/cards/hui-light-card.ts index 9f75785bcc..0cdca46706 100644 --- a/src/panels/lovelace/cards/hui-light-card.ts +++ b/src/panels/lovelace/cards/hui-light-card.ts @@ -3,16 +3,14 @@ import "@thomasloven/round-slider"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { styleMap } from "lit-html/directives/style-map"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { styleMap } from "lit/directives/style-map"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; diff --git a/src/panels/lovelace/cards/hui-logbook-card.ts b/src/panels/lovelace/cards/hui-logbook-card.ts index 077d30bd09..f837b2b694 100644 --- a/src/panels/lovelace/cards/hui-logbook-card.ts +++ b/src/panels/lovelace/cards/hui-logbook-card.ts @@ -1,15 +1,13 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { computeStateDomain } from "../../../common/entity/compute_state_domain"; diff --git a/src/panels/lovelace/cards/hui-map-card.ts b/src/panels/lovelace/cards/hui-map-card.ts index 8f94a5c32a..493ee46823 100644 --- a/src/panels/lovelace/cards/hui-map-card.ts +++ b/src/panels/lovelace/cards/hui-map-card.ts @@ -12,14 +12,13 @@ import { import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { LeafletModuleType, replaceTileLayer, diff --git a/src/panels/lovelace/cards/hui-markdown-card.ts b/src/panels/lovelace/cards/hui-markdown-card.ts index 36b81354ca..242990aa50 100644 --- a/src/panels/lovelace/cards/hui-markdown-card.ts +++ b/src/panels/lovelace/cards/hui-markdown-card.ts @@ -2,15 +2,13 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import "../../../components/ha-card"; import "../../../components/ha-markdown"; diff --git a/src/panels/lovelace/cards/hui-media-control-card.ts b/src/panels/lovelace/cards/hui-media-control-card.ts index ad34cdf56f..571de96287 100644 --- a/src/panels/lovelace/cards/hui-media-control-card.ts +++ b/src/panels/lovelace/cards/hui-media-control-card.ts @@ -5,17 +5,14 @@ import type { PaperProgressElement } from "@polymer/paper-progress/paper-progres import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { styleMap } from "lit-html/directives/style-map"; +} from "lit"; +import { customElement, property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { styleMap } from "lit/directives/style-map"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateName } from "../../../common/entity/compute_state_name"; diff --git a/src/panels/lovelace/cards/hui-picture-card.ts b/src/panels/lovelace/cards/hui-picture-card.ts index 7c7bab7aa7..4983cf736a 100644 --- a/src/panels/lovelace/cards/hui-picture-card.ts +++ b/src/panels/lovelace/cards/hui-picture-card.ts @@ -1,15 +1,14 @@ import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { ifDefined } from "lit-html/directives/if-defined"; +} from "lit"; +import { customElement, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { ifDefined } from "lit/directives/if-defined"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import "../../../components/ha-card"; import { ActionHandlerEvent } from "../../../data/lovelace"; diff --git a/src/panels/lovelace/cards/hui-picture-elements-card.ts b/src/panels/lovelace/cards/hui-picture-elements-card.ts index 3b3cb165df..192569b3a9 100644 --- a/src/panels/lovelace/cards/hui-picture-elements-card.ts +++ b/src/panels/lovelace/cards/hui-picture-elements-card.ts @@ -1,14 +1,12 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import "../../../components/ha-card"; import { HomeAssistant } from "../../../types"; diff --git a/src/panels/lovelace/cards/hui-picture-entity-card.ts b/src/panels/lovelace/cards/hui-picture-entity-card.ts index 92a87b8b6f..2e079a46a9 100644 --- a/src/panels/lovelace/cards/hui-picture-entity-card.ts +++ b/src/panels/lovelace/cards/hui-picture-entity-card.ts @@ -1,16 +1,14 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { ifDefined } from "lit-html/directives/if-defined"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { ifDefined } from "lit/directives/if-defined"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { computeDomain } from "../../../common/entity/compute_domain"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; diff --git a/src/panels/lovelace/cards/hui-picture-glance-card.ts b/src/panels/lovelace/cards/hui-picture-glance-card.ts index d07fc5eebd..e5c7281edd 100644 --- a/src/panels/lovelace/cards/hui-picture-glance-card.ts +++ b/src/panels/lovelace/cards/hui-picture-glance-card.ts @@ -1,16 +1,14 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { ifDefined } from "lit-html/directives/if-defined"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { ifDefined } from "lit/directives/if-defined"; import { DOMAINS_TOGGLE } from "../../../common/const"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { computeDomain } from "../../../common/entity/compute_domain"; diff --git a/src/panels/lovelace/cards/hui-plant-status-card.ts b/src/panels/lovelace/cards/hui-plant-status-card.ts index 7c4bd05bdb..173ee823c7 100644 --- a/src/panels/lovelace/cards/hui-plant-status-card.ts +++ b/src/panels/lovelace/cards/hui-plant-status-card.ts @@ -2,14 +2,12 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeStateName } from "../../../common/entity/compute_state_name"; diff --git a/src/panels/lovelace/cards/hui-safe-mode-card.ts b/src/panels/lovelace/cards/hui-safe-mode-card.ts index fc0b083a08..d9269fce02 100644 --- a/src/panels/lovelace/cards/hui-safe-mode-card.ts +++ b/src/panels/lovelace/cards/hui-safe-mode-card.ts @@ -1,13 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../../components/ha-card"; import { HomeAssistant } from "../../../types"; import "../../config/logs/error-log-card"; diff --git a/src/panels/lovelace/cards/hui-sensor-card.ts b/src/panels/lovelace/cards/hui-sensor-card.ts index b0dfaed69c..b7a44a421c 100644 --- a/src/panels/lovelace/cards/hui-sensor-card.ts +++ b/src/panels/lovelace/cards/hui-sensor-card.ts @@ -1,6 +1,6 @@ import { HassEntity } from "home-assistant-js-websocket/dist/types"; import { computeDomain } from "../../../common/entity/compute_domain"; -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import { HomeAssistant } from "../../../types"; import { findEntities } from "../common/find-entities"; import { GraphHeaderFooterConfig } from "../header-footer/types"; diff --git a/src/panels/lovelace/cards/hui-shopping-list-card.ts b/src/panels/lovelace/cards/hui-shopping-list-card.ts index 9edd46344b..c247a96070 100644 --- a/src/panels/lovelace/cards/hui-shopping-list-card.ts +++ b/src/panels/lovelace/cards/hui-shopping-list-card.ts @@ -5,18 +5,15 @@ import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { guard } from "lit-html/directives/guard"; -import { repeat } from "lit-html/directives/repeat"; +} from "lit"; +import { customElement, property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { guard } from "lit/directives/guard"; +import { repeat } from "lit/directives/repeat"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import "../../../components/ha-card"; import "../../../components/ha-icon"; diff --git a/src/panels/lovelace/cards/hui-stack-card.ts b/src/panels/lovelace/cards/hui-stack-card.ts index 47bbc7933b..615581ef63 100644 --- a/src/panels/lovelace/cards/hui-stack-card.ts +++ b/src/panels/lovelace/cards/hui-stack-card.ts @@ -2,12 +2,11 @@ import { css, CSSResultGroup, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { property, state } from "lit/decorators"; import { LovelaceCardConfig } from "../../../data/lovelace"; import { HomeAssistant } from "../../../types"; import { createCardElement } from "../create-element/create-card-element"; diff --git a/src/panels/lovelace/cards/hui-starting-card.ts b/src/panels/lovelace/cards/hui-starting-card.ts index ad08ee6747..09bdd24079 100644 --- a/src/panels/lovelace/cards/hui-starting-card.ts +++ b/src/panels/lovelace/cards/hui-starting-card.ts @@ -3,13 +3,12 @@ import { STATE_NOT_RUNNING } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import "../../../components/ha-card"; import "../../../components/ha-circular-progress"; diff --git a/src/panels/lovelace/cards/hui-thermostat-card.ts b/src/panels/lovelace/cards/hui-thermostat-card.ts index 30abc46264..d9d09fb32d 100644 --- a/src/panels/lovelace/cards/hui-thermostat-card.ts +++ b/src/panels/lovelace/cards/hui-thermostat-card.ts @@ -4,17 +4,14 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, - query, svg, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { UNIT_F } from "../../../common/const"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { fireEvent } from "../../../common/dom/fire_event"; diff --git a/src/panels/lovelace/cards/hui-vertical-stack-card.ts b/src/panels/lovelace/cards/hui-vertical-stack-card.ts index dbd9ea53ac..e4915feea8 100644 --- a/src/panels/lovelace/cards/hui-vertical-stack-card.ts +++ b/src/panels/lovelace/cards/hui-vertical-stack-card.ts @@ -1,4 +1,4 @@ -import { css, CSSResultGroup } from "lit-element"; +import { css, CSSResultGroup } from "lit"; import { computeCardSize } from "../common/compute-card-size"; import { HuiStackCard } from "./hui-stack-card"; diff --git a/src/panels/lovelace/cards/hui-weather-forecast-card.ts b/src/panels/lovelace/cards/hui-weather-forecast-card.ts index 5a1d7865f9..6a0bc765a4 100644 --- a/src/panels/lovelace/cards/hui-weather-forecast-card.ts +++ b/src/panels/lovelace/cards/hui-weather-forecast-card.ts @@ -1,20 +1,13 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; - -import type { HomeAssistant } from "../../../types"; -import type { LovelaceCard, LovelaceCardEditor } from "../types"; -import type { WeatherForecastCardConfig } from "./types"; - +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; import { formatTime } from "../../../common/datetime/format_time"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { computeStateDisplay } from "../../../common/entity/compute_state_display"; @@ -23,6 +16,8 @@ import { stateIcon } from "../../../common/entity/state_icon"; import { isValidEntityId } from "../../../common/entity/valid_entity_id"; import { formatNumber } from "../../../common/string/format_number"; import { debounce } from "../../../common/util/debounce"; +import "../../../components/ha-card"; +import "../../../components/ha-icon"; import { UNAVAILABLE } from "../../../data/entity"; import { ActionHandlerEvent } from "../../../data/lovelace"; import { @@ -34,6 +29,7 @@ import { WeatherEntity, weatherSVGStyles, } from "../../../data/weather"; +import type { HomeAssistant } from "../../../types"; import { actionHandler } from "../common/directives/action-handler-directive"; import { findEntities } from "../common/find-entities"; import { handleAction } from "../common/handle-action"; @@ -41,9 +37,8 @@ import { hasAction } from "../common/has-action"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import { installResizeObserver } from "../common/install-resize-observer"; import { createEntityNotFoundWarning } from "../components/hui-warning"; - -import "../../../components/ha-card"; -import "../../../components/ha-icon"; +import type { LovelaceCard, LovelaceCardEditor } from "../types"; +import type { WeatherForecastCardConfig } from "./types"; const DAY_IN_MILLISECONDS = 86400000; diff --git a/src/panels/lovelace/common/directives/action-handler-directive.ts b/src/panels/lovelace/common/directives/action-handler-directive.ts index 234471d17e..dac0cfd6a0 100644 --- a/src/panels/lovelace/common/directives/action-handler-directive.ts +++ b/src/panels/lovelace/common/directives/action-handler-directive.ts @@ -1,14 +1,13 @@ /* eslint-disable max-classes-per-file */ import "@material/mwc-ripple"; import type { Ripple } from "@material/mwc-ripple"; -import { noChange } from "lit-html"; +import { noChange } from "lit"; import { AttributePart, directive, Directive, DirectiveParameters, - // eslint-disable-next-line import/extensions -} from "lit-html/directive.js"; +} from "lit/directive"; import { fireEvent } from "../../../../common/dom/fire_event"; import { deepEqual } from "../../../../common/util/deep-equal"; import { diff --git a/src/panels/lovelace/common/has-changed.ts b/src/panels/lovelace/common/has-changed.ts index f054ece6ba..1675f49e20 100644 --- a/src/panels/lovelace/common/has-changed.ts +++ b/src/panels/lovelace/common/has-changed.ts @@ -1,4 +1,4 @@ -import { PropertyValues } from "lit-element"; +import { PropertyValues } from "lit"; import { HomeAssistant } from "../../../types"; import { processConfigEntities } from "./process-config-entities"; diff --git a/src/panels/lovelace/components/hui-action-editor.ts b/src/panels/lovelace/components/hui-action-editor.ts index 60e5af1cda..3bc6853ed2 100644 --- a/src/panels/lovelace/components/hui-action-editor.ts +++ b/src/panels/lovelace/components/hui-action-editor.ts @@ -4,17 +4,12 @@ import "@polymer/paper-input/paper-textarea"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; import type { PaperListboxElement } from "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import memoizeOne from "memoize-one"; import { fireEvent } from "../../../common/dom/fire_event"; import "../../../components/ha-help-tooltip"; +import "../../../components/ha-service-control"; import { ActionConfig, CallServiceActionConfig, @@ -24,8 +19,6 @@ import { import { ServiceAction } from "../../../data/script"; import { HomeAssistant } from "../../../types"; import { EditorTarget } from "../editor/types"; -import "../../../components/ha-service-control"; -import memoizeOne from "memoize-one"; @customElement("hui-action-editor") export class HuiActionEditor extends LitElement { diff --git a/src/panels/lovelace/components/hui-buttons-base.ts b/src/panels/lovelace/components/hui-buttons-base.ts index dce093d045..4c7692adef 100644 --- a/src/panels/lovelace/components/hui-buttons-base.ts +++ b/src/panels/lovelace/components/hui-buttons-base.ts @@ -1,16 +1,7 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - queryAll, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, state, property } from "lit/decorators"; import { computeStateName } from "../../../common/entity/compute_state_name"; import "../../../components/entity/state-badge"; -import type { StateBadge } from "../../../components/entity/state-badge"; import type { ActionHandlerEvent } from "../../../data/lovelace"; import type { HomeAssistant } from "../../../types"; import type { EntitiesCardEntityConfig } from "../cards/types"; @@ -21,27 +12,14 @@ import { hasAction } from "../common/has-action"; @customElement("hui-buttons-base") export class HuiButtonsBase extends LitElement { + @state() public hass!: HomeAssistant; + @property() public configEntities?: EntitiesCardEntityConfig[]; - @queryAll("state-badge") protected _badges!: StateBadge[]; - - private _hass?: HomeAssistant; - - set hass(hass: HomeAssistant) { - this._hass = hass; - const entitiesShowingIcons = this.configEntities?.filter( - (entity) => entity.show_icon !== false - ); - this._badges.forEach((badge, index: number) => { - badge.hass = hass; - badge.stateObj = hass.states[entitiesShowingIcons![index].entity]; - }); - } - - protected render(): TemplateResult | void { + protected render(): TemplateResult { return html` ${(this.configEntities || []).map((entityConf) => { - const stateObj = this._hass!.states[entityConf.entity]; + const stateObj = this.hass.states[entityConf.entity]; return html`
; + style?: Record; } export interface SectionConfig { type: "section"; diff --git a/src/panels/lovelace/ha-panel-lovelace.ts b/src/panels/lovelace/ha-panel-lovelace.ts index 9b5e0b6769..c6e2fe8107 100644 --- a/src/panels/lovelace/ha-panel-lovelace.ts +++ b/src/panels/lovelace/ha-panel-lovelace.ts @@ -1,6 +1,7 @@ import "@material/mwc-button"; import deepFreeze from "deep-freeze"; -import { html, state, LitElement, property, TemplateResult } from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { property, state } from "lit/decorators"; import { constructUrlCurrentPath } from "../../common/url/construct-url"; import { addSearchParam, diff --git a/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts b/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts index 14ca1a81d3..7d47c8645d 100644 --- a/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-buttons-header-footer.ts @@ -1,11 +1,5 @@ -import { - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { HomeAssistant } from "../../../types"; import { processConfigEntities } from "../common/process-config-entities"; import "../components/hui-buttons-base"; diff --git a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts index 918ead0d81..c95646ef64 100644 --- a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts @@ -2,14 +2,12 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../../components/ha-circular-progress"; import { fetchRecent } from "../../../data/history"; import { computeDomain } from "../../../common/entity/compute_domain"; diff --git a/src/panels/lovelace/header-footer/hui-picture-header-footer.ts b/src/panels/lovelace/header-footer/hui-picture-header-footer.ts index 19d01504e4..3dcfd3b0f1 100644 --- a/src/panels/lovelace/header-footer/hui-picture-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-picture-header-footer.ts @@ -1,15 +1,14 @@ import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; -import { ifDefined } from "lit-html/directives/if-defined"; +} from "lit"; +import { customElement, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; +import { ifDefined } from "lit/directives/if-defined"; import "../../../components/ha-card"; import { ActionHandlerEvent } from "../../../data/lovelace"; import { HomeAssistant } from "../../../types"; diff --git a/src/panels/lovelace/hui-editor.ts b/src/panels/lovelace/hui-editor.ts index 1b62dc23ee..7b86d68e43 100644 --- a/src/panels/lovelace/hui-editor.ts +++ b/src/panels/lovelace/hui-editor.ts @@ -6,15 +6,13 @@ import { safeDump, safeLoad } from "js-yaml"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { array, assert, object, optional, string, type } from "superstruct"; import { computeRTL } from "../../common/util/compute_rtl"; import { deepEqual } from "../../common/util/deep-equal"; diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 5afeadc87f..915c344322 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -26,14 +26,12 @@ import { css, CSSResultGroup, html, - state, LitElement, - property, PropertyValues, - query, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { property, state, query } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import memoizeOne from "memoize-one"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; import { fireEvent } from "../../common/dom/fire_event"; diff --git a/src/panels/lovelace/special-rows/hui-attribute-row.ts b/src/panels/lovelace/special-rows/hui-attribute-row.ts index 2f3a317b58..49a5eb3111 100644 --- a/src/panels/lovelace/special-rows/hui-attribute-row.ts +++ b/src/panels/lovelace/special-rows/hui-attribute-row.ts @@ -1,14 +1,12 @@ import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import checkValidDate from "../../../common/datetime/check_valid_date"; import { formatNumber } from "../../../common/string/format_number"; import { HomeAssistant } from "../../../types"; diff --git a/src/panels/lovelace/special-rows/hui-button-row.ts b/src/panels/lovelace/special-rows/hui-button-row.ts index a32c417721..c67887bee2 100644 --- a/src/panels/lovelace/special-rows/hui-button-row.ts +++ b/src/panels/lovelace/special-rows/hui-button-row.ts @@ -1,13 +1,6 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, state } from "lit/decorators"; import { DOMAINS_TOGGLE } from "../../../common/const"; import { computeDomain } from "../../../common/entity/compute_domain"; import { computeStateName } from "../../../common/entity/compute_state_name"; diff --git a/src/panels/lovelace/special-rows/hui-buttons-row.ts b/src/panels/lovelace/special-rows/hui-buttons-row.ts index 23ea52aa56..6dade3a362 100644 --- a/src/panels/lovelace/special-rows/hui-buttons-row.ts +++ b/src/panels/lovelace/special-rows/hui-buttons-row.ts @@ -1,11 +1,5 @@ -import { - customElement, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { DOMAINS_TOGGLE } from "../../../common/const"; import { computeDomain } from "../../../common/entity/compute_domain"; import { HomeAssistant } from "../../../types"; diff --git a/src/panels/lovelace/special-rows/hui-call-service-row.ts b/src/panels/lovelace/special-rows/hui-call-service-row.ts index 1bfed88f0f..5f461d5180 100644 --- a/src/panels/lovelace/special-rows/hui-call-service-row.ts +++ b/src/panels/lovelace/special-rows/hui-call-service-row.ts @@ -1,4 +1,4 @@ -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import { CallServiceConfig } from "../entity-rows/types"; import { HuiButtonRow } from "./hui-button-row"; diff --git a/src/panels/lovelace/special-rows/hui-cast-row.ts b/src/panels/lovelace/special-rows/hui-cast-row.ts index 7021658174..e60e8e74a4 100644 --- a/src/panels/lovelace/special-rows/hui-cast-row.ts +++ b/src/panels/lovelace/special-rows/hui-cast-row.ts @@ -2,15 +2,13 @@ import "@material/mwc-button/mwc-button"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { CastManager } from "../../../cast/cast_manager"; import { castSendShowLovelaceView, diff --git a/src/panels/lovelace/special-rows/hui-conditional-row.ts b/src/panels/lovelace/special-rows/hui-conditional-row.ts index 65b04afdb3..9251a72bd7 100644 --- a/src/panels/lovelace/special-rows/hui-conditional-row.ts +++ b/src/panels/lovelace/special-rows/hui-conditional-row.ts @@ -1,4 +1,4 @@ -import { customElement } from "lit-element"; +import { customElement } from "lit/decorators"; import { HuiConditionalBase } from "../components/hui-conditional-base"; import { createRowElement } from "../create-element/create-row-element"; import { ConditionalRowConfig, LovelaceRow } from "../entity-rows/types"; diff --git a/src/panels/lovelace/special-rows/hui-divider-row.ts b/src/panels/lovelace/special-rows/hui-divider-row.ts index 3763f21257..7f7bc8f1ba 100644 --- a/src/panels/lovelace/special-rows/hui-divider-row.ts +++ b/src/panels/lovelace/special-rows/hui-divider-row.ts @@ -1,13 +1,6 @@ -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - TemplateResult, -} from "lit-element"; -import { styleMap } from "lit-html/directives/style-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, state } from "lit/decorators"; +import { styleMap } from "lit/directives/style-map"; import { HomeAssistant } from "../../../types"; import { DividerConfig, LovelaceRow } from "../entity-rows/types"; @@ -30,7 +23,9 @@ class HuiDividerRow extends LitElement implements LovelaceRow { return html``; } - return html`
`; + return html`
`; } static get styles(): CSSResultGroup { diff --git a/src/panels/lovelace/special-rows/hui-section-row.ts b/src/panels/lovelace/special-rows/hui-section-row.ts index 045256a6ab..619d7a070b 100644 --- a/src/panels/lovelace/special-rows/hui-section-row.ts +++ b/src/panels/lovelace/special-rows/hui-section-row.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, state } from "lit/decorators"; import "../../../components/ha-icon"; import { HomeAssistant } from "../../../types"; import { LovelaceRow, SectionConfig } from "../entity-rows/types"; diff --git a/src/panels/lovelace/special-rows/hui-text-row.ts b/src/panels/lovelace/special-rows/hui-text-row.ts index 1e43ab303d..a88c68a732 100644 --- a/src/panels/lovelace/special-rows/hui-text-row.ts +++ b/src/panels/lovelace/special-rows/hui-text-row.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, state } from "lit/decorators"; import "../../../components/ha-icon"; import { LovelaceRow, TextConfig } from "../entity-rows/types"; diff --git a/src/panels/lovelace/special-rows/hui-weblink-row.ts b/src/panels/lovelace/special-rows/hui-weblink-row.ts index d475d8c4e5..9fe2a9aeed 100644 --- a/src/panels/lovelace/special-rows/hui-weblink-row.ts +++ b/src/panels/lovelace/special-rows/hui-weblink-row.ts @@ -1,13 +1,6 @@ -import { - css, - CSSResultGroup, - customElement, - html, - state, - LitElement, - TemplateResult, -} from "lit-element"; -import { ifDefined } from "lit-html/directives/if-defined"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, state } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; import "../../../components/ha-icon"; import { HomeAssistant } from "../../../types"; import { LovelaceRow, WeblinkConfig } from "../entity-rows/types"; diff --git a/src/panels/lovelace/strategies/original-states-strategy.ts b/src/panels/lovelace/strategies/original-states-strategy.ts index 8ecdd922d1..0aaef9fcf5 100644 --- a/src/panels/lovelace/strategies/original-states-strategy.ts +++ b/src/panels/lovelace/strategies/original-states-strategy.ts @@ -5,8 +5,8 @@ import { subscribeDeviceRegistry } from "../../../data/device_registry"; import { subscribeEntityRegistry } from "../../../data/entity_registry"; import { generateDefaultViewConfig } from "../common/generate-lovelace-config"; import { - LovelaceViewStrategy, LovelaceDashboardStrategy, + LovelaceViewStrategy, } from "./get-strategy"; let subscribedRegistries = false; diff --git a/src/panels/lovelace/views/hui-masonry-view.ts b/src/panels/lovelace/views/hui-masonry-view.ts index b99f4d9b16..8b260c9aa9 100644 --- a/src/panels/lovelace/views/hui-masonry-view.ts +++ b/src/panels/lovelace/views/hui-masonry-view.ts @@ -3,13 +3,12 @@ import { css, CSSResultGroup, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { fireEvent } from "../../../common/dom/fire_event"; import { computeRTL } from "../../../common/util/compute_rtl"; import { nextRender } from "../../../common/util/render-status"; diff --git a/src/panels/lovelace/views/hui-panel-view.ts b/src/panels/lovelace/views/hui-panel-view.ts index 450e54c353..1c7d531377 100644 --- a/src/panels/lovelace/views/hui-panel-view.ts +++ b/src/panels/lovelace/views/hui-panel-view.ts @@ -3,13 +3,12 @@ import { css, CSSResultGroup, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +} from "lit"; +import { property, state } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { computeRTL } from "../../../common/util/compute_rtl"; import type { LovelaceViewConfig, diff --git a/src/panels/lovelace/views/hui-view.ts b/src/panels/lovelace/views/hui-view.ts index ca81631685..5f815f25a3 100644 --- a/src/panels/lovelace/views/hui-view.ts +++ b/src/panels/lovelace/views/hui-view.ts @@ -1,10 +1,5 @@ -import { - customElement, - state, - property, - PropertyValues, - ReactiveElement, -} from "lit-element"; +import { PropertyValues, ReactiveElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import "../../../components/entity/ha-state-label-badge"; import "../../../components/ha-svg-icon"; diff --git a/src/panels/media-browser/ha-panel-media-browser.ts b/src/panels/media-browser/ha-panel-media-browser.ts index 10d51ee00b..ebf1bfe90c 100644 --- a/src/panels/media-browser/ha-panel-media-browser.ts +++ b/src/panels/media-browser/ha-panel-media-browser.ts @@ -1,15 +1,8 @@ import "@material/mwc-icon-button"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { LocalStorage } from "../../common/decorators/local-storage"; import { HASSDomEvent } from "../../common/dom/fire_event"; import { computeStateDomain } from "../../common/entity/compute_state_domain"; diff --git a/src/panels/media-browser/hui-dialog-select-media-player.ts b/src/panels/media-browser/hui-dialog-select-media-player.ts index 5d587206d1..42c094c286 100644 --- a/src/panels/media-browser/hui-dialog-select-media-player.ts +++ b/src/panels/media-browser/hui-dialog-select-media-player.ts @@ -2,15 +2,8 @@ import "@material/mwc-list/mwc-list"; import "@material/mwc-list/mwc-list-item"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { computeStateName } from "../../common/entity/compute_state_name"; import { compare } from "../../common/string/compare"; diff --git a/src/panels/media-browser/hui-dialog-web-browser-play-media.ts b/src/panels/media-browser/hui-dialog-web-browser-play-media.ts index df945275ad..18af9e77d7 100644 --- a/src/panels/media-browser/hui-dialog-web-browser-play-media.ts +++ b/src/panels/media-browser/hui-dialog-web-browser-play-media.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import { createCloseHeading } from "../../components/ha-dialog"; import "../../components/ha-hls-player"; diff --git a/src/panels/my/ha-panel-my.ts b/src/panels/my/ha-panel-my.ts index f64c58fd7b..f052a10d42 100644 --- a/src/panels/my/ha-panel-my.ts +++ b/src/panels/my/ha-panel-my.ts @@ -1,14 +1,15 @@ -import { customElement, html, state, LitElement, property } from "lit-element"; import { sanitizeUrl } from "@braintree/sanitize-url"; +import { html, LitElement } from "lit"; +import { customElement, property, state } from "lit/decorators"; +import { isComponentLoaded } from "../../common/config/is_component_loaded"; import { navigate } from "../../common/navigate"; -import { HomeAssistant, Route } from "../../types"; import { createSearchParam, extractSearchParamsObject, } from "../../common/url/search-params"; -import "../../layouts/hass-error-screen"; -import { isComponentLoaded } from "../../common/config/is_component_loaded"; import { domainToName } from "../../data/integration"; +import "../../layouts/hass-error-screen"; +import { HomeAssistant, Route } from "../../types"; import { documentationUrl } from "../../util/documentation-url"; const REDIRECTS: Redirects = { diff --git a/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts b/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts index cde705949c..1dac65496a 100644 --- a/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts +++ b/src/panels/profile/dialog-ha-mfa-module-setup-flow.ts @@ -1,14 +1,8 @@ import "@material/mwc-button"; -import { - css, - CSSResultGroup, - customElement, - state, - LitElement, - property, -} from "lit-element"; -import { html, TemplateResult } from "lit-html"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../components/ha-circular-progress"; +import "../../components/ha-dialog"; import "../../components/ha-form/ha-form"; import "../../components/ha-markdown"; import { @@ -17,7 +11,6 @@ import { } from "../../data/data_entry_flow"; import { haStyleDialog } from "../../resources/styles"; import { HomeAssistant } from "../../types"; -import "../../components/ha-dialog"; let instance = 0; diff --git a/src/panels/profile/ha-advanced-mode-row.ts b/src/panels/profile/ha-advanced-mode-row.ts index 67fabfa082..ce0c9ec50f 100644 --- a/src/panels/profile/ha-advanced-mode-row.ts +++ b/src/panels/profile/ha-advanced-mode-row.ts @@ -1,12 +1,5 @@ -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import "../../components/ha-card"; import "../../components/ha-settings-row"; import "../../components/ha-switch"; diff --git a/src/panels/profile/ha-change-password-card.ts b/src/panels/profile/ha-change-password-card.ts index 775b59f1ba..6b06b70365 100644 --- a/src/panels/profile/ha-change-password-card.ts +++ b/src/panels/profile/ha-change-password-card.ts @@ -4,14 +4,12 @@ import "@polymer/paper-input/paper-input"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../components/ha-card"; import "../../components/ha-circular-progress"; import { haStyle } from "../../resources/styles"; diff --git a/src/panels/profile/ha-enable-shortcuts-row.ts b/src/panels/profile/ha-enable-shortcuts-row.ts index cdec57a03b..429c439c69 100644 --- a/src/panels/profile/ha-enable-shortcuts-row.ts +++ b/src/panels/profile/ha-enable-shortcuts-row.ts @@ -1,10 +1,5 @@ -import { - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-settings-row"; import "../../components/ha-switch"; diff --git a/src/panels/profile/ha-force-narrow-row.ts b/src/panels/profile/ha-force-narrow-row.ts index 49d70ef57f..771f49c7d9 100644 --- a/src/panels/profile/ha-force-narrow-row.ts +++ b/src/panels/profile/ha-force-narrow-row.ts @@ -1,10 +1,5 @@ -import { - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-settings-row"; import "../../components/ha-switch"; diff --git a/src/panels/profile/ha-long-lived-access-tokens-card.ts b/src/panels/profile/ha-long-lived-access-tokens-card.ts index 2468c84724..789a79b206 100644 --- a/src/panels/profile/ha-long-lived-access-tokens-card.ts +++ b/src/panels/profile/ha-long-lived-access-tokens-card.ts @@ -1,15 +1,8 @@ import "@material/mwc-button/mwc-button"; import "@material/mwc-icon-button/mwc-icon-button"; import { mdiDelete } from "@mdi/js"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import relativeTime from "../../common/datetime/relative_time"; import { fireEvent } from "../../common/dom/fire_event"; diff --git a/src/panels/profile/ha-mfa-modules-card.ts b/src/panels/profile/ha-mfa-modules-card.ts index 5ccef7f050..620f1f5ed1 100644 --- a/src/panels/profile/ha-mfa-modules-card.ts +++ b/src/panels/profile/ha-mfa-modules-card.ts @@ -1,15 +1,8 @@ import "@material/mwc-button"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-card"; import { showConfirmationDialog } from "../../dialogs/generic/show-dialog-box"; diff --git a/src/panels/profile/ha-panel-profile.ts b/src/panels/profile/ha-panel-profile.ts index 7890a7bbc9..7484c4ba3b 100644 --- a/src/panels/profile/ha-panel-profile.ts +++ b/src/panels/profile/ha-panel-profile.ts @@ -4,15 +4,8 @@ import "@polymer/app-layout/app-toolbar/app-toolbar"; import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item-body"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - html, - state, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { property, state } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-card"; import "../../components/ha-menu-button"; diff --git a/src/panels/profile/ha-pick-dashboard-row.ts b/src/panels/profile/ha-pick-dashboard-row.ts index da2c83622d..482ce1969b 100644 --- a/src/panels/profile/ha-pick-dashboard-row.ts +++ b/src/panels/profile/ha-pick-dashboard-row.ts @@ -1,14 +1,7 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - customElement, - html, - state, - LitElement, - property, - PropertyValues, - TemplateResult, -} from "lit-element"; +import { html, LitElement, PropertyValues, TemplateResult } from "lit"; +import { customElement, property, state } from "lit/decorators"; import "../../components/ha-paper-dropdown-menu"; import "../../components/ha-settings-row"; import { fetchDashboards, LovelaceDashboard } from "../../data/lovelace"; diff --git a/src/panels/profile/ha-pick-number-format-row.ts b/src/panels/profile/ha-pick-number-format-row.ts index 07dd738231..fa6b0f8e6f 100644 --- a/src/panels/profile/ha-pick-number-format-row.ts +++ b/src/panels/profile/ha-pick-number-format-row.ts @@ -1,19 +1,14 @@ import "@polymer/paper-item/paper-item"; import "@polymer/paper-listbox/paper-listbox"; -import { - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import { fireEvent } from "../../common/dom/fire_event"; +import { formatNumber } from "../../common/string/format_number"; import "../../components/ha-card"; import "../../components/ha-paper-dropdown-menu"; -import { HomeAssistant } from "../../types"; import "../../components/ha-settings-row"; -import { formatNumber } from "../../common/string/format_number"; import { NumberFormat } from "../../data/translation"; -import { fireEvent } from "../../common/dom/fire_event"; +import { HomeAssistant } from "../../types"; @customElement("ha-pick-number-format-row") class NumberFormatRow extends LitElement { diff --git a/src/panels/profile/ha-pick-theme-row.ts b/src/panels/profile/ha-pick-theme-row.ts index 9ba8ee47d8..57dde1cf9f 100644 --- a/src/panels/profile/ha-pick-theme-row.ts +++ b/src/panels/profile/ha-pick-theme-row.ts @@ -5,13 +5,12 @@ import "@polymer/paper-listbox/paper-listbox"; import { css, CSSResultGroup, - customElement, - state, + html, LitElement, - property, PropertyValues, -} from "lit-element"; -import { html, TemplateResult } from "lit-html"; + TemplateResult, +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-formfield"; import "../../components/ha-paper-dropdown-menu"; diff --git a/src/panels/profile/ha-refresh-tokens-card.ts b/src/panels/profile/ha-refresh-tokens-card.ts index 738bb5760b..7c75b3f15b 100644 --- a/src/panels/profile/ha-refresh-tokens-card.ts +++ b/src/panels/profile/ha-refresh-tokens-card.ts @@ -1,15 +1,8 @@ import "@material/mwc-icon-button/mwc-icon-button"; import { mdiDelete } from "@mdi/js"; import "@polymer/paper-tooltip/paper-tooltip"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; import relativeTime from "../../common/datetime/relative_time"; import { fireEvent } from "../../common/dom/fire_event"; diff --git a/src/panels/profile/ha-set-suspend-row.ts b/src/panels/profile/ha-set-suspend-row.ts index 9874590295..47a4d7f431 100644 --- a/src/panels/profile/ha-set-suspend-row.ts +++ b/src/panels/profile/ha-set-suspend-row.ts @@ -1,10 +1,5 @@ -import { - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent, HASSDomEvent } from "../../common/dom/fire_event"; import "../../components/ha-settings-row"; import "../../components/ha-switch"; diff --git a/src/panels/profile/ha-set-vibrate-row.ts b/src/panels/profile/ha-set-vibrate-row.ts index d0e7701dfb..184b9b096f 100644 --- a/src/panels/profile/ha-set-vibrate-row.ts +++ b/src/panels/profile/ha-set-vibrate-row.ts @@ -1,10 +1,5 @@ -import { - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-settings-row"; import "../../components/ha-switch"; diff --git a/src/panels/shopping-list/ha-panel-shopping-list.ts b/src/panels/shopping-list/ha-panel-shopping-list.ts index 99779d0cba..f46d52dcd2 100644 --- a/src/panels/shopping-list/ha-panel-shopping-list.ts +++ b/src/panels/shopping-list/ha-panel-shopping-list.ts @@ -4,14 +4,12 @@ import "@polymer/app-layout/app-toolbar/app-toolbar"; import { css, CSSResultGroup, - customElement, html, - state, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { isComponentLoaded } from "../../common/config/is_component_loaded"; import "../../components/ha-menu-button"; diff --git a/src/resources/codemirror.ts b/src/resources/codemirror.ts index 0c52dd5446..b487cc5a31 100644 --- a/src/resources/codemirror.ts +++ b/src/resources/codemirror.ts @@ -1,24 +1,24 @@ +import { indentLess, indentMore } from "@codemirror/commands"; import { HighlightStyle, tags } from "@codemirror/highlight"; -import { EditorView, KeyBinding } from "@codemirror/view"; -import { StreamLanguage } from "@codemirror/stream-parser"; import { jinja2 } from "@codemirror/legacy-modes/mode/jinja2"; import { yaml } from "@codemirror/legacy-modes/mode/yaml"; -import { indentLess, indentMore } from "@codemirror/commands"; import { Compartment } from "@codemirror/state"; +import { StreamLanguage } from "@codemirror/stream-parser"; +import { EditorView, KeyBinding } from "@codemirror/view"; -export { - keymap, - highlightActiveLine, - drawSelection, - EditorView, -} from "@codemirror/view"; -export { EditorState, Prec } from "@codemirror/state"; export { defaultKeymap } from "@codemirror/commands"; export { lineNumbers } from "@codemirror/gutter"; -export { searchKeymap, highlightSelectionMatches } from "@codemirror/search"; +export { HighlightStyle, tags } from "@codemirror/highlight"; export { history, historyKeymap } from "@codemirror/history"; export { rectangularSelection } from "@codemirror/rectangular-selection"; -export { HighlightStyle, tags } from "@codemirror/highlight"; +export { highlightSelectionMatches, searchKeymap } from "@codemirror/search"; +export { EditorState, Prec } from "@codemirror/state"; +export { + drawSelection, + EditorView, + highlightActiveLine, + keymap, +} from "@codemirror/view"; export const langs = { jinja2: StreamLanguage.define(jinja2), diff --git a/src/resources/compatibility.ts b/src/resources/compatibility.ts index 8cec919666..85726354bc 100644 --- a/src/resources/compatibility.ts +++ b/src/resources/compatibility.ts @@ -1,5 +1,6 @@ // For localize import "@formatjs/intl-getcanonicallocales/polyfill"; +import "@lit/polyfill-support"; import "core-js"; // To use comlink under ES5 import "proxy-polyfill"; diff --git a/src/resources/custom-card-support.ts b/src/resources/custom-card-support.ts index 2e33e53552..dbf420cd7d 100644 --- a/src/resources/custom-card-support.ts +++ b/src/resources/custom-card-support.ts @@ -1,4 +1,4 @@ -import { css, html, LitElement } from "lit-element"; +import { css, html, LitElement } from "lit"; (LitElement.prototype as any).html = html; (LitElement.prototype as any).css = css; diff --git a/src/resources/ha-sortable-style.ts b/src/resources/ha-sortable-style.ts index 5979f986e2..8c7a5ded7c 100644 --- a/src/resources/ha-sortable-style.ts +++ b/src/resources/ha-sortable-style.ts @@ -1,4 +1,4 @@ -import { css } from "lit-element"; +import { css } from "lit"; export const sortableStyles = css` #sortable a:nth-of-type(2n) paper-icon-item { diff --git a/src/resources/styles.ts b/src/resources/styles.ts index 6be57cf1f2..54e298f1c2 100644 --- a/src/resources/styles.ts +++ b/src/resources/styles.ts @@ -1,4 +1,4 @@ -import { css } from "lit-element"; +import { css } from "lit"; export const darkStyles = { "primary-background-color": "#111111", diff --git a/src/state-summary/state-card-display.ts b/src/state-summary/state-card-display.ts index aec040baf9..4e434fbf8a 100755 --- a/src/state-summary/state-card-display.ts +++ b/src/state-summary/state-card-display.ts @@ -1,15 +1,8 @@ import "@polymer/iron-flex-layout/iron-flex-layout-classes"; import type { HassEntity } from "home-assistant-js-websocket"; -import { - css, - CSSResultGroup, - customElement, - html, - LitElement, - property, - TemplateResult, -} from "lit-element"; -import { classMap } from "lit-html/directives/class-map"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import { classMap } from "lit/directives/class-map"; import { computeDomain } from "../common/entity/compute_domain"; import { computeStateDisplay } from "../common/entity/compute_state_display"; import { computeRTL } from "../common/util/compute_rtl"; diff --git a/src/state-summary/state-card-input_select.ts b/src/state-summary/state-card-input_select.ts index 1c45e41b57..854b9c1280 100644 --- a/src/state-summary/state-card-input_select.ts +++ b/src/state-summary/state-card-input_select.ts @@ -5,13 +5,12 @@ import "@polymer/paper-listbox/paper-listbox"; import { css, CSSResultGroup, - customElement, html, LitElement, - property, PropertyValues, TemplateResult, -} from "lit-element"; +} from "lit"; +import { customElement, property } from "lit/decorators"; import { stopPropagation } from "../common/dom/stop_propagation"; import { computeStateName } from "../common/entity/compute_state_name"; import "../components/entity/state-badge"; diff --git a/src/state-summary/state-card-script.ts b/src/state-summary/state-card-script.ts index 579036e07e..52eed9f297 100644 --- a/src/state-summary/state-card-script.ts +++ b/src/state-summary/state-card-script.ts @@ -1,12 +1,7 @@ import "@material/mwc-button"; import { HassEntity } from "home-assistant-js-websocket"; -import { - customElement, - LitElement, - property, - CSSResultGroup, -} from "lit-element"; -import { html } from "lit-html"; +import { CSSResultGroup, html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; import "../components/entity/ha-entity-toggle"; import "../components/entity/state-info"; import { UNAVAILABLE_STATES } from "../data/entity"; diff --git a/src/state/connection-mixin.ts b/src/state/connection-mixin.ts index cda1c797ec..86ea836210 100644 --- a/src/state/connection-mixin.ts +++ b/src/state/connection-mixin.ts @@ -2,8 +2,8 @@ import { Auth, callService, Connection, - ERR_INVALID_AUTH, ERR_CONNECTION_LOST, + ERR_INVALID_AUTH, HassConfig, subscribeConfig, subscribeEntities, diff --git a/src/state/dialog-manager-mixin.ts b/src/state/dialog-manager-mixin.ts index acb0c7c5e3..0575afa493 100644 --- a/src/state/dialog-manager-mixin.ts +++ b/src/state/dialog-manager-mixin.ts @@ -1,4 +1,4 @@ -import { PropertyValues } from "lit-element"; +import { PropertyValues } from "lit"; import { HASSDomEvent } from "../common/dom/fire_event"; import { makeDialogManager, showDialog } from "../dialogs/make-dialog-manager"; import { Constructor } from "../types"; diff --git a/src/state/disconnect-toast-mixin.ts b/src/state/disconnect-toast-mixin.ts index 98e36dea7a..9b60b20e39 100644 --- a/src/state/disconnect-toast-mixin.ts +++ b/src/state/disconnect-toast-mixin.ts @@ -4,14 +4,14 @@ import { STATE_STARTING, UnsubscribeFunc, } from "home-assistant-js-websocket"; +import { + BootstrapIntegrationsTimings, + subscribeBootstrapIntegrations, +} from "../data/bootstrap_integrations"; +import { domainToName } from "../data/integration"; import { Constructor } from "../types"; import { showToast } from "../util/toast"; import { HassBaseEl } from "./hass-base-mixin"; -import { domainToName } from "../data/integration"; -import { - subscribeBootstrapIntegrations, - BootstrapIntegrationsTimings, -} from "../data/bootstrap_integrations"; export default >(superClass: T) => class extends superClass { diff --git a/src/state/haptic-mixin.ts b/src/state/haptic-mixin.ts index 6a4483c3bb..a4a46ceb35 100644 --- a/src/state/haptic-mixin.ts +++ b/src/state/haptic-mixin.ts @@ -1,4 +1,4 @@ -import { PropertyValues } from "lit-element"; +import { PropertyValues } from "lit"; import { HASSDomEvent } from "../common/dom/fire_event"; import { HapticType } from "../data/haptics"; import { Constructor, HomeAssistant } from "../types"; diff --git a/src/state/hass-base-mixin.ts b/src/state/hass-base-mixin.ts index 1d9b09d4ee..27a19e9865 100644 --- a/src/state/hass-base-mixin.ts +++ b/src/state/hass-base-mixin.ts @@ -1,7 +1,12 @@ import { Auth, Connection } from "home-assistant-js-websocket"; -import { LitElement, property } from "lit-element"; +import { LitElement } from "lit"; +import { property } from "lit/decorators"; import { HomeAssistant } from "../types"; +// Temporary disable warnings so the dev console is not flooded, we should fix these and then re-enable the warning +if (__DEV__) { + LitElement.disableWarning?.("change-in-update"); +} export class HassBaseEl extends LitElement { @property({ attribute: false }) public hass?: HomeAssistant; diff --git a/src/state/more-info-mixin.ts b/src/state/more-info-mixin.ts index dd0cf17c0c..620b8b027f 100644 --- a/src/state/more-info-mixin.ts +++ b/src/state/more-info-mixin.ts @@ -1,4 +1,4 @@ -import type { PropertyValues } from "lit-element"; +import type { PropertyValues } from "lit"; import type { HASSDomEvent } from "../common/dom/fire_event"; import { showDialog } from "../dialogs/make-dialog-manager"; import type { MoreInfoDialogParams } from "../dialogs/more-info/ha-more-info-dialog"; diff --git a/src/state/quick-bar-mixin.ts b/src/state/quick-bar-mixin.ts index 7431a1e9f8..445a9e3ee5 100644 --- a/src/state/quick-bar-mixin.ts +++ b/src/state/quick-bar-mixin.ts @@ -1,4 +1,4 @@ -import type { PropertyValues } from "lit-element"; +import type { PropertyValues } from "lit"; import tinykeys from "tinykeys"; import { QuickBarParams, diff --git a/src/state/translations-mixin.ts b/src/state/translations-mixin.ts index 6c5bf64302..f22d4149c1 100644 --- a/src/state/translations-mixin.ts +++ b/src/state/translations-mixin.ts @@ -13,8 +13,8 @@ import { translationMetadata } from "../resources/translations-metadata"; import { Constructor, HomeAssistant } from "../types"; import { storeState } from "../util/ha-pref-storage"; import { - getTranslation, getLocalLanguage, + getTranslation, getUserLocale, } from "../util/hass-translation"; import { HassBaseEl } from "./hass-base-mixin"; diff --git a/src/state/url-sync-mixin.ts b/src/state/url-sync-mixin.ts index b6ae356ac3..7597004b53 100644 --- a/src/state/url-sync-mixin.ts +++ b/src/state/url-sync-mixin.ts @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import { ReactiveElement } from "lit-element"; +import { ReactiveElement } from "lit"; import { HASSDomEvent } from "../common/dom/fire_event"; import { closeDialog, diff --git a/src/styles/polymer-ha-style-dialog.ts b/src/styles/polymer-ha-style-dialog.ts index 22e239b470..68193fc45a 100644 --- a/src/styles/polymer-ha-style-dialog.ts +++ b/src/styles/polymer-ha-style-dialog.ts @@ -1,5 +1,5 @@ import "@polymer/polymer/lib/elements/dom-module"; -import { CSSResult } from "lit-element"; +import { CSSResult } from "lit"; import { haStyleDialog } from "../resources/styles"; const documentContainer = document.createElement("template"); diff --git a/src/styles/polymer-ha-style.ts b/src/styles/polymer-ha-style.ts index ea6c98d829..e3afebd8fa 100644 --- a/src/styles/polymer-ha-style.ts +++ b/src/styles/polymer-ha-style.ts @@ -1,5 +1,5 @@ import "@polymer/polymer/lib/elements/dom-module"; -import { CSSResult } from "lit-element"; +import { CSSResult } from "lit"; import { haStyle } from "../resources/styles"; const documentContainer = document.createElement("template"); diff --git a/src/types.ts b/src/types.ts index 7c6d699ce1..102cdd31c1 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3,8 +3,8 @@ import { Connection, HassConfig, HassEntities, - HassServiceTarget, HassServices, + HassServiceTarget, MessageBase, } from "home-assistant-js-websocket"; import { LocalizeFunc } from "./common/translations/localize"; diff --git a/yarn.lock b/yarn.lock index 9dfc4c1569..870d8430ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1347,551 +1347,592 @@ dependencies: vary "^1.1.2" -"@material/animation@9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/animation/-/animation-9.0.0-canary.1c156d69d.0.tgz#53acc1253d1286f6d4cfaf3a778229cbd19ab000" - integrity sha512-m3eUpFRwxcP1tEWJlIH5q77YGSYEe5ITRw5OtyDvxU7ZzF0xKJbBeauQEdCmyig9UvK+J7jUUnCgkT/t/ldLtw== +"@lit-labs/virtualizer@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@lit-labs/virtualizer/-/virtualizer-0.6.0.tgz#7b556652d4484f2f28d1d7d9ce6aa0fa882e73bc" + integrity sha512-nuwePG9b0TRXmkeL2WQpMxukw9CwlHi33n+s9xW7wfOIl7xcRE6Q+7ygeA/nScFypm1RhumI+SbZVLVTADY2Zg== dependencies: - tslib "^1.9.3" + event-target-shim "^5.0.1" + lit "^2.0.0-rc.1" + tslib "^1.10.0" -"@material/base@9.0.0-canary.1c156d69d.0", "@material/base@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/base/-/base-9.0.0-canary.1c156d69d.0.tgz#84f365077dfae12a31a32bfc7f9ba673fe56b2db" - integrity sha512-r98qY6EsPx6BlzT0Pj+H+BTI7r76GEX/zZPgajxZjbPAJSeeK+uCh69Dmhf63meLKaFkKgvLwH5udKJLMqqjpQ== +"@lit/reactive-element@^1.0.0-rc.2": + version "1.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.0.0-rc.2.tgz#f24dba16ea571a08dca70f1783bd2ca5ec8de3ee" + integrity sha512-cujeIl5Ei8FC7UHf4/4Q3bRJOtdTe1vpJV/JEBYCggedmQ+2P8A2oz7eE+Vxi6OJ4nc0X+KZxXnBoH4QrEbmEQ== + +"@material/animation@12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/animation/-/animation-12.0.0-canary.1a8d06483.0.tgz#a3d5a6ebf8965c0e3a52da1c3bf86ff2677f9c31" + integrity sha512-aUiyCKXnXjq6WWOnc5Jh7jWe5hwnG8uKDScq0BKvNOANmGA5ZJnD4F52fmY1bdZmzbGpmPPu9p6WulaLtYfjIQ== dependencies: - tslib "^1.9.3" + tslib "^2.1.0" -"@material/button@9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/button/-/button-9.0.0-canary.1c156d69d.0.tgz#b35540ed085006d65562ed56fe2b5540d6712712" - integrity sha512-ZjBDrGy2kKPmlIYaL99/C1D0t+MCIkP3Pcj9Y1RxxYdayvP+o8evkBUz5IRtg5NpW4o1X89x8RfF/JmLJZrdYw== +"@material/base@12.0.0-canary.1a8d06483.0", "@material/base@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/base/-/base-12.0.0-canary.1a8d06483.0.tgz#7644e4638301b6dd8f70160a5dfdf3339b2d0e4c" + integrity sha512-mqAV6ZlVyLstS6XcaOUBtY36SnHk8x+HPqJsc/EWkowfQfmjbVnjgjQ3Ld5jAS5BdC1kETmqSKxm0hHxlZd5UQ== dependencies: - "@material/density" "9.0.0-canary.1c156d69d.0" - "@material/elevation" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/ripple" "9.0.0-canary.1c156d69d.0" - "@material/rtl" "9.0.0-canary.1c156d69d.0" - "@material/shape" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - "@material/touch-target" "9.0.0-canary.1c156d69d.0" - "@material/typography" "9.0.0-canary.1c156d69d.0" + tslib "^2.1.0" -"@material/checkbox@9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/checkbox/-/checkbox-9.0.0-canary.1c156d69d.0.tgz#7534284e59af51217e3653ce8d7105dbd001d55f" - integrity sha512-7Fyjh3avQg+EZx6wVIB3K4b/9rs7rYTZIXVYM4iAVJo/LDtdBrdmLy6sRmk90gnO7+V5eTvSBJy7R+dU3l/xNQ== +"@material/button@12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/button/-/button-12.0.0-canary.1a8d06483.0.tgz#8dd20ae410c8f3064511c5ffd2efbd433539ec73" + integrity sha512-AxPbx9PCYX1Lbez1gsS1P6Ucbmc3UgEHgbNB8kxrksK1Y+vRD1nFXqxGQ67bNCY1c9gTKuMVM84b8OTccRZg2w== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/density" "9.0.0-canary.1c156d69d.0" - "@material/dom" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/ripple" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - "@material/touch-target" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/density" "12.0.0-canary.1a8d06483.0" + "@material/dom" "12.0.0-canary.1a8d06483.0" + "@material/elevation" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/shape" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + "@material/touch-target" "12.0.0-canary.1a8d06483.0" + "@material/typography" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/chips@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/chips/-/chips-9.0.0-canary.1c156d69d.0.tgz#8f6819c42743a8f4dd9be5155556f0c9eb2d30f7" - integrity sha512-DuWDauRhrlj/nMI/NNUqVD+SUnVsuuZNSvf9t9AX3H08Uo3ZUHhNfdc7Ust0B+jHCaHsjLjlREyYagp8JxJuXQ== +"@material/checkbox@12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/checkbox/-/checkbox-12.0.0-canary.1a8d06483.0.tgz#3b5fbaa01743387fcbd135f2bd322324c0613bd7" + integrity sha512-j6N1dsVIKqNuXliUuDM/06hdqVOF90Kc6W93nERM0gp5FP0Wx66IuOS6RZV4+RiITTy1AtmTR5HmKIYSq4uPhg== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/checkbox" "9.0.0-canary.1c156d69d.0" - "@material/density" "9.0.0-canary.1c156d69d.0" - "@material/dom" "9.0.0-canary.1c156d69d.0" - "@material/elevation" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/ripple" "9.0.0-canary.1c156d69d.0" - "@material/rtl" "9.0.0-canary.1c156d69d.0" - "@material/shape" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - "@material/touch-target" "9.0.0-canary.1c156d69d.0" - "@material/typography" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/density" "12.0.0-canary.1a8d06483.0" + "@material/dom" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + "@material/touch-target" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/circular-progress@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/circular-progress/-/circular-progress-9.0.0-canary.1c156d69d.0.tgz#df6a6b13cbe65e6e90e81ce0149d472a3de2463c" - integrity sha512-DCYOF9ssHb+psiKA98GZFztYFr48dvEhvS8w0Lu/hx+7G4qlG6KJzFZv1mBuiF0pdJCT1tjEDjOcj6t3nU9SRA== +"@material/chips@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/chips/-/chips-12.0.0-canary.1a8d06483.0.tgz#0827604c15a6ef0d49ab7765b9e0c0a1679c160b" + integrity sha512-STRAaLD5OFKOYehb97wWurNMuj9nDyt/kdFjOqeBZk2b7fXYaG7bV1hMydR+LO0W6znOhubX2Zt6inNZvI56XQ== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/progress-indicator" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/checkbox" "12.0.0-canary.1a8d06483.0" + "@material/density" "12.0.0-canary.1a8d06483.0" + "@material/dom" "12.0.0-canary.1a8d06483.0" + "@material/elevation" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/shape" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + "@material/touch-target" "12.0.0-canary.1a8d06483.0" + "@material/typography" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/density@9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/density/-/density-9.0.0-canary.1c156d69d.0.tgz#ca2a2a5f4ea31520d717a41a6343c104acee3005" - integrity sha512-Y87bUpTsXNDOi1q5NVRBxIyTUAFda1PP1Z9HOvgpV19n7/F6YLrttLGcOFSRFfx9btUKf4EddctBzwzBrF71TQ== - -"@material/dialog@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/dialog/-/dialog-9.0.0-canary.1c156d69d.0.tgz#15a0c38d322679f3fcf372eabd21a9c70061f788" - integrity sha512-JadtYwhCPrvZce/0j+kUuSq5+QaXAbZ1yx2FPT01K6/mzEgM0eDuU7ta7IlGGoJXFzmQI8jy7WsTSuW+IBNC8A== +"@material/circular-progress@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/circular-progress/-/circular-progress-12.0.0-canary.1a8d06483.0.tgz#ff87ecf784cc6ac316c6fb560a34e7cafef32d3a" + integrity sha512-+mfVC9zK5BRbEOIn0qzXF7yZiTBLf7jiXJb6ufyyBJR9RDu5RAzvbj2Dj2GDfq46Y+eM7cO3aHjJ77i4eJ6haQ== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/button" "9.0.0-canary.1c156d69d.0" - "@material/dom" "9.0.0-canary.1c156d69d.0" - "@material/elevation" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/ripple" "9.0.0-canary.1c156d69d.0" - "@material/rtl" "9.0.0-canary.1c156d69d.0" - "@material/shape" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - "@material/touch-target" "9.0.0-canary.1c156d69d.0" - "@material/typography" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/progress-indicator" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/dom@9.0.0-canary.1c156d69d.0", "@material/dom@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/dom/-/dom-9.0.0-canary.1c156d69d.0.tgz#ffba86848f77cdce5ac2cfe494a97cb82af5c714" - integrity sha512-AwiQDzquolB7rqy8k4+QMVQ8Njb6k0CT+otJ/UNJbj0qNVXZB4njVaWRWrWCt70hYp1rG0cRNkZ01ZJDqABUFw== +"@material/density@12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/density/-/density-12.0.0-canary.1a8d06483.0.tgz#0f6ccaa15b8efcab1c5eef51ab9cc2c304ff2f9c" + integrity sha512-Tq5MX//GECdL2EnqRFJkIVPJjHD7u6XUCPhH5n50GKo3fZAwU+dksZoncqZPdG/4vxZ4aqTTQT9VXmk0QDEo5Q== dependencies: - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + tslib "^2.1.0" -"@material/elevation@9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/elevation/-/elevation-9.0.0-canary.1c156d69d.0.tgz#0027434eef691dde7e16e672e1349ee1e9ed7a2b" - integrity sha512-ojX0+nRNkfJssFA/EXhwglDwW48xll1OPCVy8jJrRfvIasRHiIJBeRdnlU5BL4qxDJHaEoOfEMmVQP/Aj504Qw== +"@material/dialog@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/dialog/-/dialog-12.0.0-canary.1a8d06483.0.tgz#ef0fdcaf8909b015971c92181c294caa443cffc6" + integrity sha512-TXUjnOhHeVBsNsavSQDVG9bfNj/wzqfn2WpIljDgyKRQd1JPh75AgnZleiOFeVvvOKsNcV3bB+ESwaqgV9Nd1w== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/button" "12.0.0-canary.1a8d06483.0" + "@material/dom" "12.0.0-canary.1a8d06483.0" + "@material/elevation" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/icon-button" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/shape" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + "@material/touch-target" "12.0.0-canary.1a8d06483.0" + "@material/typography" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/feature-targeting@9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/feature-targeting/-/feature-targeting-9.0.0-canary.1c156d69d.0.tgz#feaf37af156811a088958e653e6c08e66f567d2a" - integrity sha512-HWd0+GMnkVB3anmUc9+MeWCNoogAbb4U7ihzwq7lzLCQyC+i/kunppkUVV7DhL3ZVl1O6zIw1eAT+dgQpN8x4Q== - -"@material/form-field@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/form-field/-/form-field-9.0.0-canary.1c156d69d.0.tgz#2f44c9704c8a4aef54376819573f835983686e89" - integrity sha512-v1KWGRj4Qf9SESLswtlrdm/B6TmNkQsh5CZSM2xL2ZXe/k/KNgbLgM4ofHJApwW3QWYVBfA8nT/MlIvJJivd9w== +"@material/dom@12.0.0-canary.1a8d06483.0", "@material/dom@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/dom/-/dom-12.0.0-canary.1a8d06483.0.tgz#6ce068b0bcc20d605256d6316b9ed36e6130f729" + integrity sha512-x1+6b2vwCcJbjLddsGefhZNzdvDoyFmrbjSxljnzk+qdeRrM6gXioLfBjxJKT8/olge+XnZukNH8JfiRCVSCGA== dependencies: - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/ripple" "9.0.0-canary.1c156d69d.0" - "@material/rtl" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - "@material/typography" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/list@9.0.0-canary.1c156d69d.0", "@material/list@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/list/-/list-9.0.0-canary.1c156d69d.0.tgz#d4a7b1354e4d00a843de19f3dbde188ca2e1e429" - integrity sha512-cn9zTm38RgriNudHnQAlEyLJOIfE11rTYl5mnBMkLaGz1gRLH+QVN8Q8FBpMwagS0cU0CkMTwrADJaUlmJeuVQ== +"@material/elevation@12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/elevation/-/elevation-12.0.0-canary.1a8d06483.0.tgz#f6e24d5573b16160f3f694a1d80ca945e5ee707a" + integrity sha512-0MaBjiEwZsFnVfDVUqdVl3eVRGlJcBJK/Qm495ITwMg4Z8pCM6S+p8km8PidGvSTy0RAUpR/51x1CI2sgl7Fqw== dependencies: - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/density" "9.0.0-canary.1c156d69d.0" - "@material/dom" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/ripple" "9.0.0-canary.1c156d69d.0" - "@material/rtl" "9.0.0-canary.1c156d69d.0" - "@material/shape" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - "@material/typography" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/menu-surface@9.0.0-canary.1c156d69d.0", "@material/menu-surface@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/menu-surface/-/menu-surface-9.0.0-canary.1c156d69d.0.tgz#6200a17a4895d99f604f96d87b65243ae3b98d5e" - integrity sha512-/ePz8oZm+XLsGypnXJ1ATK4Vtei4KgHh9MFJHhOvmAbd6gPX6I8LnWlUA3cQ2/AX0bDeLNM7mXUkJ1d2flHdNQ== +"@material/feature-targeting@12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/feature-targeting/-/feature-targeting-12.0.0-canary.1a8d06483.0.tgz#b5191c4c813a87207ffeebca6edb9c50fc71f5b3" + integrity sha512-CXlHPZ+ArtVpFitBMtvpphGHWesL2n3NuE14e6vBW12N+3kj58BYCUZHLF3/tB1qJlezYEvEs/W2/YpOx8qMMA== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/elevation" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/rtl" "9.0.0-canary.1c156d69d.0" - "@material/shape" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + tslib "^2.1.0" -"@material/menu@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/menu/-/menu-9.0.0-canary.1c156d69d.0.tgz#641c020acaa1a92a254f8366e6a5762137483757" - integrity sha512-opUKKT40E3aDY9wMUIKQtUoxB2gD6Ry633vb2sOHHkf7YA7Ad/F8HnByhLqeq7tB2Gg1N0PKfSGOk/OMjJ1l9w== +"@material/form-field@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/form-field/-/form-field-12.0.0-canary.1a8d06483.0.tgz#393d41ae0a3dbe1780c28c7a2af3791317e189fe" + integrity sha512-5OUWpLKAeBK17wsdCN3vAxefXsshuLqXbocvf+FzUwyMWzStRhXyjjR1PxuBLuBBof6JvabLGpQgpuaYFju2EQ== dependencies: - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/dom" "9.0.0-canary.1c156d69d.0" - "@material/elevation" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/list" "9.0.0-canary.1c156d69d.0" - "@material/menu-surface" "9.0.0-canary.1c156d69d.0" - "@material/ripple" "9.0.0-canary.1c156d69d.0" - "@material/rtl" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + "@material/typography" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/mwc-base@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-base/-/mwc-base-0.20.0.tgz#9753d357ea3fb9010985487a4d582bf273de1aaf" - integrity sha512-q35jN1TGBts3LzKk2RVtgBpLDfBfRrx2hJ4GEVAeJsEGiO5CZrCD0bPlZSRTammzQBbDAh7szvhMiWo0TkRaWw== +"@material/icon-button@12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/icon-button/-/icon-button-12.0.0-canary.1a8d06483.0.tgz#bf15f01c994e906bdafb8656c1629b3d71e1c393" + integrity sha512-m7WHl4cZHf/oCoQ+Uwu8rzd/Ni712GN6PXN670SQ/1dOSeoK+1H8/J09bWG/OccsYbBAopGRdWBRcgvf4rkC3Q== dependencies: - "@material/base" "=9.0.0-canary.1c156d69d.0" - "@material/dom" "=9.0.0-canary.1c156d69d.0" - lit-element "^2.3.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/density" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" + +"@material/list@12.0.0-canary.1a8d06483.0", "@material/list@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/list/-/list-12.0.0-canary.1a8d06483.0.tgz#6ba66e3e0f23dd0b3146090e3ba58a69f835d917" + integrity sha512-gt76+G2+kKpmtuY5lImZESZts65eGPmYkjDQsE7x/GsX/eEd9F5k3VqeDQwsp2HyywMoAi6CD9EHN3Hw+ays+g== + dependencies: + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/density" "12.0.0-canary.1a8d06483.0" + "@material/dom" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/shape" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + "@material/typography" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" + +"@material/menu-surface@12.0.0-canary.1a8d06483.0", "@material/menu-surface@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/menu-surface/-/menu-surface-12.0.0-canary.1a8d06483.0.tgz#fd940d4f1007ceff5b829c1f2fbdf21f8c88de43" + integrity sha512-vWCkbuNRjNE8FfK8wdFUW61PnURCtEnpceMd+XiAKorUJaqaPSG2uU9Uu6Y823dVEotxmhZaW25oFIPGobM4Cw== + dependencies: + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/elevation" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/shape" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" + +"@material/menu@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/menu/-/menu-12.0.0-canary.1a8d06483.0.tgz#81f6050fa95c138a6454b84d5ff7a5c38d1fe4c3" + integrity sha512-DhUNwiEtPyhvVTW6zpcWsupiLKq/Qi+RDJJP+B79ZY40/p3BoWjDymULOtYGndDYduR5lJ6ScJ5MMT666nelQQ== + dependencies: + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/dom" "12.0.0-canary.1a8d06483.0" + "@material/elevation" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/list" "12.0.0-canary.1a8d06483.0" + "@material/menu-surface" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" + +"@material/mwc-base@0.22.0-canary.cc04657a.0": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-base/-/mwc-base-0.22.0-canary.cc04657a.0.tgz#9d619b66f0f0b91976215249866ea5a880371a33" + integrity sha512-O3BrWp7cfsRgBKIcWt+WRlnG7x4dRP5v+zhiRPdxZV3EHtHfQTO3yiXnhkW+F3BHN4UMOHYeshXHg0CbJ3O6jA== + dependencies: + "@material/base" "=12.0.0-canary.1a8d06483.0" + "@material/dom" "=12.0.0-canary.1a8d06483.0" + lit-element "^2.5.0" tslib "^2.0.1" -"@material/mwc-button@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-button/-/mwc-button-0.20.0.tgz#2942edb504f4cee4d8f55b667b8538f27084b772" - integrity sha512-kqQpeuLfaqfH4PZbENT9rwx1sgeFPLHuKy5M31ZeKG1deRTxw11FDGeMxSkePfm1QFfY6DNTsIAG5qC56tUNlw== +"@material/mwc-button@0.22.0-canary.cc04657a.0", "@material/mwc-button@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-button/-/mwc-button-0.22.0-canary.cc04657a.0.tgz#9640668b340197325ecc493ddc861bc215c117a3" + integrity sha512-xM6VorfSUgYDFFHYr5GfzHFbqcgz0j3TE6xR6dXkJQTqQPFameOYFBKn7TKu2j5674+OY4QHeyhw8/fYaWeP0A== dependencies: - "@material/mwc-icon" "^0.20.0" - "@material/mwc-ripple" "^0.20.0" - lit-element "^2.3.0" - lit-html "^1.1.2" + "@material/mwc-icon" "0.22.0-canary.cc04657a.0" + "@material/mwc-ripple" "0.22.0-canary.cc04657a.0" + lit-element "^2.5.0" + lit-html "^1.4.0" tslib "^2.0.1" -"@material/mwc-checkbox@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-checkbox/-/mwc-checkbox-0.20.0.tgz#fff9d41cd8a72b39a3c883d1b01230e1a3e462fd" - integrity sha512-e7qRFpoTZPeBTU05M/FvGnAalY9fJXtzTIfFXWevpm5xm21zr+5lw4QqJOzN8l8Sj8CwciTZ86GMfKGViBbyuw== +"@material/mwc-checkbox@0.22.0-canary.cc04657a.0", "@material/mwc-checkbox@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-checkbox/-/mwc-checkbox-0.22.0-canary.cc04657a.0.tgz#ebfd10c06120de3fbdcf05751757ca621ce9035c" + integrity sha512-m/BSKMecOmZ8xG2g7P0bHZ5mlMBNkXxcmw68FOv3qZZufEkLMEic07zxbHNePcmDhjildwMWzTLfWHgCdTQ0hQ== dependencies: - "@material/mwc-base" "^0.20.0" - "@material/mwc-ripple" "^0.20.0" - lit-element "^2.3.0" - lit-html "^1.1.2" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/mwc-ripple" "0.22.0-canary.cc04657a.0" + lit-element "^2.5.0" + lit-html "^1.4.0" tslib "^2.0.1" -"@material/mwc-circular-progress@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-circular-progress/-/mwc-circular-progress-0.20.0.tgz#db27d4862be4afa3b68f4d9bd06533171869ce37" - integrity sha512-6GyI97rZOGajjFB9L8R+44myv3YMo3zEHrlco5j1WnMPIPNHUcYww8EJgtkcl1E/q04Xpwvt6fFPv9X4vmLBnQ== +"@material/mwc-circular-progress@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-circular-progress/-/mwc-circular-progress-0.22.0-canary.cc04657a.0.tgz#d5873e347979b2279f66826cca167ed3ac147f96" + integrity sha512-hBD2EZhiolkD3m7xaSK7ml+qomX+FCg78RbV1BArrEnLk21ui46NsmtvBBJ1UiZUGs1FvRUcVNyMjSRTByxeDA== dependencies: - "@material/circular-progress" "=9.0.0-canary.1c156d69d.0" - "@material/mwc-base" "^0.20.0" - "@material/theme" "=9.0.0-canary.1c156d69d.0" - lit-element "^2.3.0" - lit-html "^1.1.2" + "@material/circular-progress" "=12.0.0-canary.1a8d06483.0" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/theme" "=12.0.0-canary.1a8d06483.0" + lit-element "^2.5.0" + lit-html "^1.4.0" tslib "^2.0.1" -"@material/mwc-dialog@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-dialog/-/mwc-dialog-0.20.0.tgz#3169f71a049c61cfd53d16b761b8313645bdba01" - integrity sha512-7VG8M0p2xaqs+gFDQLNQiVSKJNe+j8jemYX94wxRMZaMRryX09uPrOkn1CGUAuAy0fivxVLhlFG6KINbGR/Avg== +"@material/mwc-dialog@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-dialog/-/mwc-dialog-0.22.0-canary.cc04657a.0.tgz#d817a733149893cb4c0d1d1ea563e7c65d360af1" + integrity sha512-qcMVcrJxEzgswiP34WPPtR484d2G7YfViVxVUrmAupsIlKqCLn7jYf6OlE/NmX0d65XIdo+WQEt1Qprui6wQiA== dependencies: - "@material/dialog" "=9.0.0-canary.1c156d69d.0" - "@material/dom" "=9.0.0-canary.1c156d69d.0" - "@material/mwc-base" "^0.20.0" - "@material/mwc-button" "^0.20.0" + "@material/dialog" "=12.0.0-canary.1a8d06483.0" + "@material/dom" "=12.0.0-canary.1a8d06483.0" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/mwc-button" "0.22.0-canary.cc04657a.0" blocking-elements "^0.1.0" - lit-element "^2.3.0" - lit-html "^1.1.2" + lit-element "^2.5.0" + lit-html "^1.4.0" tslib "^2.0.1" wicg-inert "^3.0.0" -"@material/mwc-fab@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-fab/-/mwc-fab-0.20.0.tgz#bcd77bd9a6e06855b174944f0267e2b5512fab45" - integrity sha512-lxPlber5SxRAzH063IFTQhUj7YRuoi5juvYsSWHDLZUqj7wBTV+m6wX9a14wltcCumMNL80k2lXs9FLUOnZz9Q== +"@material/mwc-fab@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-fab/-/mwc-fab-0.22.0-canary.cc04657a.0.tgz#a3307c19a5c432c20da1029451a4dc97a219aa46" + integrity sha512-VR1xGp+VaIcysklG6jXP2rky3iTTbI06AvWa3KYevlpwm/sfnY5N4onUpeckAzIVvKUKM9JO/Yx+snJCUCAY5w== dependencies: - "@material/mwc-ripple" "^0.20.0" - lit-element "^2.3.0" - lit-html "^1.1.2" + "@material/mwc-ripple" "0.22.0-canary.cc04657a.0" + lit-element "^2.5.0" + lit-html "^1.4.0" tslib "^2.0.1" -"@material/mwc-formfield@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-formfield/-/mwc-formfield-0.20.0.tgz#dd3e25778aad624a0d13f5b8a33c95bf1aa3883f" - integrity sha512-Rrk2ah5gNHD4O/yYWdwHvH3kGddaZXbdiZPCTpYDlTHG63CMUsAENJy8Fu8ZCC23nxbWfBeejtbB/Da+0VZWig== +"@material/mwc-formfield@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-formfield/-/mwc-formfield-0.22.0-canary.cc04657a.0.tgz#3e5803793e19c047ac0ec71061069c1f4b593dd0" + integrity sha512-eVajWwlwSC0ySDYU3btu41agtDQlotuaa6LYR0ZamNa1CMcu8QFq3ZyLaQqqS66/FsJJ4W+72+MpkUnAthj55A== dependencies: - "@material/form-field" "=9.0.0-canary.1c156d69d.0" - "@material/mwc-base" "^0.20.0" - lit-element "^2.3.0" - lit-html "^1.1.2" + "@material/form-field" "=12.0.0-canary.1a8d06483.0" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + lit-element "^2.5.0" + lit-html "^1.4.0" tslib "^2.0.1" -"@material/mwc-icon-button@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-icon-button/-/mwc-icon-button-0.20.0.tgz#1a2d22f5d351b6a61f0dd41cb516a6fe21b6bcc5" - integrity sha512-Bwm399++ZAo4HKmvLwRqSQ8Prhq6fxKwBcNFcqRIYMwwOf/iuuq4/hSX8+Wm8XtdX+mxSQfS7GePqn8XOTTKvw== +"@material/mwc-icon-button@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-icon-button/-/mwc-icon-button-0.22.0-canary.cc04657a.0.tgz#79171babfbfde7fd98e2d9fbe66af40fdeeadf80" + integrity sha512-GzWXtjTterfWKAjs+qRyPP0RIWHt34FJkMoMjD0YuoVzbKeTFURwo9QBduVUU36ERe73sssnxtBk+5pQ7GWGjA== dependencies: - "@material/mwc-ripple" "^0.20.0" - lit-element "^2.3.0" + "@material/mwc-ripple" "0.22.0-canary.cc04657a.0" + lit-element "^2.5.0" tslib "^2.0.1" -"@material/mwc-icon@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-icon/-/mwc-icon-0.20.0.tgz#c2c42bca9145d4a75f63b4ce1567270b41986b47" - integrity sha512-YCtzWbJVSZGcvWKVHwIhwfGMLEqAmRSVGcXTCAH/rOzGU7RkOxQkfNDkLAuTRAX9a7HYQStIJ39ENVcysElljg== +"@material/mwc-icon@0.22.0-canary.cc04657a.0": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-icon/-/mwc-icon-0.22.0-canary.cc04657a.0.tgz#d2a9a597a7e1cb894cf85af44298aa44507649e2" + integrity sha512-ArXclZOwcf4UfI2OSQjFNjzp59uRFLD6KDYJuGqrvPneeh4ekS6GVwOrJkI1CVe2ddv9MKWeTdXR6WY2TYk+Uw== dependencies: - lit-element "^2.3.0" + lit-element "^2.5.0" tslib "^2.0.1" -"@material/mwc-list@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-list/-/mwc-list-0.20.0.tgz#44b0bcd3653b46c7493614741fc7a11cee8abca4" - integrity sha512-RLHn4k6oH2jsSorALbQJ3Ak0BwTyaTeKpXgjI65dHuMRhQaQUaMapJzfh5ghKPhjg1R5D+2r5wktjciFoZ9KVw== +"@material/mwc-list@0.22.0-canary.cc04657a.0", "@material/mwc-list@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-list/-/mwc-list-0.22.0-canary.cc04657a.0.tgz#490ac8b1aebf57f937122bd9e55bc406c4ef793f" + integrity sha512-yA0b38mTEh75+W3LxeSJe97/Yu9bZAXX9783v8lhbwlAbp/IZPcLr0FkSfUt4BM4TIuEU9Sb6E8L8YpCqM6NSA== dependencies: - "@material/base" "=9.0.0-canary.1c156d69d.0" - "@material/dom" "=9.0.0-canary.1c156d69d.0" - "@material/list" "=9.0.0-canary.1c156d69d.0" - "@material/mwc-base" "^0.20.0" - "@material/mwc-checkbox" "^0.20.0" - "@material/mwc-radio" "^0.20.0" - "@material/mwc-ripple" "^0.20.0" - lit-element "^2.3.0" - lit-html "^1.1.2" + "@material/base" "=12.0.0-canary.1a8d06483.0" + "@material/dom" "=12.0.0-canary.1a8d06483.0" + "@material/list" "=12.0.0-canary.1a8d06483.0" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/mwc-checkbox" "0.22.0-canary.cc04657a.0" + "@material/mwc-radio" "0.22.0-canary.cc04657a.0" + "@material/mwc-ripple" "0.22.0-canary.cc04657a.0" + lit-element "^2.5.0" + lit-html "^1.4.0" tslib "^2.0.1" -"@material/mwc-menu@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-menu/-/mwc-menu-0.20.0.tgz#672d6a4b40975b8101029be3b526aa014a252957" - integrity sha512-slSY3LORaP8MniXoNvvulvptQ3Ohjit13xiFWVWRr63H3YxnNdBqWW6BICASNJWNV/5y8UM1CE2Xw99UEnG9JQ== +"@material/mwc-menu@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-menu/-/mwc-menu-0.22.0-canary.cc04657a.0.tgz#61aa5d70af6509958aff9b583c5d86a048d23af2" + integrity sha512-unXilkODM05Q4Dhmw54OItlRO1A+k8STuWnDSpM7nti1r5uh25BfJ64qs70OBMn4FM9fZGbOAvX1GfW5o/nYrA== dependencies: - "@material/menu" "=9.0.0-canary.1c156d69d.0" - "@material/menu-surface" "=9.0.0-canary.1c156d69d.0" - "@material/mwc-base" "^0.20.0" - "@material/mwc-list" "^0.20.0" - "@material/shape" "=9.0.0-canary.1c156d69d.0" - "@material/theme" "=9.0.0-canary.1c156d69d.0" - lit-element "^2.3.0" - lit-html "^1.1.2" + "@material/menu" "=12.0.0-canary.1a8d06483.0" + "@material/menu-surface" "=12.0.0-canary.1a8d06483.0" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/mwc-list" "0.22.0-canary.cc04657a.0" + "@material/shape" "=12.0.0-canary.1a8d06483.0" + "@material/theme" "=12.0.0-canary.1a8d06483.0" + lit-element "^2.5.0" + lit-html "^1.4.0" tslib "^2.0.1" -"@material/mwc-radio@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-radio/-/mwc-radio-0.20.0.tgz#bf282fe5bd3f0f8e6c3eeb0b781eea6bc06f1743" - integrity sha512-aVsok8EZJQFHn5VW9iP4gxO1wY5XeNnANdP82GhHZfIcxp1AQDORuUSy6Qoj2YBmCFCnG4BGAac1zs4OXRPRqA== +"@material/mwc-radio@0.22.0-canary.cc04657a.0", "@material/mwc-radio@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-radio/-/mwc-radio-0.22.0-canary.cc04657a.0.tgz#3cf7ea09b4c6bfb8cb654c39c1fadd288235ca91" + integrity sha512-NDCBflXsqbL8vZKce1BPlDJgjcC/XD+ZlmtSY2liZgvZ6fPUGxtii/YGQRrrmZvIKDc+JJG0rhzZOty5XHQy+A== dependencies: - "@material/mwc-base" "^0.20.0" - "@material/mwc-ripple" "^0.20.0" - "@material/radio" "=9.0.0-canary.1c156d69d.0" - lit-element "^2.3.0" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/mwc-ripple" "0.22.0-canary.cc04657a.0" + "@material/radio" "=12.0.0-canary.1a8d06483.0" + lit-element "^2.5.0" tslib "^2.0.1" -"@material/mwc-ripple@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-ripple/-/mwc-ripple-0.20.0.tgz#ac83eda314b712c2fba293d2732f550dd1c6023b" - integrity sha512-4rlIu+Kk//NsW/u3CnU1kz3dsvwEozax0Zf2CUp+ao0ozclHfQ2+sTZVY0Mr8+GJLn7Oz51gT5OHoarZuWWljA== +"@material/mwc-ripple@0.22.0-canary.cc04657a.0", "@material/mwc-ripple@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-ripple/-/mwc-ripple-0.22.0-canary.cc04657a.0.tgz#bd22e2babe11aeffe7a611eadf7d354597c18eae" + integrity sha512-mjXSH7OA7iBe6e6ssenInTav9gTGx0lK0hrJfi92ku3YYoSgw8ULK8TiL/7YmGGH7UN67Emv4fdGPhwfiMfYbg== dependencies: - "@material/dom" "=9.0.0-canary.1c156d69d.0" - "@material/mwc-base" "^0.20.0" - "@material/ripple" "=9.0.0-canary.1c156d69d.0" - lit-element "^2.3.0" - lit-html "^1.1.2" + "@material/dom" "=12.0.0-canary.1a8d06483.0" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/ripple" "=12.0.0-canary.1a8d06483.0" + lit-element "^2.5.0" + lit-html "^1.4.0" tslib "^2.0.1" -"@material/mwc-switch@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-switch/-/mwc-switch-0.20.0.tgz#e4b3c3f512e7c2c497f07828795aa543320e81f9" - integrity sha512-1++EESLaVGdRQTpm0t5Z5Il/3IZTSaMzBYb/21AVM2SkNqWG5/2ycd+cj4BhfViIBjPXi0Ajcz4nhxHE/6SRjw== +"@material/mwc-switch@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-switch/-/mwc-switch-0.22.0-canary.cc04657a.0.tgz#44ccbb37946ec2884692b6fff8ef3beab854d07a" + integrity sha512-dP4dqqIYULckm7UDynVS5E62nZt28Ae622AGneiHtRc1ob9IVtGRkpTVNoz5QyKvrLyF4XKAsKoOwAm6x66nkg== dependencies: - "@material/mwc-base" "^0.20.0" - "@material/mwc-ripple" "^0.20.0" - "@material/switch" "=9.0.0-canary.1c156d69d.0" - lit-element "^2.3.0" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/mwc-ripple" "0.22.0-canary.cc04657a.0" + "@material/switch" "=12.0.0-canary.1a8d06483.0" + lit-element "^2.5.0" tslib "^2.0.1" -"@material/mwc-tab-bar@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-tab-bar/-/mwc-tab-bar-0.20.0.tgz#02cecdc1bdf20feeb85085c8138d0f6d933411b2" - integrity sha512-7iGFzVsS33m5uZXxeXMK1ag3u1drRbBcfkXbP8mp0rpIrhZNpCAOZkTpyXtZGx7WAijaCXPdKOo3MkHutqn6Rg== +"@material/mwc-tab-bar@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-tab-bar/-/mwc-tab-bar-0.22.0-canary.cc04657a.0.tgz#5590d3a3e820b4a7a4dc134d44790735cd375884" + integrity sha512-p0T+65FmD2EdMN4L0MStjd1jXSLjq5/w0wQ08WiO2Q7EWgh2iuABxwLLzhL4hMLWKzDXqmzy1rKI2QyiTRIW8A== dependencies: - "@material/mwc-base" "^0.20.0" - "@material/mwc-tab" "^0.20.0" - "@material/mwc-tab-scroller" "^0.20.0" - "@material/tab" "=9.0.0-canary.1c156d69d.0" - "@material/tab-bar" "=9.0.0-canary.1c156d69d.0" - lit-element "^2.3.0" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/mwc-tab" "0.22.0-canary.cc04657a.0" + "@material/mwc-tab-scroller" "0.22.0-canary.cc04657a.0" + "@material/tab" "=12.0.0-canary.1a8d06483.0" + "@material/tab-bar" "=12.0.0-canary.1a8d06483.0" + lit-element "^2.5.0" tslib "^2.0.1" -"@material/mwc-tab-indicator@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-tab-indicator/-/mwc-tab-indicator-0.20.0.tgz#a25e981517d46689aae5214798cbc083780569e3" - integrity sha512-Y98B1MKeBX2zHwQ4yqpQKULvrm2GaLmw6yUqxiwUoE8CJQv/8wOTJHjtvYXgazYs/VZ2bOD1NoOhtntZwMpn/w== +"@material/mwc-tab-indicator@0.22.0-canary.cc04657a.0": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-tab-indicator/-/mwc-tab-indicator-0.22.0-canary.cc04657a.0.tgz#9a3228248f27ba71f6007a4b9a109c3302cd2017" + integrity sha512-HEFb1H9CsxGhWM57Z6MJaAaMLgKdorl8Dvjfj/hDRPaqiQAncKU2SSzRPqGSgnwqIqPQZVZrHte8+0vpnQgv5w== dependencies: - "@material/mwc-base" "^0.20.0" - "@material/tab-indicator" "=9.0.0-canary.1c156d69d.0" - lit-element "^2.3.0" - lit-html "^1.1.2" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/tab-indicator" "=12.0.0-canary.1a8d06483.0" + lit-element "^2.5.0" + lit-html "^1.4.0" tslib "^2.0.1" -"@material/mwc-tab-scroller@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-tab-scroller/-/mwc-tab-scroller-0.20.0.tgz#5f4ed139a322eef1047a03c3f79aa5df78f7b04e" - integrity sha512-Q6Gh+xdiTuXtOBJEUz6YBEHakDAdrsiqGJV1x90Oj5PtbSvkEU8dc/QiJBFsCesxK3vssWKLGqeo1GvQSJW0LQ== +"@material/mwc-tab-scroller@0.22.0-canary.cc04657a.0": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-tab-scroller/-/mwc-tab-scroller-0.22.0-canary.cc04657a.0.tgz#2b2d80ef5d66872888259341f9bd76ca341b9725" + integrity sha512-LOBQdbr+7Ooi4cDGIq9SwmL/ynQ08Xrvp7F81uWvHLMKi5lOz30Jp6nBlBO/+cE3GkLXGfRhwRJTBBEaoQhy1g== dependencies: - "@material/dom" "=9.0.0-canary.1c156d69d.0" - "@material/mwc-base" "^0.20.0" - "@material/tab-scroller" "=9.0.0-canary.1c156d69d.0" - lit-element "^2.3.0" + "@material/dom" "=12.0.0-canary.1a8d06483.0" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/tab-scroller" "=12.0.0-canary.1a8d06483.0" + lit-element "^2.5.0" tslib "^2.0.1" -"@material/mwc-tab@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@material/mwc-tab/-/mwc-tab-0.20.0.tgz#a3445601dab27880e568dc5706738a6517082838" - integrity sha512-zGHnns1Gj91sucs9GLyN9kSqstWmaKpqeQCAcu98B7D6rI4dZKYgudrwnUUZiu1xqrsWhZy2rSbe8tu075ENVQ== +"@material/mwc-tab@0.22.0-canary.cc04657a.0", "@material/mwc-tab@canary": + version "0.22.0-canary.cc04657a.0" + resolved "https://registry.yarnpkg.com/@material/mwc-tab/-/mwc-tab-0.22.0-canary.cc04657a.0.tgz#8d4491f55758f5ac4cbabc18c3f4f0de26fd687b" + integrity sha512-G3i5bCIqoz1yivFNdNcQMvbGX4B2X99Ayt+VbOpr0Mo3xGDqxZ1FXIEK6bLBcfLPO92kgaWlSyzMFkVS4Z/xxw== dependencies: - "@material/mwc-base" "^0.20.0" - "@material/mwc-ripple" "^0.20.0" - "@material/mwc-tab-indicator" "^0.20.0" - "@material/tab" "=9.0.0-canary.1c156d69d.0" - lit-element "^2.3.0" - lit-html "^1.1.2" + "@material/mwc-base" "0.22.0-canary.cc04657a.0" + "@material/mwc-ripple" "0.22.0-canary.cc04657a.0" + "@material/mwc-tab-indicator" "0.22.0-canary.cc04657a.0" + "@material/tab" "=12.0.0-canary.1a8d06483.0" + lit-element "^2.5.0" + lit-html "^1.4.0" tslib "^2.0.1" -"@material/progress-indicator@9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/progress-indicator/-/progress-indicator-9.0.0-canary.1c156d69d.0.tgz#2a43d2c1442909874c5990b7ae893aced071a83d" - integrity sha512-56lYRqnUcI4L9a/LgfmzDTCKxxW1oOFqIVn3pMCP8hVGslhXY+yGl24qIp13MDW6FBgzx5rf66zB1rQltcSp/g== +"@material/progress-indicator@12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/progress-indicator/-/progress-indicator-12.0.0-canary.1a8d06483.0.tgz#336bde0bfb38c40a1b3f3472fc15be2ee6a35afa" + integrity sha512-/X9x7lEh5iTBsc6JHwzx/jgVoHoAxZVq5Fh5zf0Y0QwOUSu6rxUVCQCRz1ylcsRvmKO5BnJpzeHkRGKZDKImMg== dependencies: - tslib "^1.9.3" + tslib "^2.1.0" -"@material/radio@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/radio/-/radio-9.0.0-canary.1c156d69d.0.tgz#f0db2c1da9106a7a3888ed382da31b16fe78d1fc" - integrity sha512-i2pDFRhvk8bWp8BBJ0dyuGCqP17FlKSHzGqYQNI80dRPVYyLiexqIRfn0KGcW/sJtVC/P4GlyhE98g4mNYA/iQ== +"@material/radio@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/radio/-/radio-12.0.0-canary.1a8d06483.0.tgz#9b2aab58db5ce6f95db385139ffff2295c70d37e" + integrity sha512-j7Af+eoO7HMlnSlnRf7D4LEBVc4s2HPcRxFNrZ87POPRYaKlFGa+1TTqn0E9m6dRMB3AA0FCfJk7dLZKE6wlJA== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/density" "9.0.0-canary.1c156d69d.0" - "@material/dom" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/ripple" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - "@material/touch-target" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/density" "12.0.0-canary.1a8d06483.0" + "@material/dom" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + "@material/touch-target" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/ripple@9.0.0-canary.1c156d69d.0", "@material/ripple@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/ripple/-/ripple-9.0.0-canary.1c156d69d.0.tgz#1cbfec1c94640140f6c1c0f43a3582a82dbc7671" - integrity sha512-F1e/LQmYHQFORM/C3hchmANnRwJCXlc7Cp7W+VGpvJdtdzYlTd8DKKcShuOozxUQOjutbNf+Ql8gpZIdYRQaoQ== +"@material/ripple@12.0.0-canary.1a8d06483.0", "@material/ripple@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/ripple/-/ripple-12.0.0-canary.1a8d06483.0.tgz#8d7f62f46b83e2533948f2b527266770dbd5f8ae" + integrity sha512-U2uIdgIGDfKueucPnxSmiGwiWYcrE97fOsykagxxiTH037VsSlfLB4gldIKB4vUftYgOlYY1j/2Zz4PWr1MfUg== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/dom" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/dom" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/rtl@9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/rtl/-/rtl-9.0.0-canary.1c156d69d.0.tgz#0ff1f89f95ea4c67f030e56ce3ffdbfefcea225b" - integrity sha512-ICx0trLFna0M1Ina/1Nat9aSiB64o7VMs8wyCcidX//n7qFDOb0AtU9h2IB+lvX/UmPZVsDAoaL8iVm6RAqygg== +"@material/rtl@12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/rtl/-/rtl-12.0.0-canary.1a8d06483.0.tgz#7c0a615ed2c4169b2f7bfa873b13e54ed80a1880" + integrity sha512-7GxyzdTs2aCc/fcN+J+EhlVVlFZHhVnCnYi9lQGY8ohaIB1OxMLIVCp399Gqu89/wLZC0xukwWCsiv5fhPOecA== dependencies: - "@material/theme" "9.0.0-canary.1c156d69d.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/shape@9.0.0-canary.1c156d69d.0", "@material/shape@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/shape/-/shape-9.0.0-canary.1c156d69d.0.tgz#6d42d7004ed09b4493abf3f732bb855d3c3996ed" - integrity sha512-3NPm+LNFfY4xsiwy/jo+kY3WIFDwlVyJhq+eimjZ9vpG7STBPyzi1LpiPKvsrk0rmvsy3M0c1alM8E+BQ5+UAg== +"@material/shape@12.0.0-canary.1a8d06483.0", "@material/shape@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/shape/-/shape-12.0.0-canary.1a8d06483.0.tgz#9b055b9ec771e5f315b0637606b81718e1f13d34" + integrity sha512-VT/DHUHOkaiZznZmKrjIuo0Rq7PyGaAzZyeN3bdJAHz3UXAYQdBUYUxu/PPwKzoIHHKKdfP7XuGpDEysGiNkDw== dependencies: - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/rtl" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/switch@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/switch/-/switch-9.0.0-canary.1c156d69d.0.tgz#e76b4ec213a7fc449a82534289f016ae60002465" - integrity sha512-jGMtsI+IdPORkiEKG56XdiN8/8G9JcIdDKExov3BwGn/d6fO+IXQnMbV6XY9aRq/+eI0eI2XXT+ggiyk1Jy0AQ== +"@material/switch@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/switch/-/switch-12.0.0-canary.1a8d06483.0.tgz#6ebd6ff0f5b4e4373da496b225eaacf423b983a6" + integrity sha512-pYCKMdu8L6zNePrAESkDUyCAjFMXrtk9WmkigzRkku9E0NEvm4ippajmpAX5zKUAS9OhllsZfVIP0TfyEYNGTA== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/density" "9.0.0-canary.1c156d69d.0" - "@material/dom" "9.0.0-canary.1c156d69d.0" - "@material/elevation" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/ripple" "9.0.0-canary.1c156d69d.0" - "@material/rtl" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/density" "12.0.0-canary.1a8d06483.0" + "@material/dom" "12.0.0-canary.1a8d06483.0" + "@material/elevation" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/shape" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/tab-bar@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/tab-bar/-/tab-bar-9.0.0-canary.1c156d69d.0.tgz#d3dc2ea7317410c4fb054b32d88dbbbdf9c34bb3" - integrity sha512-wtpMK37gxkpbpdTpQh3IlHXx/maUyiYiwRjioIeh3GFQ42ZXW/N/9Ou2HK+qpiGVZDREYyT9TS2U5DiZTmM7tA== +"@material/tab-bar@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/tab-bar/-/tab-bar-12.0.0-canary.1a8d06483.0.tgz#fb7e3089feaa22de95b8f6c4e34bb6c9e336400d" + integrity sha512-cWhOfT12glndFH+B4V2XeYtBvFvXWmrRjH+lxdeZ+sC12qC6JjryF9wAq7wbciq4m83KaoMwaG1A+ixL6RbcQg== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/density" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/tab" "9.0.0-canary.1c156d69d.0" - "@material/tab-scroller" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/density" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/tab" "12.0.0-canary.1a8d06483.0" + "@material/tab-scroller" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/tab-indicator@9.0.0-canary.1c156d69d.0", "@material/tab-indicator@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/tab-indicator/-/tab-indicator-9.0.0-canary.1c156d69d.0.tgz#428b53a25cf09de65e1f602f3784b6202844ad48" - integrity sha512-PglSDSuQY6irrTNpEK/n/MDkZh6nH+iw0H31vt2A7QrG+BPwXrVJeRi6b8y2lvEnoQFp5WK8VavhFDNhcibEtw== +"@material/tab-indicator@12.0.0-canary.1a8d06483.0", "@material/tab-indicator@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/tab-indicator/-/tab-indicator-12.0.0-canary.1a8d06483.0.tgz#7765bf234f040b58a9022174c5f857657b1f4b9d" + integrity sha512-tGNP7DnPOiQ8R8Zc6E5DmRZONvhOZOyCo1vzt6uIA9noeFW0gDnNUyw1T7znA8FDJsNKu1R9HTcqym7WurcZFQ== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/tab-scroller@9.0.0-canary.1c156d69d.0", "@material/tab-scroller@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/tab-scroller/-/tab-scroller-9.0.0-canary.1c156d69d.0.tgz#f65267f3af811af3e7b1a7716a4b4a3cd64571ae" - integrity sha512-27h/vQv3+qh3YXPSTw/nakkWxgzDXMv3+ZBw+/XAwxu1siRb6EFBzsfLkQGpjVLm2DCPH3Dz4Xq8DOUkAyvd1A== +"@material/tab-scroller@12.0.0-canary.1a8d06483.0", "@material/tab-scroller@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/tab-scroller/-/tab-scroller-12.0.0-canary.1a8d06483.0.tgz#8fc58334342624b23a6094f9376312141742a750" + integrity sha512-tfvtGqFKe8vnd/6a41mxwR7Nl7b8QbcrJPDUmSVBDnZEg2VZ0+svs+w3OdECwen2ivnEvVIfFdESAzG4D8eI6g== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/dom" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/tab" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/dom" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/tab" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/tab@9.0.0-canary.1c156d69d.0", "@material/tab@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/tab/-/tab-9.0.0-canary.1c156d69d.0.tgz#eef68160458a4d55b28e96f14b0077a6dd69e88d" - integrity sha512-gS93t8Yl+djgWA8bFU80amzj2auGg/H3muVIJ1Mncak0CUtX3u6dYyvdKbeecRT9F1Wr4J3L8E0/aQatBOGa1w== +"@material/tab@12.0.0-canary.1a8d06483.0", "@material/tab@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/tab/-/tab-12.0.0-canary.1a8d06483.0.tgz#c901edf4fa9d1c0dd6f26a9c326af9fe13759534" + integrity sha512-HR6+Q4Gi9/Wz/A1D6CAIR+6fRDXDvp3JOTsjRBoXonsGKHQmuB+jI3DaTEQ7gDsWa2k4OAC5/wBn+omEDFMQNQ== dependencies: - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/ripple" "9.0.0-canary.1c156d69d.0" - "@material/rtl" "9.0.0-canary.1c156d69d.0" - "@material/tab-indicator" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - "@material/typography" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/tab-indicator" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + "@material/typography" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/theme@9.0.0-canary.1c156d69d.0", "@material/theme@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/theme/-/theme-9.0.0-canary.1c156d69d.0.tgz#2d733dea8f762cc8e35969915dfb3b7359147d1e" - integrity sha512-r1610TPwUplt4FHMk7cR06Oz1jU/G31wBIh4Frs/YIB0ZonVlI5cZdIkG0IFtNt9ZYWoDwfP/1nQBxdqrDPPhg== +"@material/theme@12.0.0-canary.1a8d06483.0", "@material/theme@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/theme/-/theme-12.0.0-canary.1a8d06483.0.tgz#0cb281b26a1147ef0322d21ce750f4a0f792d880" + integrity sha512-Llc8UnCcE3UbCrJyNLTVXradY9zoddJgH1cB3bzx/j7gIeoJnqXqZB43Zg+ZMXVzoOyGTbYrqpi5Kl1VzOxJSQ== dependencies: - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/top-app-bar@=9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/top-app-bar/-/top-app-bar-9.0.0-canary.1c156d69d.0.tgz#6b5c76a9cfd2abae35f45b74eb17c917db74d70d" - integrity sha512-VJLGCF+1vsLY/YFPVgcFCIEG/EjuY7eg7ulBwhwbERIl3pyyY3NAvISGzaeUBKg6JOcw0YqcPKcRnv+Js3KchQ== +"@material/top-app-bar@=12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/top-app-bar/-/top-app-bar-12.0.0-canary.1a8d06483.0.tgz#7164e244ee41b804660847f1387230b158cd46e1" + integrity sha512-+vDujMPtrCSKMs+6q3TxnpG0sAm/snAL14zrReTLTVwr0QEPh5V/gJ51vRZ/Fubr0ssDxc+g3Jw6MtGkN9hrng== dependencies: - "@material/animation" "9.0.0-canary.1c156d69d.0" - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/elevation" "9.0.0-canary.1c156d69d.0" - "@material/ripple" "9.0.0-canary.1c156d69d.0" - "@material/rtl" "9.0.0-canary.1c156d69d.0" - "@material/shape" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" - "@material/typography" "9.0.0-canary.1c156d69d.0" - tslib "^1.9.3" + "@material/animation" "12.0.0-canary.1a8d06483.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/elevation" "12.0.0-canary.1a8d06483.0" + "@material/ripple" "12.0.0-canary.1a8d06483.0" + "@material/rtl" "12.0.0-canary.1a8d06483.0" + "@material/shape" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + "@material/typography" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/touch-target@9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/touch-target/-/touch-target-9.0.0-canary.1c156d69d.0.tgz#e2839c73f6df724804c376624af776f32be2c81a" - integrity sha512-AFymS9cb152a2hEwTc80dVKA0ccNCyMAQNpvB6fEopPMLjO4Hrsu4fIHVyZF5xnz3k/iG59Y6vreHQdHKFGyUw== +"@material/touch-target@12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/touch-target/-/touch-target-12.0.0-canary.1a8d06483.0.tgz#18ae321c2c6a14bc3bf7c7966f2413a942ef28cb" + integrity sha512-JiEIJVzTEwKxh87/noFXsOmF2uWUPinJc0Hhf/BIZrxQk0Gi0MJWwZ5p4gcfv3Z8sC+DjZXd7BImdDhBV2oZJw== dependencies: - "@material/base" "9.0.0-canary.1c156d69d.0" - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" + "@material/base" "12.0.0-canary.1a8d06483.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" -"@material/typography@9.0.0-canary.1c156d69d.0": - version "9.0.0-canary.1c156d69d.0" - resolved "https://registry.yarnpkg.com/@material/typography/-/typography-9.0.0-canary.1c156d69d.0.tgz#340328147eaa86efacfad601b6dbdff7ac0388ac" - integrity sha512-+JgMe2fIP+lVh4l5qXfjH9/JWd+LnfDEiVr2clWHgAc3pc2LQm6VVgUbNkrX3yeWql0x7I/inGfQovza8BeYAw== +"@material/typography@12.0.0-canary.1a8d06483.0": + version "12.0.0-canary.1a8d06483.0" + resolved "https://registry.yarnpkg.com/@material/typography/-/typography-12.0.0-canary.1a8d06483.0.tgz#df337ca915f505ba6607fb239387b5358a933625" + integrity sha512-RGxiA4FEvdO3PQ8xmSaKGvOHmm7WNCjl9rizHembV6tS2rc3CvMiHpQgIyHMGv7WXBcu7Aa9V48S2vXJa0fkmg== dependencies: - "@material/feature-targeting" "9.0.0-canary.1c156d69d.0" - "@material/theme" "9.0.0-canary.1c156d69d.0" + "@material/feature-targeting" "12.0.0-canary.1a8d06483.0" + "@material/theme" "12.0.0-canary.1a8d06483.0" + tslib "^2.1.0" "@mdi/js@5.9.55": version "5.9.55" @@ -2880,6 +2921,11 @@ resolved "https://registry.yarnpkg.com/@types/sortablejs/-/sortablejs-1.10.6.tgz#98725ae08f1dfe28b8da0fdf302c417f5ff043c0" integrity sha512-QRz8Z+uw2Y4Gwrtxw8hD782zzuxxugdcq8X/FkPsXUa1kfslhGzy13+4HugO9FXNo+jlWVcE6DYmmegniIQ30A== +"@types/trusted-types@^1.0.1": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-1.0.6.tgz#569b8a08121d3203398290d602d84d73c8dcf5da" + integrity sha512-230RC8sFeHoT6sSUlRO6a8cAnclO06eeiq1QDfiv2FGCLWFvvERWgwIQD4FWqD9A69BN7Lzee4OXwoMVnnsWDw== + "@types/webspeechapi@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/webspeechapi/-/webspeechapi-0.0.29.tgz#8f3c6b31b779df7a9bbac7f89acfce0c3bcb1972" @@ -8660,28 +8706,29 @@ lit-analyzer@1.2.1, lit-analyzer@^1.2.1: vscode-html-languageservice "3.1.0" web-component-analyzer "~1.1.1" -lit-element@2.5.1, lit-element@^2.0.0, lit-element@^2.2.1, lit-element@^2.3.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-2.5.1.tgz#3fa74b121a6cd22902409ae3859b7847d01aa6b6" - integrity sha512-ogu7PiJTA33bEK0xGu1dmaX5vhcRjBXCFexPja0e7P7jqLhTpNKYRPmE+GmiCaRVAbiQKGkUgkh/i6+bh++dPQ== +lit-element@3.0.0-rc.2, lit-element@^2.2.1, lit-element@^2.5.0, lit-element@^3.0.0-rc.2: + version "3.0.0-rc.2" + resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.0.0-rc.2.tgz#883d0b6fd7b846226d360699d1b713da5fc7e1b7" + integrity sha512-2Z7DabJ3b5K+p5073vFjMODoaWqy5PIaI4y6ADKm+fCGc8OnX9fU9dMoUEBZjFpd/bEFR9PBp050tUtBnT9XTQ== dependencies: - lit-html "^1.1.1" + "@lit/reactive-element" "^1.0.0-rc.2" + lit-html "^2.0.0-rc.3" -lit-html@1.4.1, lit-html@^1.0.0, lit-html@^1.1.1, lit-html@^1.1.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-1.4.1.tgz#0c6f3ee4ad4eb610a49831787f0478ad8e9ae5e0" - integrity sha512-B9btcSgPYb1q4oSOb/PrOT6Z/H+r6xuNzfH4lFli/AWhYwdtrgQkQWBbIc6mdnf6E2IL3gDXdkkqNktpU0OZQA== - -lit-virtualizer@^0.4.2: - version "0.4.2" - resolved "https://registry.yarnpkg.com/lit-virtualizer/-/lit-virtualizer-0.4.2.tgz#8c66e26c0e50cd8e3fc7f2dfeab932967b40050a" - integrity sha512-aytx/Qym8h7eIh3u17oT2FfgmhOixnk4IuJAOMIbA6E8szkbpnKUDSLDWlN9ihQyCb0eijV213P+4mlekOWKxA== +lit-html@2.0.0-rc.3, lit-html@^1.4.0, lit-html@^2.0.0-rc.3: + version "2.0.0-rc.3" + resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.0.0-rc.3.tgz#1c216e548630e18d3093d97f4e29563abce659af" + integrity sha512-Y6P8LlAyQuqvzq6l/Nc4z5/P5M/rVLYKQIRxcNwSuGajK0g4kbcBFQqZmgvqKG+ak+dHZjfm2HUw9TF5N/pkCw== dependencies: - event-target-shim "^5.0.1" - lit-element "^2.0.0" - lit-html "^1.0.0" - resize-observer-polyfill "^1.5.1" - tslib "^1.10.0" + "@types/trusted-types" "^1.0.1" + +lit@^2.0.0-rc.1, lit@^2.0.0-rc.2: + version "2.0.0-rc.2" + resolved "https://registry.yarnpkg.com/lit/-/lit-2.0.0-rc.2.tgz#724a2d621aa098001d73bf7106f3a72b7b5948ef" + integrity sha512-BOCuoJR04WaTV8UqTKk09cNcQA10Aq2LCcBOiHuF7TzWH5RNDsbCBP5QM9sLBSotGTXbDug/gFO08jq6TbyEtw== + dependencies: + "@lit/reactive-element" "^1.0.0-rc.2" + lit-element "^3.0.0-rc.2" + lit-html "^2.0.0-rc.3" load-bmfont@^1.3.1: version "1.4.0" @@ -12503,7 +12550,7 @@ tsconfig-paths@^3.9.0: minimist "^1.2.0" strip-bom "^3.0.0" -tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: +tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== From 1b9286db768b4c2a04a25e90e8525e1ba9bd909a Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 18 May 2021 15:01:43 -0700 Subject: [PATCH 063/117] Fix lit warnings (#9204) Co-authored-by: Bram Kragten --- build-scripts/webpack.js | 1 + src/components/date-range-picker.ts | 10 +- src/components/entity/ha-entity-toggle.ts | 3 +- src/components/entity/state-badge.ts | 3 +- src/components/ha-code-editor.ts | 8 -- src/components/ha-icon.ts | 3 +- src/components/ha-menu-button.ts | 1 - src/components/ha-sidebar.ts | 19 ++- src/dialogs/make-dialog-manager.ts | 6 + .../more-info/controls/more-info-light.ts | 4 +- src/layouts/hass-tabs-subpage.ts | 4 +- src/layouts/home-assistant-main.ts | 21 ++-- src/layouts/home-assistant.ts | 56 +++++---- src/layouts/partial-panel-resolver.ts | 4 +- .../components/hui-entities-toggle.ts | 4 +- .../strategies/original-states-strategy.ts | 2 +- src/panels/lovelace/views/hui-masonry-view.ts | 108 +++++++++++------- src/panels/lovelace/views/hui-panel-view.ts | 4 +- src/panels/lovelace/views/hui-view.ts | 9 +- src/resources/compatibility.ts | 2 +- src/state/disconnect-toast-mixin.ts | 2 +- src/state/hass-base-mixin.ts | 4 - src/state/more-info-mixin.ts | 12 +- 23 files changed, 161 insertions(+), 129 deletions(-) diff --git a/build-scripts/webpack.js b/build-scripts/webpack.js index 88534d44b1..d3e50ebd78 100644 --- a/build-scripts/webpack.js +++ b/build-scripts/webpack.js @@ -129,6 +129,7 @@ const createWebpackConfig = ({ alias: { "lit/decorators$": "lit/decorators.js", "lit/directive$": "lit/directive.js", + "lit/polyfill-support$": "lit/polyfill-support.js", }, }, output: { diff --git a/src/components/date-range-picker.ts b/src/components/date-range-picker.ts index 7dd6244640..6ad2905564 100644 --- a/src/components/date-range-picker.ts +++ b/src/components/date-range-picker.ts @@ -1,7 +1,8 @@ -// @ts-nocheck import wrap from "@vue/web-component-wrapper"; +import { customElement } from "lit/decorators"; import Vue from "vue"; import DateRangePicker from "vue2-daterange-picker"; +// @ts-ignore import dateRangePickerStyles from "vue2-daterange-picker/dist/vue2-daterange-picker.css"; import { fireEvent } from "../common/dom/fire_event"; import { Constructor } from "../types"; @@ -34,22 +35,29 @@ const Component = Vue.extend({ }, }, render(createElement) { + // @ts-ignore return createElement(DateRangePicker, { props: { "time-picker": true, "auto-apply": false, opens: "right", "show-dropdowns": false, + // @ts-ignore "time-picker24-hour": this.twentyfourHours, + // @ts-ignore disabled: this.disabled, + // @ts-ignore ranges: this.ranges ? {} : false, }, model: { value: { + // @ts-ignore startDate: this.startDate, + // @ts-ignore endDate: this.endDate, }, callback: (value) => { + // @ts-ignore fireEvent(this.$el as HTMLElement, "change", value); }, expression: "dateRange", diff --git a/src/components/entity/ha-entity-toggle.ts b/src/components/entity/ha-entity-toggle.ts index 0318741f0b..5a3942d5d3 100644 --- a/src/components/entity/ha-entity-toggle.ts +++ b/src/components/entity/ha-entity-toggle.ts @@ -80,7 +80,8 @@ export class HaEntityToggle extends LitElement { this.addEventListener("click", (ev) => ev.stopPropagation()); } - protected updated(changedProps: PropertyValues): void { + public willUpdate(changedProps: PropertyValues): void { + super.willUpdate(changedProps); if (changedProps.has("stateObj")) { this._isOn = isOn(this.stateObj); } diff --git a/src/components/entity/state-badge.ts b/src/components/entity/state-badge.ts index 16043f79dd..8dea329c93 100644 --- a/src/components/entity/state-badge.ts +++ b/src/components/entity/state-badge.ts @@ -63,7 +63,8 @@ export class StateBadge extends LitElement { `; } - protected updated(changedProps: PropertyValues) { + public willUpdate(changedProps: PropertyValues) { + super.willUpdate(changedProps); if ( !changedProps.has("stateObj") && !changedProps.has("overrideImage") && diff --git a/src/components/ha-code-editor.ts b/src/components/ha-code-editor.ts index 1aae3d649c..7ea60707c3 100644 --- a/src/components/ha-code-editor.ts +++ b/src/components/ha-code-editor.ts @@ -55,14 +55,6 @@ export class HaCodeEditor extends ReactiveElement { public connectedCallback() { super.connectedCallback(); - // Lit 2.0 will create the shadowRoot for us, and adopt the styles, check if it was created - if (!this.shadowRoot) { - this.attachShadow({ mode: "open" }).innerHTML = ``; - } if (!this.codemirror) { return; } diff --git a/src/components/ha-icon.ts b/src/components/ha-icon.ts index 3d43596f10..73563d26f6 100644 --- a/src/components/ha-icon.ts +++ b/src/components/ha-icon.ts @@ -49,7 +49,8 @@ export class HaIcon extends LitElement { @state() private _legacy = false; - protected updated(changedProps: PropertyValues) { + public willUpdate(changedProps: PropertyValues) { + super.willUpdate(changedProps); if (changedProps.has("icon")) { this._path = undefined; this._viewBox = undefined; diff --git a/src/components/ha-menu-button.ts b/src/components/ha-menu-button.ts index 2249b6fa24..9737b2427d 100644 --- a/src/components/ha-menu-button.ts +++ b/src/components/ha-menu-button.ts @@ -93,7 +93,6 @@ class HaMenuButton extends LitElement { this.style.display = newNarrow || this._alwaysVisible ? "initial" : "none"; if (!newNarrow) { - this._hasNotifications = false; if (this._unsubNotifications) { this._unsubNotifications(); this._unsubNotifications = undefined; diff --git a/src/components/ha-sidebar.ts b/src/components/ha-sidebar.ts index 9cd8a320bd..0a56b4df48 100644 --- a/src/components/ha-sidebar.ts +++ b/src/components/ha-sidebar.ts @@ -27,6 +27,7 @@ import { guard } from "lit/directives/guard"; import memoizeOne from "memoize-one"; import { LocalStorage } from "../common/decorators/local-storage"; import { fireEvent } from "../common/dom/fire_event"; +import { toggleAttribute } from "../common/dom/toggle_attribute"; import { computeDomain } from "../common/entity/compute_domain"; import { compare } from "../common/string/compare"; import { computeRTL } from "../common/util/compute_rtl"; @@ -165,18 +166,12 @@ class HaSidebar extends LitElement { @property({ type: Boolean }) public alwaysExpand = false; - @property({ type: Boolean, reflect: true }) public expanded = false; - @property({ type: Boolean }) public editMode = false; @state() private _externalConfig?: ExternalConfig; @state() private _notifications?: PersistentNotification[]; - // property used only in css - // @ts-ignore - @property({ type: Boolean, reflect: true }) public rtl = false; - @state() private _renderEmptySortable = false; private _mouseLeaveTimeout?: number; @@ -265,7 +260,7 @@ class HaSidebar extends LitElement { protected updated(changedProps) { super.updated(changedProps); if (changedProps.has("alwaysExpand")) { - this.expanded = this.alwaysExpand; + toggleAttribute(this, "expanded", this.alwaysExpand); } if (changedProps.has("editMode")) { if (this.editMode) { @@ -280,7 +275,7 @@ class HaSidebar extends LitElement { const oldHass = changedProps.get("hass") as HomeAssistant | undefined; if (!oldHass || oldHass.locale !== this.hass.locale) { - this.rtl = computeRTL(this.hass); + toggleAttribute(this, "rtl", computeRTL(this.hass)); } if (!SUPPORT_SCROLL_IF_NEEDED) { @@ -428,7 +423,7 @@ class HaSidebar extends LitElement { @click=${this._handleShowNotificationDrawer} > - ${!this.expanded && notificationCount > 0 + ${!this.alwaysExpand && notificationCount > 0 ? html` ${notificationCount} @@ -438,7 +433,7 @@ class HaSidebar extends LitElement { ${this.hass.localize("ui.notification_drawer.title")} - ${this.expanded && notificationCount > 0 + ${this.alwaysExpand && notificationCount > 0 ? html` ${notificationCount} ` : ""} @@ -593,7 +588,7 @@ class HaSidebar extends LitElement { // for 100ms so that we ignore it when pressing down arrow scrolls the // sidebar causing the mouse to hover a new icon if ( - this.expanded || + this.alwaysExpand || new Date().getTime() < this._recentKeydownActiveUntil ) { return; @@ -615,7 +610,7 @@ class HaSidebar extends LitElement { } private _listboxFocusIn(ev) { - if (this.expanded || ev.target.nodeName !== "A") { + if (this.alwaysExpand || ev.target.nodeName !== "A") { return; } this._showTooltip(ev.target.querySelector("paper-icon-item")); diff --git a/src/dialogs/make-dialog-manager.ts b/src/dialogs/make-dialog-manager.ts index eada7af6eb..17475259ab 100644 --- a/src/dialogs/make-dialog-manager.ts +++ b/src/dialogs/make-dialog-manager.ts @@ -50,6 +50,12 @@ export const showDialog = async ( ) => { if (!(dialogTag in LOADED)) { if (!dialogImport) { + if (__DEV__) { + // eslint-disable-next-line + console.warn( + "Asked to show dialog that's not loaded and can't be imported" + ); + } return; } LOADED[dialogTag] = dialogImport().then(() => { diff --git a/src/dialogs/more-info/controls/more-info-light.ts b/src/dialogs/more-info/controls/more-info-light.ts index f4d963a41a..5ebc5166ae 100644 --- a/src/dialogs/more-info/controls/more-info-light.ts +++ b/src/dialogs/more-info/controls/more-info-light.ts @@ -233,7 +233,9 @@ class MoreInfoLight extends LitElement { `; } - protected updated(changedProps: PropertyValues) { + public willUpdate(changedProps: PropertyValues) { + super.willUpdate(changedProps); + if (!changedProps.has("stateObj")) { return; } diff --git a/src/layouts/hass-tabs-subpage.ts b/src/layouts/hass-tabs-subpage.ts index e7b787a0a2..7ee2f6f0c7 100644 --- a/src/layouts/hass-tabs-subpage.ts +++ b/src/layouts/hass-tabs-subpage.ts @@ -106,8 +106,7 @@ class HassTabsSubpage extends LitElement { } ); - protected updated(changedProperties: PropertyValues) { - super.updated(changedProperties); + public willUpdate(changedProperties: PropertyValues) { if (changedProperties.has("route")) { this._activeTab = this.tabs.find((tab) => `${this.route.prefix}${this.route.path}`.includes(tab.path) @@ -121,6 +120,7 @@ class HassTabsSubpage extends LitElement { this.rtl = computeRTL(this.hass); } } + super.willUpdate(changedProperties); } protected render(): TemplateResult { diff --git a/src/layouts/home-assistant-main.ts b/src/layouts/home-assistant-main.ts index add8b5c4c1..36f948d7f7 100644 --- a/src/layouts/home-assistant-main.ts +++ b/src/layouts/home-assistant-main.ts @@ -42,19 +42,20 @@ class HomeAssistantMain extends LitElement { @property() public route?: Route; - @property({ type: Boolean }) public narrow?: boolean; + @property({ type: Boolean }) public narrow!: boolean; @state() private _sidebarEditMode = false; + constructor() { + super(); + listenMediaQuery("(max-width: 870px)", (matches) => { + this.narrow = matches; + }); + } + protected render(): TemplateResult { const hass = this.hass; - - if (!hass) { - return html``; - } - const sidebarNarrow = this._sidebarNarrow; - const disableSwipe = this._sidebarEditMode || !sidebarNarrow || @@ -142,13 +143,9 @@ class HomeAssistantMain extends LitElement { this.addEventListener("hass-show-notifications", () => { showNotificationDrawer(this, { - narrow: this.narrow!, + narrow: this.narrow, }); }); - - listenMediaQuery("(max-width: 870px)", (matches) => { - this.narrow = matches; - }); } protected updated(changedProps: PropertyValues) { diff --git a/src/layouts/home-assistant.ts b/src/layouts/home-assistant.ts index 1499e9a88f..e9c5efa758 100644 --- a/src/layouts/home-assistant.ts +++ b/src/layouts/home-assistant.ts @@ -15,13 +15,24 @@ import { import "./ha-init-page"; import "./home-assistant-main"; +const useHash = __DEMO__; +const curPath = () => + window.decodeURIComponent( + useHash ? location.hash.substr(1) : location.pathname + ); + +const panelUrl = (path: string) => { + const dividerPos = path.indexOf("/", 1); + return dividerPos === -1 ? path.substr(1) : path.substr(1, dividerPos - 1); +}; + @customElement("home-assistant") export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { - @state() private _route?: Route; + @state() private _route: Route; @state() private _error = false; - @state() private _panelUrl?: string; + private _panelUrl: string; private _haVersion?: string; @@ -29,12 +40,24 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { private _visiblePromiseResolve?: () => void; + constructor() { + super(); + const path = curPath(); + + if (["", "/"].includes(path)) { + navigate(this, `/${getStorageDefaultPanelUrlPath()}`, true); + } + this._route = { + prefix: "", + path, + }; + this._panelUrl = panelUrl(path); + } + protected render() { const hass = this.hass; - return this._panelUrl === undefined || this._route === undefined - ? html`` - : hass && hass.states && hass.config && hass.services + return hass && hass.states && hass.config && hass.services ? html` - window.decodeURIComponent( - useHash ? location.hash.substr(1) : location.pathname - ); const updateRoute = (path = curPath()) => { if (this._route && path === this._route.path) { return; @@ -69,9 +87,10 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { prefix: "", path: path, }; - const dividerPos = path.indexOf("/", 1); - this._panelUrl = - dividerPos === -1 ? path.substr(1) : path.substr(1, dividerPos - 1); + + this._panelUrl = panelUrl(path); + this.panelUrlChanged(this._panelUrl!); + this._updateHass({ panelUrl: this._panelUrl }); }; window.addEventListener("location-changed", () => updateRoute()); @@ -90,21 +109,10 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { navigate(this, href); } }); - - // Handle first navigation - if (["", "/"].includes(curPath())) { - navigate(this, `/${getStorageDefaultPanelUrlPath()}`, true); - } else { - updateRoute(); - } } protected updated(changedProps: PropertyValues): void { super.updated(changedProps); - if (changedProps.has("_panelUrl")) { - this.panelUrlChanged(this._panelUrl!); - this._updateHass({ panelUrl: this._panelUrl }); - } if (changedProps.has("hass")) { this.hassChanged( this.hass!, diff --git a/src/layouts/partial-panel-resolver.ts b/src/layouts/partial-panel-resolver.ts index 454db3336d..6035c27713 100644 --- a/src/layouts/partial-panel-resolver.ts +++ b/src/layouts/partial-panel-resolver.ts @@ -65,8 +65,8 @@ class PartialPanelResolver extends HassRouterPage { document.addEventListener("resume", () => this._checkVisibility()); } - protected updated(changedProps: PropertyValues) { - super.updated(changedProps); + public willUpdate(changedProps: PropertyValues) { + super.willUpdate(changedProps); if (!changedProps.has("hass")) { return; diff --git a/src/panels/lovelace/components/hui-entities-toggle.ts b/src/panels/lovelace/components/hui-entities-toggle.ts index 288f09d569..7e0431b61f 100644 --- a/src/panels/lovelace/components/hui-entities-toggle.ts +++ b/src/panels/lovelace/components/hui-entities-toggle.ts @@ -22,8 +22,8 @@ class HuiEntitiesToggle extends LitElement { @state() private _toggleEntities?: string[]; - public updated(changedProperties: PropertyValues): void { - super.updated(changedProperties); + public willUpdate(changedProperties: PropertyValues): void { + super.willUpdate(changedProperties); if (changedProperties.has("entities")) { this._toggleEntities = this.entities!.filter( (entityId) => diff --git a/src/panels/lovelace/strategies/original-states-strategy.ts b/src/panels/lovelace/strategies/original-states-strategy.ts index 0aaef9fcf5..01694cdf78 100644 --- a/src/panels/lovelace/strategies/original-states-strategy.ts +++ b/src/panels/lovelace/strategies/original-states-strategy.ts @@ -83,10 +83,10 @@ export class OriginalStatesStrategy { info: Parameters[0] ): ReturnType { return { + title: info.hass.config.location_name, views: [ { strategy: { type: "original-states" }, - title: info.hass.config.location_name, }, ], }; diff --git a/src/panels/lovelace/views/hui-masonry-view.ts b/src/panels/lovelace/views/hui-masonry-view.ts index 8b260c9aa9..908d32e818 100644 --- a/src/panels/lovelace/views/hui-masonry-view.ts +++ b/src/panels/lovelace/views/hui-masonry-view.ts @@ -23,8 +23,6 @@ import type { HuiErrorCard } from "../cards/hui-error-card"; import { computeCardSize } from "../common/compute-card-size"; import type { Lovelace, LovelaceBadge, LovelaceCard } from "../types"; -let editCodeLoaded = false; - // Find column with < 5 size, else smallest column const getColumnIndex = (columnSizes: number[], size: number) => { let minIndex = 0; @@ -71,16 +69,26 @@ export class MasonryView extends LitElement implements LovelaceViewElement { this.addEventListener("iron-resize", (ev: Event) => ev.stopPropagation()); } + public connectedCallback() { + super.connectedCallback(); + this._initMqls(); + } + + public disconnectedCallback() { + super.disconnectedCallback(); + this._mqls?.forEach((mql) => { + mql.removeListener(this._updateColumns); + }); + this._mqls = undefined; + } + public setConfig(_config: LovelaceViewConfig): void {} protected render(): TemplateResult { return html` -
0 ? "display: block" : "display: none"} - > - ${this.badges.map((badge) => html`${badge}`)} -
+ ${this.badges.length > 0 + ? html`
${this.badges}
` + : ""}
${this.lovelace?.editMode ? html` @@ -101,31 +109,31 @@ export class MasonryView extends LitElement implements LovelaceViewElement { `; } - protected firstUpdated(): void { + private _initMqls() { this._mqls = [300, 600, 900, 1200].map((width) => { const mql = window.matchMedia(`(min-width: ${width}px)`); - mql.addListener(() => this._updateColumns()); + mql.addListener(this._updateColumns.bind(this)); return mql; }); - this._updateColumns(); } - protected updated(changedProperties: PropertyValues): void { - super.updated(changedProperties); - - if (this.lovelace?.editMode && !editCodeLoaded) { - editCodeLoaded = true; - import("./default-view-editable"); + private get mqls(): MediaQueryList[] { + if (!this._mqls) { + this._initMqls(); } + return this._mqls!; + } + + public willUpdate(changedProperties: PropertyValues) { + super.willUpdate(changedProperties); if (changedProperties.has("hass")) { - const oldHass = changedProperties.get("hass") as HomeAssistant; + const oldHass = changedProperties.get("hass") as + | HomeAssistant + | undefined; - if (oldHass && this.hass!.dockedSidebar !== oldHass.dockedSidebar) { + if (this.hass!.dockedSidebar !== oldHass?.dockedSidebar) { this._updateColumns(); - } - - if (changedProperties.size === 1) { return; } } @@ -133,16 +141,24 @@ export class MasonryView extends LitElement implements LovelaceViewElement { if (changedProperties.has("narrow")) { this._updateColumns(); } + } + + protected updated(changedProperties: PropertyValues): void { + super.updated(changedProperties); + + if (this.lovelace?.editMode) { + import("./default-view-editable"); + } const oldLovelace = changedProperties.get("lovelace") as | Lovelace | undefined; if ( - (changedProperties.has("lovelace") && - (oldLovelace?.config !== this.lovelace?.config || - oldLovelace?.editMode !== this.lovelace?.editMode)) || - changedProperties.has("_columns") + changedProperties.has("lovelace") && + oldLovelace && + (oldLovelace.config !== this.lovelace?.config || + oldLovelace.editMode !== this.lovelace?.editMode) ) { this._createColumns(); } @@ -152,6 +168,17 @@ export class MasonryView extends LitElement implements LovelaceViewElement { fireEvent(this, "ll-create-card"); } + private _createRootElement(columns: HTMLDivElement[]) { + const root = this.shadowRoot!.getElementById("columns") as HTMLDivElement; + + // Remove old columns + while (root.lastChild) { + root.removeChild(root.lastChild); + } + + columns.forEach((column) => root.appendChild(column)); + } + private async _createColumns() { if (!this._columns) { return; @@ -159,12 +186,6 @@ export class MasonryView extends LitElement implements LovelaceViewElement { this._createColumnsIteration++; const iteration = this._createColumnsIteration; - const root = this.shadowRoot!.getElementById("columns")!; - - // Remove old columns - while (root.lastChild) { - root.removeChild(root.lastChild); - } // Track the total height of cards in a columns const columnSizes: number[] = []; @@ -173,11 +194,18 @@ export class MasonryView extends LitElement implements LovelaceViewElement { for (let i = 0; i < Math.min(this._columns, this.cards.length); i++) { const columnEl = document.createElement("div"); columnEl.classList.add("column"); - root.appendChild(columnEl); columnSizes.push(0); columnElements.push(columnEl); } + if (!this.hasUpdated) { + this.updateComplete.then(() => { + this._createRootElement(columnElements); + }); + } else { + this._createRootElement(columnElements); + } + let tillNextRender: Promise | undefined; let start: Date | undefined; @@ -244,19 +272,21 @@ export class MasonryView extends LitElement implements LovelaceViewElement { } private _updateColumns() { - if (!this._mqls) { - return; - } - const matchColumns = this._mqls!.reduce( + const matchColumns = this.mqls.reduce( (cols, mql) => cols + Number(mql.matches), 0 ); // Do -1 column if the menu is docked and open - this._columns = Math.max( + const newColumns = Math.max( 1, matchColumns - Number(!this.narrow && this.hass!.dockedSidebar === "docked") ); + if (newColumns === this._columns) { + return; + } + this._columns = newColumns; + this._createColumns(); } static get styles(): CSSResultGroup { @@ -268,7 +298,7 @@ export class MasonryView extends LitElement implements LovelaceViewElement { box-sizing: border-box; } - #badges { + .badges { margin: 8px 16px; font-size: 85%; text-align: center; diff --git a/src/panels/lovelace/views/hui-panel-view.ts b/src/panels/lovelace/views/hui-panel-view.ts index 1c7d531377..bc43c1fde1 100644 --- a/src/panels/lovelace/views/hui-panel-view.ts +++ b/src/panels/lovelace/views/hui-panel-view.ts @@ -40,8 +40,8 @@ export class PanelView extends LitElement implements LovelaceViewElement { public setConfig(_config: LovelaceViewConfig): void {} - protected updated(changedProperties: PropertyValues): void { - super.updated(changedProperties); + public willUpdate(changedProperties: PropertyValues): void { + super.willUpdate(changedProperties); if (this.lovelace?.editMode && !editCodeLoaded) { editCodeLoaded = true; diff --git a/src/panels/lovelace/views/hui-view.ts b/src/panels/lovelace/views/hui-view.ts index 5f815f25a3..53b3394483 100644 --- a/src/panels/lovelace/views/hui-view.ts +++ b/src/panels/lovelace/views/hui-view.ts @@ -88,8 +88,8 @@ export class HUIView extends ReactiveElement { return this; } - protected updated(changedProperties: PropertyValues): void { - super.updated(changedProperties); + public willUpdate(changedProperties: PropertyValues): void { + super.willUpdate(changedProperties); /* We need to handle the following use cases: @@ -112,8 +112,11 @@ export class HUIView extends ReactiveElement { oldLovelace.config.views[this.index])) ) { this._initializeConfig(); - return; } + } + + protected update(changedProperties) { + super.update(changedProperties); // If no layout element, we're still creating one if (this._layoutElement) { diff --git a/src/resources/compatibility.ts b/src/resources/compatibility.ts index 85726354bc..f1ae18e990 100644 --- a/src/resources/compatibility.ts +++ b/src/resources/compatibility.ts @@ -1,6 +1,6 @@ // For localize import "@formatjs/intl-getcanonicallocales/polyfill"; -import "@lit/polyfill-support"; +import "lit/polyfill-support"; import "core-js"; // To use comlink under ES5 import "proxy-polyfill"; diff --git a/src/state/disconnect-toast-mixin.ts b/src/state/disconnect-toast-mixin.ts index 9b60b20e39..4e09213bc9 100644 --- a/src/state/disconnect-toast-mixin.ts +++ b/src/state/disconnect-toast-mixin.ts @@ -20,7 +20,7 @@ export default >(superClass: T) => protected firstUpdated(changedProps) { super.firstUpdated(changedProps); // Need to load in advance because when disconnected, can't dynamically load code. - import("../managers/notification-manager"); + setTimeout(() => import("../managers/notification-manager"), 5000); } updated(changedProperties) { diff --git a/src/state/hass-base-mixin.ts b/src/state/hass-base-mixin.ts index 27a19e9865..c0e7170328 100644 --- a/src/state/hass-base-mixin.ts +++ b/src/state/hass-base-mixin.ts @@ -3,10 +3,6 @@ import { LitElement } from "lit"; import { property } from "lit/decorators"; import { HomeAssistant } from "../types"; -// Temporary disable warnings so the dev console is not flooded, we should fix these and then re-enable the warning -if (__DEV__) { - LitElement.disableWarning?.("change-in-update"); -} export class HassBaseEl extends LitElement { @property({ attribute: false }) public hass?: HomeAssistant; diff --git a/src/state/more-info-mixin.ts b/src/state/more-info-mixin.ts index 620b8b027f..e05c76ed72 100644 --- a/src/state/more-info-mixin.ts +++ b/src/state/more-info-mixin.ts @@ -12,14 +12,6 @@ declare global { } } -let moreInfoImportPromise; -const importMoreInfo = () => { - if (!moreInfoImportPromise) { - moreInfoImportPromise = import("../dialogs/more-info/ha-more-info-dialog"); - } - return moreInfoImportPromise; -}; - export default >(superClass: T) => class extends superClass { protected firstUpdated(changedProps: PropertyValues) { @@ -27,7 +19,7 @@ export default >(superClass: T) => this.addEventListener("hass-more-info", (ev) => this._handleMoreInfo(ev)); // Load it once we are having the initial rendering done. - importMoreInfo(); + import("../dialogs/more-info/ha-more-info-dialog"); } private async _handleMoreInfo(ev: HASSDomEvent) { @@ -38,7 +30,7 @@ export default >(superClass: T) => { entityId: ev.detail.entityId, }, - importMoreInfo + () => import("../dialogs/more-info/ha-more-info-dialog") ); } }; From 52087c0e30405fe48ee49e72aa4068f9abdc1541 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 19 May 2021 00:11:24 +0200 Subject: [PATCH 064/117] Fix _initialize (#9206) * Fix _initialize * Update ha-demo.ts --- cast/src/receiver/layout/hc-demo.ts | 4 ++-- demo/src/ha-demo.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cast/src/receiver/layout/hc-demo.ts b/cast/src/receiver/layout/hc-demo.ts index 763d6baa59..a5822ebe97 100644 --- a/cast/src/receiver/layout/hc-demo.ts +++ b/cast/src/receiver/layout/hc-demo.ts @@ -33,10 +33,10 @@ class HcDemo extends HassElement { protected firstUpdated(changedProps) { super.firstUpdated(changedProps); - this._initialize(); + this._initializeHass(); } - private async _initialize() { + private async _initializeHass() { const initial: Partial = { // Override updateHass so that the correct hass lifecycle methods are called updateHass: (hassUpdate: Partial) => diff --git a/demo/src/ha-demo.ts b/demo/src/ha-demo.ts index 921420e45b..70bcbb50d4 100644 --- a/demo/src/ha-demo.ts +++ b/demo/src/ha-demo.ts @@ -22,9 +22,9 @@ import { mockTemplate } from "./stubs/template"; import { mockTranslations } from "./stubs/translations"; class HaDemo extends HomeAssistantAppEl { - protected async _initialize() { + protected async _initializeHass() { const initial: Partial = { - panelUrl: (this as any).panelUrl, + panelUrl: (this as any)._panelUrl, // Override updateHass so that the correct hass lifecycle methods are called updateHass: (hassUpdate: Partial) => this._updateHass(hassUpdate), From cb14e1f20cabb42e57fcbc4737fbac36df68258a Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 18 May 2021 15:12:08 -0700 Subject: [PATCH 065/117] Bumped version to 20210518.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0bc0a1fedd..1ccb1fc0de 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20210517.0", + version="20210518.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", From 0dcf673b8783d7768162d55f60e7e9b5c9e350ca Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 19 May 2021 01:50:13 +0000 Subject: [PATCH 066/117] Translation update --- translations/frontend/ko.json | 2 ++ translations/frontend/nb.json | 6 +++++- translations/frontend/nl.json | 18 +++++++++++++----- translations/frontend/zh-Hans.json | 4 +++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/translations/frontend/ko.json b/translations/frontend/ko.json index f59a7f765f..436c954629 100644 --- a/translations/frontend/ko.json +++ b/translations/frontend/ko.json @@ -2918,6 +2918,8 @@ "follow_device_instructions": "기기를 연결하려면 기기의 설명서를 따라주세요.", "inclusion_failed": "노드를 추가할 수 없습니다. 자세한 내용은 로그를 확인해주세요.", "inclusion_finished": "노드가 추가되었습니다. 백그라운드에서 노드 설정을 마치면 모든 구성요소가 표시되는 데 몇 분 정도 걸릴 수 있습니다.", + "interview_failed": "장치 인터뷰에 실패했습니다. 로그에서 추가 정보를 확인할 수 있습니다.", + "interview_started": "장치가 인터뷰중입니다. 시간이 좀 걸릴 수 있습니다.", "introduction": "이 마법사는 Z-Wave 네트워크에 노드를 추가하는 과정을 안내해드립니다.", "secure_inclusion_warning": "보안 기기에는 추가 대역폭이 필요합니다. 보안 기기가 너무 많으면 Z-Wave 네트워크의 속도가 느려질 수 있습니다. 잠금장치나 차고 문 개폐기와 같이 보안이 필요한 기기에만 보안 포함을 사용하는 것이 좋습니다.", "start_inclusion": "연결 시작하기", diff --git a/translations/frontend/nb.json b/translations/frontend/nb.json index 1d6f5abef8..54cf0b3057 100644 --- a/translations/frontend/nb.json +++ b/translations/frontend/nb.json @@ -2588,6 +2588,8 @@ "add_scene": "Legg til scene", "delete_confirm": "Er du sikker på at du vil slette denne scenen?", "delete_scene": "Slett scene", + "duplicate": "Duplisere", + "duplicate_scene": "Dupliser scenen", "edit_scene": "Rediger scene", "header": "Sceneditor", "headers": { @@ -2915,7 +2917,9 @@ "controller_in_inclusion_mode": "Z-Wave-kontrolleren er nå i inkluderingsmodus", "follow_device_instructions": "Følg instruksjonene som fulgte med enheten for å utløse sammenkobling på enheten", "inclusion_failed": "Noden kunne ikke legges til. Vennligst sjekk loggene for mer informasjon.", - "inclusion_finished": "Noden er lagt til. Det kan ta noen minutter før alle entiteter dukker opp når vi er ferdig med å sette opp noden i bakgrunnen.", + "inclusion_finished": "Noden er lagt til.", + "interview_failed": "Enhetsintervjuet mislyktes. Ytterligere informasjon kan være tilgjengelig i loggene.", + "interview_started": "Enheten blir intervjuet. Dette kan ta litt tid.", "introduction": "Denne veiviseren vil guide deg gjennom å legge til en node i Z-Wave-nettverket ditt", "secure_inclusion_warning": "Sikre enheter krever ekstra båndbredde; for mange sikre enheter kan redusere Z-Wave-nettverket. Vi anbefaler bare å bruke sikker inkludering for enheter som krever det, for eksempel låser eller garasjeportåpnere.", "start_inclusion": "Start inkludering", diff --git a/translations/frontend/nl.json b/translations/frontend/nl.json index f272d7b1e8..c059e97339 100644 --- a/translations/frontend/nl.json +++ b/translations/frontend/nl.json @@ -1588,7 +1588,7 @@ "sun": { "event": "Gebeurtenis:", "label": "Zon", - "offset": "Afwijking (optioneel)", + "offset": "Offset (optioneel)", "sunrise": "Zonsopkomst", "sunset": "Zonsondergang" }, @@ -2169,7 +2169,7 @@ "license": "Gepubliceerd onder de Apache 2.0-licentie", "path_configuration": "Pad naar configuration.yaml: {path}", "server": "Server", - "setup_time": "Setup tijd", + "setup_time": "Insteltijd", "source": "Bron:", "system_health_error": "De systeemstatus component is niet geladen. Voeg ' system_health: ' toe aan het configuratiebestand.", "system_health": { @@ -2701,7 +2701,7 @@ }, "validation": { "check_config": "Controleer configuratie", - "heading": "Configuratie validatie", + "heading": "Valideer configuratie", "introduction": "Controleer je configuratie als je onlangs wijzigingen hebt aangebracht en zeker wilt weten dat ze geldig zijn", "invalid": "Ongeldige configuratie", "valid": "Geldige configuratie!" @@ -2917,7 +2917,9 @@ "controller_in_inclusion_mode": "Uw Z-Wave controller bevindt zich nu in de opnamemodus.", "follow_device_instructions": "Volg de aanwijzingen die bij het apparaat zijn geleverd om de koppeling van het apparaat te activeren.", "inclusion_failed": "Het knooppunt kon niet worden toegevoegd. Controleer de logs voor meer informatie.", - "inclusion_finished": "Het knooppunt is toegevoegd. Het kan een paar minuten duren voordat alle entiteiten zichtbaar zijn, omdat we het opzetten van het knooppunt op de achtergrond afwerken.", + "inclusion_finished": "Het knooppunt is toegevoegd.", + "interview_failed": "Het apparaat \"interview\" is mislukt. Aanvullende informatie is mogelijk beschikbaar in de logboeken.", + "interview_started": "Het apparaat wordt \"geïnterviewd\". Dit kan wat tijd kosten.", "introduction": "Deze wizard begeleidt u bij het toevoegen van een knooppunt aan uw Z-Wave netwerk.", "secure_inclusion_warning": "Beveiligde apparaten vereisen extra bandbreedte; te veel beveiligde apparaten kunnen uw Z-Wave-netwerk vertragen. We raden aan om alleen veilige opname te gebruiken voor apparaten die dat vereisen, zoals sloten of garagedeuropeners.", "start_inclusion": "Start Opname", @@ -2989,8 +2991,14 @@ "unknown": "Onbekend" }, "reinterview_node": { + "battery_device_warning": "U moet apparaten met batterijvoeding uit de slaapstand halen voordat u een nieuw \"interview\" begint. Raadpleeg de handleiding van uw apparaat voor instructies over hoe u het apparaat uit de slaapstand haalt.", + "in_progress": "Het apparaat wordt \"geïnterviewd\". Dit kan wat tijd kosten.", "interview_complete": "Apparaat interview voltooid.", - "interview_failed": "Het apparaat interview is mislukt. Aanvullende informatie is mogelijk beschikbaar in de logboeken." + "interview_failed": "Het apparaat \"interview\" is mislukt. Aanvullende informatie is mogelijk beschikbaar in de logboeken.", + "introduction": "\"Interview\" een apparaat op uw Z-Wave-netwerk opnieuw. Gebruik deze functie als uw apparaat een ontbrekende of onjuiste functionaliteit heeft.", + "run_in_background": "U kunt dit dialoogvenster sluiten en het \"interview\" zal op de achtergrond worden voortgezet.", + "start_reinterview": "Start opnieuw \"interview\"", + "title": "\"Interview\" een Z-Wave-apparaat opnieuw" }, "remove_node": { "cancel_exclusion": "Uitsluiting annuleren", diff --git a/translations/frontend/zh-Hans.json b/translations/frontend/zh-Hans.json index 290b56986c..852b197688 100644 --- a/translations/frontend/zh-Hans.json +++ b/translations/frontend/zh-Hans.json @@ -2917,7 +2917,9 @@ "controller_in_inclusion_mode": "您的 Z-Wave 控制器现在处于 inclusion 模式。", "follow_device_instructions": "请按照设备说明书,触发设备配对。", "inclusion_failed": "无法添加该节点。请查看日志以了解更多信息。", - "inclusion_finished": "节点已添加。需要花费几分钟在后台完成节点设置,然后才能显示出所有实体。", + "inclusion_finished": "节点已添加。", + "interview_failed": "设备协商失败。日志中会有更多信息。", + "interview_started": "设备正在重新协商。可能需要一段时间。", "introduction": "此向导将指导您向 Z-Wave 网络添加节点。", "secure_inclusion_warning": "安全设备需要额外的带宽;安全设备过多可能会降低 Z-Wave 网络的速度。建议仅当设备需要时才使用 secure inclusion,例如门锁和车库开门器。", "start_inclusion": "开始 inclusion", From e211d812ad7083af0b3e301ea8c0289a70635194 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 20 May 2021 01:50:44 +0000 Subject: [PATCH 067/117] Translation update --- translations/frontend/af.json | 29 +++++++++++++++++++++++++++++ translations/frontend/es.json | 2 +- translations/frontend/zh-Hant.json | 4 +++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/translations/frontend/af.json b/translations/frontend/af.json index ae1eaaf418..b225047649 100644 --- a/translations/frontend/af.json +++ b/translations/frontend/af.json @@ -79,6 +79,19 @@ "unknown": "Onbekend" } }, + "supervisor": { + "my": { + "error_addon_no_ingress": "Die aangevraagde byvoegsel ondersteun nie ingryping nie" + }, + "snapshot": { + "created": "Geskep" + }, + "system": { + "supervisor": { + "search": "Soek" + } + } + }, "ui": { "auth_store": { "ask": "Wil u hierdie aanmelding stoor?", @@ -635,6 +648,13 @@ "account": { "google": { "sync_entities_404_message": "Kon nie u entiteite met Google sinkroniseer nie, vra Google 'Hallo Google, sinkroniseer my toestelle' om u entiteite te sinkroniseer." + }, + "remote": { + "not_connected": "Nie gekoppel nie", + "remote_enabled": { + "caption": "Verbind outomaties", + "description": "Skakel hierdie opsie in om seker te maak dat u Home Assistent-instansie altyd op afstand toeganklik is." + } } }, "description_features": "Beheer terwyl weg van die huis af is, integreer met Alexa en Google Assistant.", @@ -819,6 +839,7 @@ "open_site": "Maak webwerf oop" }, "finish": "Klaar", + "next": "Volgende", "not_all_required_fields": "Nie alle vereiste velde is gevul nie.", "submit": "Dien in" }, @@ -966,6 +987,8 @@ "add_scene": "Voeg toneel by", "delete_confirm": "Is u seker dat u hierdie toneel wil uitvee?", "delete_scene": "Verwyder toneel", + "duplicate": "Dupliseer", + "duplicate_scene": "Duplikaat toneel", "edit_scene": "Wysig toneel", "header": "Toneel-Redakteur", "introduction": "Die toneel redakteur kan jy om te skep en wysig skerms. Volg asseblief die skakel hieronder om die instruksies te lees om seker te maak dat jy het ingestel Huis Assistent korrek.", @@ -1089,6 +1112,12 @@ "introduction": "Met sones kan u sekere streke op aarde spesifiseer. As 'n persoon binne 'n sone is, neem die toestand die sonenaam aan. Sones kan ook as 'n sneller of toestand gebruik word in outomatiseringsinstellings.", "no_zones_created_yet": "Lyk asof jy nog geen sones geskep het nie." }, + "zwave_js": { + "add_node": { + "interview_failed": "Die toestelonderhoud het misluk. Bykomende inligting kan moontlik in die logboeke beskikbaar wees.", + "interview_started": "Die toestel word ondervra. Dit kan 'n geruime tyd neem." + } + }, "zwave": { "common": { "index": "Indeks", diff --git a/translations/frontend/es.json b/translations/frontend/es.json index 01459061e6..2df7daeb2b 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -3607,7 +3607,7 @@ "unsaved_changes": "Cambios no guardados" }, "save_config": { - "cancel": "No importa", + "cancel": "Cancelar", "close": "Cerrar", "empty_config": "Empezar con un panel de control vacío", "header": "Tomar el control de la interfaz de usuario Lovelace", diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index 3561143f6c..c71d65162b 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -2917,7 +2917,9 @@ "controller_in_inclusion_mode": "Z-Wave 控制器目前處於登記模式。", "follow_device_instructions": "跟隨裝置隨附的說明書以觸發裝置上的配對功能。", "inclusion_failed": "節點無法新增,請參閱日誌以獲得更詳細資訊。", - "inclusion_finished": "節點已經新增。由於於後台完成設定、可能需要一點時間以讓所有節點進行顯示。", + "inclusion_finished": "節點已經新增。", + "interview_failed": "裝置探訪失敗。日誌中可能包含其他相關資訊。", + "interview_started": "正在探訪裝置,可能需要一點時間。", "introduction": "導引將帶領你於 Z-Wave 網路中新增節點。", "secure_inclusion_warning": "加密裝置需要額外的頻寬,過多的加密裝置可能拖慢您的 Z-Wave 網路。建議您僅於需要時才使用加密裝置登記、例如門鎖或車庫開門裝置。", "start_inclusion": "開始登記", From 3d0a5642ccc8568922996e727266c02881cdaa26 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 20 May 2021 14:23:50 +0200 Subject: [PATCH 068/117] Only apply on Safari 14.0, and not 14.0.1 --- src/resources/safari-14-attachshadow-patch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/safari-14-attachshadow-patch.ts b/src/resources/safari-14-attachshadow-patch.ts index 597e0f480e..88954ab4d2 100644 --- a/src/resources/safari-14-attachshadow-patch.ts +++ b/src/resources/safari-14-attachshadow-patch.ts @@ -1,5 +1,5 @@ // https://github.com/home-assistant/frontend/pull/7031 -const isSafari14 = /^((?!chrome|android).)*version\/14\.0.*safari/i.test( +const isSafari14 = /^((?!chrome|android).)*version\/14\.0\s.*safari/i.test( navigator.userAgent ); if (isSafari14) { From 87e4c209f4133b0dfb0dbb0e17e8125aceed0498 Mon Sep 17 00:00:00 2001 From: Brynley McDonald Date: Fri, 21 May 2021 01:29:32 +1200 Subject: [PATCH 069/117] Add icon to Entities card schema (#9208) --- .../lovelace/editor/config-elements/hui-entities-card-editor.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts index cbe983df57..5cac06cda6 100644 --- a/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts @@ -44,6 +44,7 @@ const cardConfigStruct = object({ title: optional(union([string(), boolean()])), entity: optional(entityId()), theme: optional(string()), + icon: optional(string()), show_header_toggle: optional(boolean()), state_color: optional(boolean()), entities: array(entitiesConfigStruct), From 70a1edd1dd4129f545b5e133491cb3e15813ac61 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Thu, 20 May 2021 16:23:53 +0200 Subject: [PATCH 070/117] Allow users to select time format for UI rendering (#9042) Co-authored-by: Bram Kragten --- src/common/datetime/format_date.ts | 37 ++++++---- src/common/datetime/format_date_time.ts | 56 +++++++++------ src/common/datetime/format_time.ts | 65 +++++++++++------ src/common/datetime/use_am_pm.ts | 15 ++++ src/common/entity/compute_state_display.ts | 4 +- src/common/string/format_number.ts | 4 +- src/components/ha-date-range-picker.ts | 13 +--- src/components/ha-gauge.ts | 4 +- .../ha-selector/ha-selector-time.ts | 14 ++-- src/data/history.ts | 4 +- src/data/translation.ts | 14 +++- src/fake_data/provide_hass.ts | 3 +- src/panels/config/logs/util.ts | 4 +- .../components/hui-timestamp-display.ts | 4 +- src/panels/lovelace/types.ts | 4 +- src/panels/profile/ha-panel-profile.ts | 5 ++ .../profile/ha-pick-number-format-row.ts | 4 +- src/panels/profile/ha-pick-time-format-row.ts | 72 +++++++++++++++++++ src/state/connection-mixin.ts | 3 +- src/state/translations-mixin.ts | 23 ++++++ src/translations/en.json | 11 +++ src/types.ts | 13 ++-- src/util/hass-translation.ts | 7 +- test-mocha/common/datetime/format_date.ts | 3 +- .../common/datetime/format_date_time.ts | 28 ++++++-- test-mocha/common/datetime/format_time.ts | 28 ++++++-- .../common/entity/compute_state_display.ts | 66 +++++++++++------ test-mocha/common/string/format_number.ts | 61 ++++++---------- test-mocha/tsconfig.test.json | 3 +- 29 files changed, 397 insertions(+), 175 deletions(-) create mode 100644 src/common/datetime/use_am_pm.ts create mode 100644 src/panels/profile/ha-pick-time-format-row.ts diff --git a/src/common/datetime/format_date.ts b/src/common/datetime/format_date.ts index c7c02d38fe..fa82187a46 100644 --- a/src/common/datetime/format_date.ts +++ b/src/common/datetime/format_date.ts @@ -1,21 +1,32 @@ import { format } from "fecha"; -import { FrontendTranslationData } from "../../data/translation"; +import memoizeOne from "memoize-one"; +import { FrontendLocaleData } from "../../data/translation"; import { toLocaleDateStringSupportsOptions } from "./check_options_support"; +const formatDateMem = memoizeOne( + (locale: FrontendLocaleData) => + new Intl.DateTimeFormat(locale.language, { + year: "numeric", + month: "long", + day: "numeric", + }) +); + export const formatDate = toLocaleDateStringSupportsOptions - ? (dateObj: Date, locales: FrontendTranslationData) => - dateObj.toLocaleDateString(locales.language, { - year: "numeric", - month: "long", - day: "numeric", - }) + ? (dateObj: Date, locale: FrontendLocaleData) => + formatDateMem(locale).format(dateObj) : (dateObj: Date) => format(dateObj, "longDate"); +const formatDateWeekdayMem = memoizeOne( + (locale: FrontendLocaleData) => + new Intl.DateTimeFormat(locale.language, { + weekday: "long", + month: "long", + day: "numeric", + }) +); + export const formatDateWeekday = toLocaleDateStringSupportsOptions - ? (dateObj: Date, locales: FrontendTranslationData) => - dateObj.toLocaleDateString(locales.language, { - weekday: "long", - month: "short", - day: "numeric", - }) + ? (dateObj: Date, locale: FrontendLocaleData) => + formatDateWeekdayMem(locale).format(dateObj) : (dateObj: Date) => format(dateObj, "dddd, MMM D"); diff --git a/src/common/datetime/format_date_time.ts b/src/common/datetime/format_date_time.ts index d4b76a1da6..850e82b185 100644 --- a/src/common/datetime/format_date_time.ts +++ b/src/common/datetime/format_date_time.ts @@ -1,26 +1,42 @@ import { format } from "fecha"; -import { FrontendTranslationData } from "../../data/translation"; +import memoizeOne from "memoize-one"; +import { FrontendLocaleData } from "../../data/translation"; import { toLocaleStringSupportsOptions } from "./check_options_support"; +import { useAmPm } from "./use_am_pm"; + +const formatDateTimeMem = memoizeOne( + (locale: FrontendLocaleData) => + new Intl.DateTimeFormat(locale.language, { + year: "numeric", + month: "long", + day: "numeric", + hour: "numeric", + minute: "2-digit", + hour12: useAmPm(locale), + }) +); export const formatDateTime = toLocaleStringSupportsOptions - ? (dateObj: Date, locales: FrontendTranslationData) => - dateObj.toLocaleString(locales.language, { - year: "numeric", - month: "long", - day: "numeric", - hour: "numeric", - minute: "2-digit", - }) - : (dateObj: Date) => format(dateObj, "MMMM D, YYYY, HH:mm"); + ? (dateObj: Date, locale: FrontendLocaleData) => + formatDateTimeMem(locale).format(dateObj) + : (dateObj: Date, locale: FrontendLocaleData) => + format(dateObj, "MMMM D, YYYY, HH:mm" + useAmPm(locale) ? " A" : ""); + +const formatDateTimeWithSecondsMem = memoizeOne( + (locale: FrontendLocaleData) => + new Intl.DateTimeFormat(locale.language, { + year: "numeric", + month: "long", + day: "numeric", + hour: "numeric", + minute: "2-digit", + second: "2-digit", + hour12: useAmPm(locale), + }) +); export const formatDateTimeWithSeconds = toLocaleStringSupportsOptions - ? (dateObj: Date, locales: FrontendTranslationData) => - dateObj.toLocaleString(locales.language, { - year: "numeric", - month: "long", - day: "numeric", - hour: "numeric", - minute: "2-digit", - second: "2-digit", - }) - : (dateObj: Date) => format(dateObj, "MMMM D, YYYY, HH:mm:ss"); + ? (dateObj: Date, locale: FrontendLocaleData) => + formatDateTimeWithSecondsMem(locale).format(dateObj) + : (dateObj: Date, locale: FrontendLocaleData) => + format(dateObj, "MMMM D, YYYY, HH:mm:ss" + useAmPm(locale) ? " A" : ""); diff --git a/src/common/datetime/format_time.ts b/src/common/datetime/format_time.ts index d2068f7638..14bbdf8e53 100644 --- a/src/common/datetime/format_time.ts +++ b/src/common/datetime/format_time.ts @@ -1,29 +1,52 @@ import { format } from "fecha"; -import { FrontendTranslationData } from "../../data/translation"; +import memoizeOne from "memoize-one"; +import { FrontendLocaleData } from "../../data/translation"; import { toLocaleTimeStringSupportsOptions } from "./check_options_support"; +import { useAmPm } from "./use_am_pm"; + +const formatTimeMem = memoizeOne( + (locale: FrontendLocaleData) => + new Intl.DateTimeFormat(locale.language, { + hour: "numeric", + minute: "2-digit", + hour12: useAmPm(locale), + }) +); export const formatTime = toLocaleTimeStringSupportsOptions - ? (dateObj: Date, locales: FrontendTranslationData) => - dateObj.toLocaleTimeString(locales.language, { - hour: "numeric", - minute: "2-digit", - }) - : (dateObj: Date) => format(dateObj, "shortTime"); + ? (dateObj: Date, locale: FrontendLocaleData) => + formatTimeMem(locale).format(dateObj) + : (dateObj: Date, locale: FrontendLocaleData) => + format(dateObj, "shortTime" + useAmPm(locale) ? " A" : ""); + +const formatTimeWithSecondsMem = memoizeOne( + (locale: FrontendLocaleData) => + new Intl.DateTimeFormat(locale.language, { + hour: "numeric", + minute: "2-digit", + second: "2-digit", + hour12: useAmPm(locale), + }) +); export const formatTimeWithSeconds = toLocaleTimeStringSupportsOptions - ? (dateObj: Date, locales: FrontendTranslationData) => - dateObj.toLocaleTimeString(locales.language, { - hour: "numeric", - minute: "2-digit", - second: "2-digit", - }) - : (dateObj: Date) => format(dateObj, "mediumTime"); + ? (dateObj: Date, locale: FrontendLocaleData) => + formatTimeWithSecondsMem(locale).format(dateObj) + : (dateObj: Date, locale: FrontendLocaleData) => + format(dateObj, "mediumTime" + useAmPm(locale) ? " A" : ""); + +const formatTimeWeekdayMem = memoizeOne( + (locale: FrontendLocaleData) => + new Intl.DateTimeFormat(locale.language, { + weekday: "long", + hour: "numeric", + minute: "2-digit", + hour12: useAmPm(locale), + }) +); export const formatTimeWeekday = toLocaleTimeStringSupportsOptions - ? (dateObj: Date, locales: FrontendTranslationData) => - dateObj.toLocaleTimeString(locales.language, { - weekday: "long", - hour: "numeric", - minute: "2-digit", - }) - : (dateObj: Date) => format(dateObj, "dddd, HH:mm"); + ? (dateObj: Date, locale: FrontendLocaleData) => + formatTimeWeekdayMem(locale).format(dateObj) + : (dateObj: Date, locale: FrontendLocaleData) => + format(dateObj, "dddd, HH:mm" + useAmPm(locale) ? " A" : ""); diff --git a/src/common/datetime/use_am_pm.ts b/src/common/datetime/use_am_pm.ts new file mode 100644 index 0000000000..cf5b2c124e --- /dev/null +++ b/src/common/datetime/use_am_pm.ts @@ -0,0 +1,15 @@ +import { FrontendLocaleData, TimeFormat } from "../../data/translation"; + +export const useAmPm = (locale: FrontendLocaleData): boolean => { + if ( + locale.time_format === TimeFormat.language || + locale.time_format === TimeFormat.system + ) { + const testLanguage = + locale.time_format === TimeFormat.language ? locale.language : undefined; + const test = new Date().toLocaleString(testLanguage); + return test.includes("AM") || test.includes("PM"); + } + + return locale.time_format === TimeFormat.am_pm; +}; diff --git a/src/common/entity/compute_state_display.ts b/src/common/entity/compute_state_display.ts index d4e77ce4e9..8165f6daf7 100644 --- a/src/common/entity/compute_state_display.ts +++ b/src/common/entity/compute_state_display.ts @@ -1,6 +1,6 @@ import { HassEntity } from "home-assistant-js-websocket"; import { UNAVAILABLE, UNKNOWN } from "../../data/entity"; -import { FrontendTranslationData } from "../../data/translation"; +import { FrontendLocaleData } from "../../data/translation"; import { formatDate } from "../datetime/format_date"; import { formatDateTime } from "../datetime/format_date_time"; import { formatTime } from "../datetime/format_time"; @@ -11,7 +11,7 @@ import { computeStateDomain } from "./compute_state_domain"; export const computeStateDisplay = ( localize: LocalizeFunc, stateObj: HassEntity, - locale: FrontendTranslationData, + locale: FrontendLocaleData, state?: string ): string => { const compareState = state !== undefined ? state : stateObj.state; diff --git a/src/common/string/format_number.ts b/src/common/string/format_number.ts index da8af2798a..2cfa22458b 100644 --- a/src/common/string/format_number.ts +++ b/src/common/string/format_number.ts @@ -1,4 +1,4 @@ -import { FrontendTranslationData, NumberFormat } from "../../data/translation"; +import { FrontendLocaleData, NumberFormat } from "../../data/translation"; /** * Formats a number based on the user's preference with thousands separator(s) and decimal character for better legibility. @@ -9,7 +9,7 @@ import { FrontendTranslationData, NumberFormat } from "../../data/translation"; */ export const formatNumber = ( num: string | number, - locale?: FrontendTranslationData, + locale?: FrontendLocaleData, options?: Intl.NumberFormatOptions ): string => { let format: string | string[] | undefined; diff --git a/src/components/ha-date-range-picker.ts b/src/components/ha-date-range-picker.ts index 15d8df0d79..2940c3a883 100644 --- a/src/components/ha-date-range-picker.ts +++ b/src/components/ha-date-range-picker.ts @@ -14,6 +14,7 @@ import { } from "lit"; import { customElement, property } from "lit/decorators"; import { formatDateTime } from "../common/datetime/format_date_time"; +import { useAmPm } from "../common/datetime/use_am_pm"; import { computeRTLDirection } from "../common/util/compute_rtl"; import { HomeAssistant } from "../types"; import "./date-range-picker"; @@ -43,7 +44,7 @@ export class HaDateRangePicker extends LitElement { if (changedProps.has("hass")) { const oldHass = changedProps.get("hass") as HomeAssistant | undefined; if (!oldHass || oldHass.locale !== this.hass.locale) { - this._hour24format = this._compute24hourFormat(); + this._hour24format = !useAmPm(this.hass.locale); this._rtlDirection = computeRTLDirection(this.hass); } } @@ -106,16 +107,6 @@ export class HaDateRangePicker extends LitElement { `; } - private _compute24hourFormat() { - return ( - new Intl.DateTimeFormat(this.hass.language, { - hour: "numeric", - }) - .formatToParts(new Date(2020, 0, 1, 13)) - .find((part) => part.type === "hour")!.value.length === 2 - ); - } - private _setDateRange(ev: CustomEvent) { const dateRange = Object.values(this.ranges!)[ev.detail.index]; const dateRangePicker = this._dateRangePicker; diff --git a/src/components/ha-gauge.ts b/src/components/ha-gauge.ts index 19fb9a4572..26b4ae52aa 100644 --- a/src/components/ha-gauge.ts +++ b/src/components/ha-gauge.ts @@ -4,7 +4,7 @@ import { ifDefined } from "lit/directives/if-defined"; import { styleMap } from "lit/directives/style-map"; import { formatNumber } from "../common/string/format_number"; import { afterNextRender } from "../common/util/render-status"; -import { FrontendTranslationData } from "../data/translation"; +import { FrontendLocaleData } from "../data/translation"; import { getValueInPercentage, normalize } from "../util/calculate"; const getAngle = (value: number, min: number, max: number) => { @@ -23,7 +23,7 @@ export class Gauge extends LitElement { @property({ type: Number }) public value = 0; - @property() public locale!: FrontendTranslationData; + @property() public locale!: FrontendLocaleData; @property() public label = ""; diff --git a/src/components/ha-selector/ha-selector-time.ts b/src/components/ha-selector/ha-selector-time.ts index 48b57def22..84ab97c8da 100644 --- a/src/components/ha-selector/ha-selector-time.ts +++ b/src/components/ha-selector/ha-selector-time.ts @@ -1,10 +1,13 @@ import { html, LitElement } from "lit"; import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; +import { useAmPm } from "../../common/datetime/use_am_pm"; import { fireEvent } from "../../common/dom/fire_event"; import { TimeSelector } from "../../data/selector"; +import { FrontendLocaleData } from "../../data/translation"; import { HomeAssistant } from "../../types"; import "../paper-time-input"; + @customElement("ha-selector-time") export class HaTimeSelector extends LitElement { @property() public hass!: HomeAssistant; @@ -17,13 +20,12 @@ export class HaTimeSelector extends LitElement { @property({ type: Boolean }) public disabled = false; - private _useAmPm = memoizeOne((language: string) => { - const test = new Date().toLocaleString(language); - return test.includes("AM") || test.includes("PM"); - }); + private _useAmPmMem = memoizeOne((locale: FrontendLocaleData): boolean => + useAmPm(locale) + ); protected render() { - const useAMPM = this._useAmPm(this.hass.locale.language); + const useAMPM = this._useAmPmMem(this.hass.locale); const parts = this.value?.split(":") || []; const hours = parts[0]; @@ -48,7 +50,7 @@ export class HaTimeSelector extends LitElement { private _timeChanged(ev) { let value = ev.target.value; - const useAMPM = this._useAmPm(this.hass.locale.language); + const useAMPM = this._useAmPmMem(this.hass.locale); let hours = Number(ev.target.hour || 0); if (value && useAMPM) { if (ev.target.amPm === "PM") { diff --git a/src/data/history.ts b/src/data/history.ts index 92c4a2caf8..636698caf7 100644 --- a/src/data/history.ts +++ b/src/data/history.ts @@ -4,7 +4,7 @@ import { computeStateDomain } from "../common/entity/compute_state_domain"; import { computeStateName } from "../common/entity/compute_state_name"; import { LocalizeFunc } from "../common/translations/localize"; import { HomeAssistant } from "../types"; -import { FrontendTranslationData } from "./translation"; +import { FrontendLocaleData } from "./translation"; const DOMAINS_USE_LAST_UPDATED = ["climate", "humidifier", "water_heater"]; const LINE_ATTRIBUTES_TO_KEEP = [ @@ -109,7 +109,7 @@ const equalState = (obj1: LineChartState, obj2: LineChartState) => const processTimelineEntity = ( localize: LocalizeFunc, - language: FrontendTranslationData, + language: FrontendLocaleData, states: HassEntity[] ): TimelineEntity => { const data: TimelineState[] = []; diff --git a/src/data/translation.ts b/src/data/translation.ts index d2fc74e560..65f98a059d 100644 --- a/src/data/translation.ts +++ b/src/data/translation.ts @@ -10,14 +10,22 @@ export enum NumberFormat { none = "none", } -export interface FrontendTranslationData { +export enum TimeFormat { + language = "language", + system = "system", + am_pm = "12", + twenty_four = "24", +} + +export interface FrontendLocaleData { language: string; number_format: NumberFormat; + time_format: TimeFormat; } declare global { interface FrontendUserData { - language: FrontendTranslationData; + language: FrontendLocaleData; } } @@ -36,7 +44,7 @@ export const fetchTranslationPreferences = (hass: HomeAssistant) => export const saveTranslationPreferences = ( hass: HomeAssistant, - data: FrontendTranslationData + data: FrontendLocaleData ) => saveFrontendUserData(hass.connection, "language", data); export const getHassTranslations = async ( diff --git a/src/fake_data/provide_hass.ts b/src/fake_data/provide_hass.ts index 6249f441f5..d537ffa80e 100644 --- a/src/fake_data/provide_hass.ts +++ b/src/fake_data/provide_hass.ts @@ -5,7 +5,7 @@ import { } from "../common/dom/apply_themes_on_element"; import { computeLocalize } from "../common/translations/localize"; import { DEFAULT_PANEL } from "../data/panel"; -import { NumberFormat } from "../data/translation"; +import { NumberFormat, TimeFormat } from "../data/translation"; import { translationMetadata } from "../resources/translations-metadata"; import { HomeAssistant } from "../types"; import { getLocalLanguage, getTranslation } from "../util/hass-translation"; @@ -215,6 +215,7 @@ export const provideHass = ( locale: { language: localLanguage, number_format: NumberFormat.language, + time_format: TimeFormat.language, }, resources: null as any, localize: () => "", diff --git a/src/panels/config/logs/util.ts b/src/panels/config/logs/util.ts index ebe74c2e06..3eb92fcd96 100644 --- a/src/panels/config/logs/util.ts +++ b/src/panels/config/logs/util.ts @@ -1,8 +1,8 @@ import { formatDateTimeWithSeconds } from "../../../common/datetime/format_date_time"; import { formatTimeWithSeconds } from "../../../common/datetime/format_time"; -import { FrontendTranslationData } from "../../../data/translation"; +import { FrontendLocaleData } from "../../../data/translation"; -export const formatSystemLogTime = (date, locale: FrontendTranslationData) => { +export const formatSystemLogTime = (date, locale: FrontendLocaleData) => { const today = new Date().setHours(0, 0, 0, 0); const dateTime = new Date(date * 1000); const dateTimeDay = new Date(date * 1000).setHours(0, 0, 0, 0); diff --git a/src/panels/lovelace/components/hui-timestamp-display.ts b/src/panels/lovelace/components/hui-timestamp-display.ts index 40b9abf17b..086ba6b13d 100644 --- a/src/panels/lovelace/components/hui-timestamp-display.ts +++ b/src/panels/lovelace/components/hui-timestamp-display.ts @@ -4,12 +4,12 @@ import { formatDate } from "../../../common/datetime/format_date"; import { formatDateTime } from "../../../common/datetime/format_date_time"; import { formatTime } from "../../../common/datetime/format_time"; import relativeTime from "../../../common/datetime/relative_time"; -import { FrontendTranslationData } from "../../../data/translation"; +import { FrontendLocaleData } from "../../../data/translation"; import { HomeAssistant } from "../../../types"; import { TimestampRenderingFormats } from "./types"; const FORMATS: { - [key: string]: (ts: Date, lang: FrontendTranslationData) => string; + [key: string]: (ts: Date, lang: FrontendLocaleData) => string; } = { date: formatDate, datetime: formatDateTime, diff --git a/src/panels/lovelace/types.ts b/src/panels/lovelace/types.ts index f9763be955..070c5ef761 100644 --- a/src/panels/lovelace/types.ts +++ b/src/panels/lovelace/types.ts @@ -3,7 +3,7 @@ import { LovelaceCardConfig, LovelaceConfig, } from "../../data/lovelace"; -import { FrontendTranslationData } from "../../data/translation"; +import { FrontendLocaleData } from "../../data/translation"; import { Constructor, HomeAssistant } from "../../types"; import { LovelaceRow, LovelaceRowConfig } from "./entity-rows/types"; import { LovelaceHeaderFooterConfig } from "./header-footer/types"; @@ -23,7 +23,7 @@ export interface Lovelace { editMode: boolean; urlPath: string | null; mode: "generated" | "yaml" | "storage"; - locale: FrontendTranslationData; + locale: FrontendLocaleData; enableFullEditMode: () => void; setEditMode: (editMode: boolean) => void; saveConfig: (newConfig: LovelaceConfig) => Promise; diff --git a/src/panels/profile/ha-panel-profile.ts b/src/panels/profile/ha-panel-profile.ts index 7484c4ba3b..4d9b82c42c 100644 --- a/src/panels/profile/ha-panel-profile.ts +++ b/src/panels/profile/ha-panel-profile.ts @@ -29,6 +29,7 @@ import "./ha-pick-dashboard-row"; import "./ha-pick-language-row"; import "./ha-pick-number-format-row"; import "./ha-pick-theme-row"; +import "./ha-pick-time-format-row"; import "./ha-push-notifications-row"; import "./ha-refresh-tokens-card"; import "./ha-set-suspend-row"; @@ -96,6 +97,10 @@ class HaPanelProfile extends LitElement { .narrow=${this.narrow} .hass=${this.hass} > + ${Object.values(NumberFormat).map((format) => { const formattedNumber = formatNumber(1234567.89, { - language: this.hass.locale.language, + ...this.hass.locale, number_format: format, }); const value = this.hass.localize( @@ -48,7 +48,7 @@ class NumberFormatRow extends LitElement { ); const twoLine = value.slice(value.length - 2) !== "89"; // Display explicit number formats on one line return html` - +
${value}
${twoLine diff --git a/src/panels/profile/ha-pick-time-format-row.ts b/src/panels/profile/ha-pick-time-format-row.ts new file mode 100644 index 0000000000..686c186d17 --- /dev/null +++ b/src/panels/profile/ha-pick-time-format-row.ts @@ -0,0 +1,72 @@ +import "@polymer/paper-item/paper-item"; +import "@polymer/paper-listbox/paper-listbox"; +import { html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import { formatTime } from "../../common/datetime/format_time"; +import { fireEvent } from "../../common/dom/fire_event"; +import "../../components/ha-card"; +import "../../components/ha-paper-dropdown-menu"; +import "../../components/ha-settings-row"; +import { TimeFormat } from "../../data/translation"; +import { HomeAssistant } from "../../types"; + +@customElement("ha-pick-time-format-row") +class TimeFormatRow extends LitElement { + @property({ attribute: false }) public hass!: HomeAssistant; + + @property() public narrow!: boolean; + + protected render(): TemplateResult { + const date = new Date(); + return html` + + + ${this.hass.localize("ui.panel.profile.time_format.header")} + + + ${this.hass.localize("ui.panel.profile.time_format.description")} + + + + ${Object.values(TimeFormat).map((format) => { + const formattedTime = formatTime(date, { + ...this.hass.locale, + time_format: format, + }); + const value = this.hass.localize( + `ui.panel.profile.time_format.formats.${format}` + ); + return html` + +
${value}
+
${formattedTime}
+
+
`; + })} +
+
+
+ `; + } + + private async _handleFormatSelection(ev: CustomEvent) { + fireEvent(this, "hass-time-format-select", ev.detail.item.format); + } +} + +declare global { + interface HTMLElementTagNameMap { + "ha-pick-time-format-row": TimeFormatRow; + } +} diff --git a/src/state/connection-mixin.ts b/src/state/connection-mixin.ts index 86ea836210..7b54f8ffbb 100644 --- a/src/state/connection-mixin.ts +++ b/src/state/connection-mixin.ts @@ -15,7 +15,7 @@ import { subscribeFrontendUserData } from "../data/frontend"; import { forwardHaptic } from "../data/haptics"; import { DEFAULT_PANEL } from "../data/panel"; import { serviceCallWillDisconnect } from "../data/service"; -import { NumberFormat } from "../data/translation"; +import { NumberFormat, TimeFormat } from "../data/translation"; import { subscribePanels } from "../data/ws-panels"; import { translationMetadata } from "../resources/translations-metadata"; import { Constructor, ServiceCallResponse } from "../types"; @@ -49,6 +49,7 @@ export const connectionMixin = >( locale: { language, number_format: NumberFormat.language, + time_format: TimeFormat.language, }, resources: null as any, localize: () => "", diff --git a/src/state/translations-mixin.ts b/src/state/translations-mixin.ts index f22d4149c1..7e0ee332f2 100644 --- a/src/state/translations-mixin.ts +++ b/src/state/translations-mixin.ts @@ -7,6 +7,7 @@ import { getHassTranslationsPre109, NumberFormat, saveTranslationPreferences, + TimeFormat, TranslationCategory, } from "../data/translation"; import { translationMetadata } from "../resources/translations-metadata"; @@ -28,6 +29,9 @@ declare global { "hass-number-format-select": { number_format: NumberFormat; }; + "hass-time-format-select": { + time_format: TimeFormat; + }; } } @@ -64,6 +68,9 @@ export default >(superClass: T) => this.addEventListener("hass-number-format-select", (e) => { this._selectNumberFormat((e as CustomEvent).detail, true); }); + this.addEventListener("hass-time-format-select", (e) => { + this._selectTimeFormat((e as CustomEvent).detail, true); + }); this._loadCoreTranslations(getLocalLanguage()); } @@ -95,6 +102,13 @@ export default >(superClass: T) => // We just got number_format from backend, no need to save back this._selectNumberFormat(locale.number_format, false); } + if ( + locale?.time_format && + this.hass!.locale.time_format !== locale.time_format + ) { + // We just got time_format from backend, no need to save back + this._selectTimeFormat(locale.time_format, false); + } }); this.hass!.connection.subscribeEvents( @@ -133,6 +147,15 @@ export default >(superClass: T) => } } + private _selectTimeFormat(time_format: TimeFormat, saveToBackend: boolean) { + this._updateHass({ + locale: { ...this.hass!.locale, time_format: time_format }, + }); + if (saveToBackend) { + saveTranslationPreferences(this.hass!, this.hass!.locale); + } + } + private _selectLanguage(language: string, saveToBackend: boolean) { if (!this.hass) { // should not happen, do it to avoid use this.hass! diff --git a/src/translations/en.json b/src/translations/en.json index 670cff6250..739a5e9b83 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -3213,6 +3213,17 @@ "none": "None" } }, + "time_format": { + "header": "Time Format", + "dropdown_label": "Time format", + "description": "Choose how times are formatted.", + "formats": { + "language": "Auto (use language setting)", + "system": "Use system locale", + "12": "12 hours (AM/PM)", + "24": "24 hours" + } + }, "themes": { "header": "Theme", "error_no_theme": "No themes available.", diff --git a/src/types.ts b/src/types.ts index 102cdd31c1..7d9f88bf6c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -9,10 +9,7 @@ import { } from "home-assistant-js-websocket"; import { LocalizeFunc } from "./common/translations/localize"; import { CoreFrontendUserData } from "./data/frontend"; -import { - FrontendTranslationData, - getHassTranslations, -} from "./data/translation"; +import { FrontendLocaleData, getHassTranslations } from "./data/translation"; import { Themes } from "./data/ws-themes"; import { ExternalMessaging } from "./external_app/external_messaging"; @@ -198,14 +195,14 @@ export interface HomeAssistant { panelUrl: string; // i18n // current effective language in that order: - // - backend saved user selected lanugage - // - language in local appstorage + // - backend saved user selected language + // - language in local app storage // - browser language // - english (en) language: string; - // local stored language, keep that name for backward compability + // local stored language, keep that name for backward compatibility selectedLanguage: string | null; - locale: FrontendTranslationData; + locale: FrontendLocaleData; resources: Resources; localize: LocalizeFunc; translationMetadata: TranslationMetadata; diff --git a/src/util/hass-translation.ts b/src/util/hass-translation.ts index a203ec894e..fcf8767d03 100644 --- a/src/util/hass-translation.ts +++ b/src/util/hass-translation.ts @@ -1,6 +1,6 @@ import { fetchTranslationPreferences, - FrontendTranslationData, + FrontendLocaleData, } from "../data/translation"; import { translationMetadata } from "../resources/translations-metadata"; import { HomeAssistant } from "../types"; @@ -55,21 +55,24 @@ export function findAvailableLanguage(language: string) { */ export async function getUserLocale( hass: HomeAssistant -): Promise> { +): Promise> { const result = await fetchTranslationPreferences(hass); const language = result?.language; const number_format = result?.number_format; + const time_format = result?.time_format; if (language) { const availableLanguage = findAvailableLanguage(language); if (availableLanguage) { return { language: availableLanguage, number_format, + time_format, }; } } return { number_format, + time_format, }; } diff --git a/test-mocha/common/datetime/format_date.ts b/test-mocha/common/datetime/format_date.ts index 851c18f99d..f81a4d1a5d 100644 --- a/test-mocha/common/datetime/format_date.ts +++ b/test-mocha/common/datetime/format_date.ts @@ -1,7 +1,7 @@ import { assert } from "chai"; import { formatDate } from "../../../src/common/datetime/format_date"; -import { NumberFormat } from "../../../src/data/translation"; +import { NumberFormat, TimeFormat } from "../../../src/data/translation"; describe("formatDate", () => { const dateObj = new Date(2017, 10, 18, 11, 12, 13, 1400); @@ -11,6 +11,7 @@ describe("formatDate", () => { formatDate(dateObj, { language: "en", number_format: NumberFormat.language, + time_format: TimeFormat.language, }), "November 18, 2017" ); diff --git a/test-mocha/common/datetime/format_date_time.ts b/test-mocha/common/datetime/format_date_time.ts index beead0d442..cd3a116e3f 100644 --- a/test-mocha/common/datetime/format_date_time.ts +++ b/test-mocha/common/datetime/format_date_time.ts @@ -4,32 +4,50 @@ import { formatDateTime, formatDateTimeWithSeconds, } from "../../../src/common/datetime/format_date_time"; -import { NumberFormat } from "../../../src/data/translation"; +import { NumberFormat, TimeFormat } from "../../../src/data/translation"; describe("formatDateTime", () => { - const dateObj = new Date(2017, 10, 18, 11, 12, 13, 400); + const dateObj = new Date(2017, 10, 18, 23, 12, 13, 400); it("Formats English date times", () => { assert.strictEqual( formatDateTime(dateObj, { language: "en", number_format: NumberFormat.language, + time_format: TimeFormat.am_pm, }), - "November 18, 2017, 11:12 AM" + "November 18, 2017, 11:12 PM" + ); + assert.strictEqual( + formatDateTime(dateObj, { + language: "en", + number_format: NumberFormat.language, + time_format: TimeFormat.twenty_four, + }), + "November 18, 2017, 23:12" ); }); }); describe("formatDateTimeWithSeconds", () => { - const dateObj = new Date(2017, 10, 18, 11, 12, 13, 400); + const dateObj = new Date(2017, 10, 18, 23, 12, 13, 400); it("Formats English date times with seconds", () => { assert.strictEqual( formatDateTimeWithSeconds(dateObj, { language: "en", number_format: NumberFormat.language, + time_format: TimeFormat.am_pm, }), - "November 18, 2017, 11:12:13 AM" + "November 18, 2017, 11:12:13 PM" + ); + assert.strictEqual( + formatDateTimeWithSeconds(dateObj, { + language: "en", + number_format: NumberFormat.language, + time_format: TimeFormat.twenty_four, + }), + "November 18, 2017, 23:12:13" ); }); }); diff --git a/test-mocha/common/datetime/format_time.ts b/test-mocha/common/datetime/format_time.ts index 2b1ac03aba..827f278278 100644 --- a/test-mocha/common/datetime/format_time.ts +++ b/test-mocha/common/datetime/format_time.ts @@ -4,32 +4,50 @@ import { formatTime, formatTimeWithSeconds, } from "../../../src/common/datetime/format_time"; -import { NumberFormat } from "../../../src/data/translation"; +import { NumberFormat, TimeFormat } from "../../../src/data/translation"; describe("formatTime", () => { - const dateObj = new Date(2017, 10, 18, 11, 12, 13, 1400); + const dateObj = new Date(2017, 10, 18, 23, 12, 13, 1400); it("Formats English times", () => { assert.strictEqual( formatTime(dateObj, { language: "en", number_format: NumberFormat.language, + time_format: TimeFormat.am_pm, }), - "11:12 AM" + "11:12 PM" + ); + assert.strictEqual( + formatTime(dateObj, { + language: "en", + number_format: NumberFormat.language, + time_format: TimeFormat.twenty_four, + }), + "23:12" ); }); }); describe("formatTimeWithSeconds", () => { - const dateObj = new Date(2017, 10, 18, 11, 12, 13, 400); + const dateObj = new Date(2017, 10, 18, 23, 12, 13, 400); it("Formats English times with seconds", () => { assert.strictEqual( formatTimeWithSeconds(dateObj, { language: "en", number_format: NumberFormat.language, + time_format: TimeFormat.am_pm, }), - "11:12:13 AM" + "11:12:13 PM" + ); + assert.strictEqual( + formatTimeWithSeconds(dateObj, { + language: "en", + number_format: NumberFormat.language, + time_format: TimeFormat.twenty_four, + }), + "23:12:13" ); }); }); diff --git a/test-mocha/common/entity/compute_state_display.ts b/test-mocha/common/entity/compute_state_display.ts index eb0157956f..01246ec186 100644 --- a/test-mocha/common/entity/compute_state_display.ts +++ b/test-mocha/common/entity/compute_state_display.ts @@ -2,20 +2,26 @@ import { assert } from "chai"; import { computeStateDisplay } from "../../../src/common/entity/compute_state_display"; import { UNKNOWN } from "../../../src/data/entity"; import { - FrontendTranslationData, + FrontendLocaleData, NumberFormat, + TimeFormat, } from "../../../src/data/translation"; -const localeData: FrontendTranslationData = { - language: "en", - number_format: NumberFormat.comma_decimal, -}; +let localeData: FrontendLocaleData; describe("computeStateDisplay", () => { // Mock Localize function for testing const localize = (message, ...args) => message + (args.length ? ": " + args.join(",") : ""); + beforeEach(() => { + localeData = { + language: "en", + number_format: NumberFormat.comma_decimal, + time_format: TimeFormat.am_pm, + }; + }); + it("Localizes binary sensor defaults", () => { const stateObj: any = { entity_id: "binary_sensor.test", @@ -148,7 +154,7 @@ describe("computeStateDisplay", () => { ); }); - it("Localizes input_datetime with full date time", () => { + describe("Localizes input_datetime with full date time", () => { const stateObj: any = { entity_id: "input_datetime.test", state: "123", @@ -158,15 +164,24 @@ describe("computeStateDisplay", () => { year: 2017, month: 11, day: 18, - hour: 11, + hour: 23, minute: 12, second: 13, }, }; - assert.strictEqual( - computeStateDisplay(localize, stateObj, localeData), - "November 18, 2017, 11:12 AM" - ); + it("Uses am/pm time format", () => { + assert.strictEqual( + computeStateDisplay(localize, stateObj, localeData), + "November 18, 2017, 11:12 PM" + ); + }); + it("Uses 24h time format", () => { + localeData.time_format = TimeFormat.twenty_four; + assert.strictEqual( + computeStateDisplay(localize, stateObj, localeData), + "November 18, 2017, 23:12" + ); + }); }); it("Localizes input_datetime with date", () => { @@ -179,7 +194,7 @@ describe("computeStateDisplay", () => { year: 2017, month: 11, day: 18, - hour: 11, + hour: 23, minute: 12, second: 13, }, @@ -190,7 +205,7 @@ describe("computeStateDisplay", () => { ); }); - it("Localizes input_datetime with time", () => { + describe("Localizes input_datetime with time", () => { const stateObj: any = { entity_id: "input_datetime.test", state: "123", @@ -200,15 +215,25 @@ describe("computeStateDisplay", () => { year: 2017, month: 11, day: 18, - hour: 11, + hour: 23, minute: 12, second: 13, }, }; - assert.strictEqual( - computeStateDisplay(localize, stateObj, localeData), - "11:12 AM" - ); + it("Uses am/pm time format", () => { + localeData.time_format = TimeFormat.am_pm; + assert.strictEqual( + computeStateDisplay(localize, stateObj, localeData), + "11:12 PM" + ); + }); + it("Uses 24h time format", () => { + localeData.time_format = TimeFormat.twenty_four; + assert.strictEqual( + computeStateDisplay(localize, stateObj, localeData), + "23:12" + ); + }); }); it("Localizes unavailable", () => { @@ -230,10 +255,9 @@ describe("computeStateDisplay", () => { }); it("Localizes custom state", () => { - const altLocalize = () => { + const altLocalize = () => // No matches can be found - return ""; - }; + ""; const stateObj: any = { entity_id: "sensor.test", state: "My Custom State", diff --git a/test-mocha/common/string/format_number.ts b/test-mocha/common/string/format_number.ts index 903be54cb0..dafa75575c 100644 --- a/test-mocha/common/string/format_number.ts +++ b/test-mocha/common/string/format_number.ts @@ -1,23 +1,29 @@ import { assert } from "chai"; import { formatNumber } from "../../../src/common/string/format_number"; -import { NumberFormat } from "../../../src/data/translation"; +import { + FrontendLocaleData, + NumberFormat, + TimeFormat, +} from "../../../src/data/translation"; describe("formatNumber", () => { + // Create default to not have to specify a not relevant TimeFormat over and over again. + const defaultLocale: FrontendLocaleData = { + language: "en", + number_format: NumberFormat.language, + time_format: TimeFormat.language, + }; + // Node only ships with English support for `Intl`, so we can not test for other number formats here. it("Formats English numbers", () => { - assert.strictEqual( - formatNumber(1234.5, { - language: "en", - number_format: NumberFormat.language, - }), - "1,234.5" - ); + assert.strictEqual(formatNumber(1234.5, defaultLocale), "1,234.5"); }); it("Test format 'none' (keep dot despite language 'de')", () => { assert.strictEqual( formatNumber(1.23, { + ...defaultLocale, language: "de", number_format: NumberFormat.none, }), @@ -26,57 +32,32 @@ describe("formatNumber", () => { }); it("Ensure zero is kept for format 'language'", () => { - assert.strictEqual( - formatNumber(0, { - language: "en", - number_format: NumberFormat.language, - }), - "0" - ); + assert.strictEqual(formatNumber(0, defaultLocale), "0"); }); it("Ensure zero is kept for format 'none'", () => { assert.strictEqual( - formatNumber(0, { - language: "en", - number_format: NumberFormat.none, - }), + formatNumber(0, { ...defaultLocale, number_format: NumberFormat.none }), "0" ); }); it("Test empty string input for format 'none'", () => { assert.strictEqual( - formatNumber("", { - language: "en", - number_format: NumberFormat.none, - }), + formatNumber("", { ...defaultLocale, number_format: NumberFormat.none }), "" ); }); it("Test empty string input for format 'language'", () => { - assert.strictEqual( - formatNumber("", { - language: "en", - number_format: NumberFormat.language, - }), - "0" - ); + assert.strictEqual(formatNumber("", defaultLocale), "0"); }); it("Formats number with options", () => { assert.strictEqual( - formatNumber( - 1234.5, - { - language: "en", - number_format: NumberFormat.language, - }, - { - minimumFractionDigits: 2, - } - ), + formatNumber(1234.5, defaultLocale, { + minimumFractionDigits: 2, + }), "1,234.50" ); }); diff --git a/test-mocha/tsconfig.test.json b/test-mocha/tsconfig.test.json index 0e7afc6855..ea24da6ec1 100644 --- a/test-mocha/tsconfig.test.json +++ b/test-mocha/tsconfig.test.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "module": "commonjs" + "module": "commonjs", + "esModuleInterop": true } } From 9328576b55862c9f7fba50111a438baf9611a2e5 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 21 May 2021 01:53:57 +0000 Subject: [PATCH 071/117] Translation update --- translations/frontend/de.json | 14 +++++- translations/frontend/en.json | 11 +++++ translations/frontend/et.json | 17 +++++-- translations/frontend/lt.json | 33 +++++++++++++- translations/frontend/nl.json | 11 +++++ translations/frontend/ru.json | 71 +++++++++++++++++------------- translations/frontend/zh-Hans.json | 11 +++++ 7 files changed, 133 insertions(+), 35 deletions(-) diff --git a/translations/frontend/de.json b/translations/frontend/de.json index a1dda6235e..da0b73e893 100644 --- a/translations/frontend/de.json +++ b/translations/frontend/de.json @@ -2300,7 +2300,7 @@ "logs": { "caption": "Logs", "clear": "Löschen", - "custom_integration": "benutzerdefiniert integration", + "custom_integration": "benutzerdefinierte Integration", "description": "Home Assistant Logs einsehen", "details": "Protokolldetails ({level})", "error_from_custom_integration": "benutzerdefinierte", @@ -2918,6 +2918,8 @@ "follow_device_instructions": "Befolge die mit dem Gerät gelieferten Anweisungen, um die Kopplung am Gerät auszulösen.", "inclusion_failed": "Der Knoten konnte nicht hinzugefügt werden. Bitte überprüfe die Protokolle für weitere Informationen.", "inclusion_finished": "Der Knoten wurde hinzugefügt. Es kann einige Minuten dauern, bis alle Einheiten angezeigt werden, da der Knoten im Hintergrund fertig eingerichtet wird.", + "interview_failed": "Das Geräteinterview ist fehlgeschlagen. Zusätzliche Informationen sind möglicherweise in den Logs verfügbar.", + "interview_started": "Das Gerät wird gerade eingerichtet. Dies könnte eine Weile dauern.", "introduction": "Dieser Assistent führt dich durch das Hinzufügen eines Knotens zu deinem Z-Wave-Netzwerk.", "secure_inclusion_warning": "Sichere Geräte benötigen zusätzliche Bandbreite; zu viele sichere Geräte können Ihr Z-Wave-Netzwerk ausbremsen. Wir empfehlen, die sichere Einbindung nur für Geräte zu verwenden, die sie benötigen, wie Schlösser oder Garagentoröffner.", "start_inclusion": "Starten der Erfassung", @@ -4006,6 +4008,16 @@ "primary_color": "Primärfarbe", "reset": "zurücksetzen" }, + "time_format": { + "description": "Wählen Sie, wie die Zeiten formatiert werden sollen.", + "dropdown_label": "Zeitformatierung", + "formats": { + "12": "12 Stunden (AM/PM)", + "24": "24 Stunden", + "system": "Systemstandart verwenden" + }, + "header": "Zeitformatierung" + }, "vibrate": { "description": "Aktiviere oder deaktiviere die Vibration an diesem Gerät, wenn du Geräte steuerst.", "header": "Vibrieren" diff --git a/translations/frontend/en.json b/translations/frontend/en.json index c91a7b8f4c..70d3fd72e9 100644 --- a/translations/frontend/en.json +++ b/translations/frontend/en.json @@ -4008,6 +4008,17 @@ "primary_color": "Primary color", "reset": "Reset" }, + "time_format": { + "description": "Choose how times are formatted.", + "dropdown_label": "Time format", + "formats": { + "12": "12 hours (AM/PM)", + "24": "24 hours", + "language": "Auto (use language setting)", + "system": "Use system locale" + }, + "header": "Time Format" + }, "vibrate": { "description": "Enable or disable vibration on this device when controlling devices.", "header": "Vibrate" diff --git a/translations/frontend/et.json b/translations/frontend/et.json index 78e7590be4..d365be1b14 100644 --- a/translations/frontend/et.json +++ b/translations/frontend/et.json @@ -871,7 +871,7 @@ "day": "{count} {count, plural,\n one {päev}\n other {päeva}\n}", "hour": "{count} {count, plural,\n one {tund}\n other {tunni}\n}", "minute": "{count} {count, plural,\n one {minut}\n other {minuti}\n}", - "second": "{count} {count, plural,\n one {sekund}\n other {sekundit}\n}", + "second": "{count} {count, plural,\n one {sekund}\n other {sekundi}\n}", "week": "{count} {count, plural,\n one {nädala}\n other {nädala}\n}" }, "future_duration": { @@ -1220,8 +1220,8 @@ }, "duration": { "day": "{count} {count, plural,\n one {päev}\n other {päeva}\n}", - "hour": "{count} {count, plural,\n one {tund}\n other {tunni}\n}", - "minute": "{count} {count, plural,\n one {minut}\n other {minuti}\n}", + "hour": "{count} {count, plural,\n one {tund}\n other {tundi}\n}", + "minute": "{count} {count, plural,\n one {minut}\n other {minutit}\n}", "second": "{count} {count, plural,\n one {sekund}\n other {sekundit}\n}", "week": "{count} {count, plural,\n one {nädal}\n other {nädalat}\n}" }, @@ -4008,6 +4008,17 @@ "primary_color": "Esmane värv", "reset": "Lähtesta" }, + "time_format": { + "description": "Vali kuidas ajad vormindatakse.", + "dropdown_label": "Ajavorming", + "formats": { + "12": "12 tundi (AM/PM)", + "24": "24 tundi", + "language": "Automaatne (kasuta keeleseadet)", + "system": "Kasuta süsteemi poolt määratut" + }, + "header": "Ajavorming" + }, "vibrate": { "description": "Seadmete juhtimisel lubage või keelake vibratsioon.", "header": "Vibreeri" diff --git a/translations/frontend/lt.json b/translations/frontend/lt.json index fef434b079..5016bb31cf 100644 --- a/translations/frontend/lt.json +++ b/translations/frontend/lt.json @@ -202,7 +202,7 @@ "messages": { "became_unavailable": "tapo neprieinama", "changed_to_state": "pakeista į {state}", - "cleared_device_class": "išvalyta {device_class} nerasta)", + "cleared_device_class": "išvalyta ({device_class} neaptikta)", "detected_device_class": "aptikta {device_class}", "rose": "pakilo", "set": "nustatyti", @@ -1039,8 +1039,39 @@ "close": "Uždaryti", "title_aborted": "Nutraukta" }, + "number_format": { + "dropdown_label": "Skaičių formatas", + "formats": { + "language": "Automatinis (naudoti kalbos nustatymą)", + "none": "Joks", + "system": "Naudoti sistemos lokalę" + }, + "header": "Skaičių formatas" + }, "push_notifications": { "description": "Siųsti pranešimus į šį įrenginį." + }, + "themes": { + "accent_color": "Akcento spalva", + "dark_mode": { + "auto": "Automatinė", + "dark": "Tamsi", + "light": "Šviesi" + }, + "dropdown_label": "Tema", + "header": "Tema", + "primary_color": "Pagrindinė spalva", + "reset": "Atstatyti" + }, + "time_format": { + "dropdown_label": "Laiko formatas", + "formats": { + "12": "12 valandų (AM/PM)", + "24": "24 valandų", + "language": "Automatinis (naudoti kalbos nustatymą)", + "system": "Naudoti sistemos lokalę" + }, + "header": "Laiko formatas" } } } diff --git a/translations/frontend/nl.json b/translations/frontend/nl.json index c059e97339..7c33368b40 100644 --- a/translations/frontend/nl.json +++ b/translations/frontend/nl.json @@ -4008,6 +4008,17 @@ "primary_color": "Primaire kleur", "reset": "Herstel" }, + "time_format": { + "description": "Kies hoe tijden worden opgemaakt.", + "dropdown_label": "Tijdformaat", + "formats": { + "12": "12 uur (AM/PM)", + "24": "24 uur", + "language": "Automatisch (taalinstelling gebruiken)", + "system": "Systeemlokalen gebruiken" + }, + "header": "Tijdformaat" + }, "vibrate": { "description": "Schakel trillingen op dit apparaat in of uit wanneer u apparaten bestuurt.", "header": "Trillen" diff --git a/translations/frontend/ru.json b/translations/frontend/ru.json index 7ae2bbe5fe..4f1784545c 100644 --- a/translations/frontend/ru.json +++ b/translations/frontend/ru.json @@ -292,7 +292,7 @@ "save": "Сохранить", "show_more": "Показать дополнительную информацию об этом", "update": "Обновить", - "update_available": "{count, plural,\n one {Доступно обновление}\n other {Доступно {count} обновления}\n}", + "update_available": "{count, plural,\n one {Доступно обновление}\n few {Доступно {count} обновления}\n many {Доступно {count} обновлений}\n other {Доступно {count} обновлений}\n}", "version": "Версия", "yes": "Да" }, @@ -868,27 +868,27 @@ }, "relative_time": { "duration": { - "day": "{count} {count, plural,\none {д.}\nother {д.}\n}", - "hour": "{count} {count, plural,\none {ч.}\nother {ч.}\n}", - "minute": "{count} {count, plural,\none {мин.}\nother {мин.}\n}", - "second": "{count} {count, plural,\n one {сек.}\n other {сек.}\n}", - "week": "{count} {count, plural,\none {нед.}\nother {нед.}\n}" + "day": "{count} {count, plural,\n one {день}\n few {дня}\n many {дней}\n other {дней}\n}", + "hour": "{count} {count, plural,\n one {час}\n few {часа}\n many {часов}\n other {часов}\n}", + "minute": "{count} {count, plural,\n one {минута}\n few {минуты}\n many {минут}\n other {минут}\n}", + "second": "{count} {count, plural,\n one {секунда}\n few {секунды}\n many {секунд}\n other {секунд}\n}", + "week": "{count} {count, plural,\n one {неделя}\n few {недели}\n many {недель}\n other {недель}\n}" }, "future_duration": { - "day": "Через {count} {count, plural,\n one {д.}\n other {д.}\n}", - "hour": "Через {count} {count, plural,\n one {ч.}\n other {ч.}\n}", - "minute": "Через {count} {count, plural,\n one {мин.}\n other {мин.}\n}", - "second": "Через {count} {count, plural,\n one {сек.}\n other {сек.}\n}", - "week": "Через {count} {count, plural,\n one {нед.}\n other {нед.}\n}" + "day": "Через {count} {count, plural,\n one {день}\n few {дня}\n many {дней}\n other {дней}\n}", + "hour": "Через {count} {count, plural,\n one {час}\n few {часа}\n many {часов}\n other {часов}\n}", + "minute": "Через {count} {count, plural,\n one {минуту}\n few {минуты}\n many {минут}\n other {минут}\n}", + "second": "Через {count} {count, plural,\n one {секунду}\n few {секунды}\n many {секунд}\n other {секунд}\n}", + "week": "Через {count} {count, plural,\n one {неделю}\n few {недели}\n many {недель}\n other {недель}\n}" }, "just_now": "Сейчас", "never": "Никогда", "past_duration": { - "day": "{count} {count, plural,\n one {д.}\n other {д.}\n} назад", - "hour": "{count} {count, plural,\n one {ч.}\n other {ч.}\n} назад", - "minute": "{count} {count, plural,\n one {мин.}\n other {мин.}\n} назад", - "second": "{count} {count, plural,\n one {сек.}\n other {сек.}\n} назад", - "week": "{count} {count, plural,\n one {нед.}\n other {нед.}\n} назад" + "day": "{count} {count, plural,\n one {день}\n few {дня}\n many {дней}\n other {дней}\n} назад", + "hour": "{count} {count, plural,\n one {час}\n few {часа}\n many {часов}\n other {часов}\n} назад", + "minute": "{count} {count, plural,\n one {минуту}\n few {минуты}\n many {минут}\n other {минут}\n} назад", + "second": "{count} {count, plural,\n one {секунду}\n few {секунды}\n many {секунд}\n other {секунд}\n} назад", + "week": "{count} {count, plural,\n one {неделю}\n few {недели}\n many {недель}\n other {недель}\n} назад" } }, "service-control": { @@ -1041,7 +1041,7 @@ "restored": { "confirm_remove_text": "Вы уверены, что хотите удалить этот объект?", "confirm_remove_title": "Удалить объект?", - "not_provided": "Этот объект в настоящее время недоступен и его родительская интеграция или устройство удалены, изменены либо неисправны.", + "not_provided": "Этот объект в настоящее время недоступен. Его родительская интеграция или устройство удалены, изменены либо неисправны.", "remove_action": "Удалить объект", "remove_intro": "Если объект больше не используется, Вы можете удалить его." }, @@ -1219,11 +1219,11 @@ } }, "duration": { - "day": "{count} {count, plural,\none {д.}\nother {д.}\n}", - "hour": "{count} {count, plural,\none {ч.}\nother {ч.}\n}", - "minute": "{count} {count, plural,\none {мин.}\nother {мин.}\n}", - "second": "{count} {count, plural,\n one {сек.}\n other {сек.}\n}", - "week": "{count} {count, plural,\none {нед.}\nother {нед.}\n}" + "day": "{count} {count, plural,\n one {день}\n few {дня}\n many {дней}\n other {дней}\n}", + "hour": "{count} {count, plural,\n one {час}\n few {часа}\n many {часов}\n other {часов}\n}", + "minute": "{count} {count, plural,\n one {минута}\n few {минуты}\n many {минут}\n other {минут}\n}", + "second": "{count} {count, plural,\n one {секунда}\n few {секунды}\n many {секунд}\n other {секунд}\n}", + "week": "{count} {count, plural,\n one {неделя}\n few {недели}\n many {недель}\n other {недель}\n}" }, "errors": { "config": { @@ -2030,7 +2030,7 @@ "enabled_label": "Активировать устройство", "entities": { "add_entities_lovelace": "Добавить объекты в Lovelace UI", - "disabled_entities": "Показать {count, plural,\n one {деактивированные объекты:}\n other {деактивированные объекты:}\n} {count}", + "disabled_entities": "+{count} {count, plural,\n one {деактивированный объект}\n few {деактивированных объекта}\n many {деактивированных объектов}\n other {деактивированных объектов}\n}", "entities": "Объекты", "hide_disabled": "Скрыть деактивированные объекты", "none": "У этого устройства нет объектов" @@ -2071,12 +2071,12 @@ "disable_selected": { "button": "Деактивировать выбранные", "confirm_text": "Деактивированные объекты не будут доступны в Home Assistant.", - "confirm_title": "Вы уверены, что хотите деактивировать {number} {number, plural,\n one {выбранный объект}\n other {выбранных объектов}\n}?" + "confirm_title": "Вы уверены, что хотите деактивировать {number} {number, plural,\n one {выбранный объект}\n few {выбранных объекта}\n many {выбранных объектов}\n other {выбранных объектов}\n}?" }, "enable_selected": { "button": "Активировать выбранные", "confirm_text": "Если эти объекты ранее были деактивированы, они снова будут доступными в Home Assistant.", - "confirm_title": "Активировать {number} {number, plural,\n one {выбранный объект}\n other {выбранных объектов}\n}?" + "confirm_title": "Активировать {number} {number, plural,\n one {выбранный объект}\n few {выбранных объекта}\n many {выбранных объектов}\n other {выбранных объектов}\n}?" }, "filter": { "filter": "Фильтр", @@ -2099,9 +2099,9 @@ "remove_selected": { "button": "Удалить выбранные", "confirm_partly_text": "Вы можете удалить только {removable} из выбранных {selected} объектов. Объекты могут быть удалены только когда интеграция больше не предоставляет объекты. В некоторых случаях Вам нужно будет перезапустить Home Assistant, чтобы удалить объекты удаленной интеграции. Вы уверены, что хотите удалить объекты?", - "confirm_partly_title": "Только {number} {number, plural,\n one {выбранный объект}\n other {выбранных объектов}\n} могут быть удалены.", + "confirm_partly_title": "Только {number} {number, plural,\n one {выбранный объект}\n few {выбранных объекта}\n many {выбранных объектов}\n other {выбранных объектов}\n} могут быть удалены.", "confirm_text": "Вы должны удалить эти объекты из конфигурации Lovelace и из правил автоматизации.", - "confirm_title": "Вы уверены, что хотите удалить {number} {number, plural,\n one {выбранный объект}\n other {выбранных объектов}\n}?" + "confirm_title": "Вы уверены, что хотите удалить {number} {number, plural,\n one {выбранный объект}\n few {выбранных объекта}\n many {выбранных объектов}\n other {выбранных объектов}\n}?" }, "search": "Поиск объектов", "selected": "Выбрано: {number}", @@ -2194,7 +2194,7 @@ "delete_confirm": "Вы уверены, что хотите удалить эту интеграцию?", "depends_on_cloud": "Зависит от облачных сервисов", "device_unavailable": "Устройство недоступно", - "devices": "{count, plural,\n one {устройств:}\n other {устройств:}\n} {count}", + "devices": "{count} {count, plural,\n one {устройство}\n few {устройства}\n many {устройств}\n other {устройств}\n}", "disable_restart_confirm": "Перезапустите Home Assistant, чтобы завершить деактивацию этой интеграции.", "disable": { "disable_confirm": "Вы уверены, что хотите деактивировать эту запись конфигурации? Её дочерние устройства и объекты будут также деактивированы.", @@ -2208,7 +2208,7 @@ }, "documentation": "Документация", "enable_restart_confirm": "Перезапустите Home Assistant, чтобы завершить подключение этой интеграции.", - "entities": "{count, plural,\n one {объектов:}\n other {объектов:}\n} {count}", + "entities": "{count} {count, plural,\n one {объект}\n few {объекта}\n many {объектов}\n other {объектов}\n}", "entity_unavailable": "Объект недоступен", "firmware": "Прошивка: {version}", "hub": "Подключено через", @@ -2223,7 +2223,7 @@ "reload_restart_confirm": "Перезапустите Home Assistant, чтобы завершить перезагрузку этой интеграции", "rename": "Переименовать", "restart_confirm": "Перезапустите Home Assistant, чтобы завершить удаление этой интеграции", - "services": "{count, plural,\n one {служб:}\n other {служб:}\n} {count}", + "services": "{count} {count, plural,\n one {служба}\n few {службы}\n many {служб}\n other {служб}\n}", "state": { "failed_unload": "Не удалось выгрузить", "loaded": "Загружено", @@ -4008,6 +4008,17 @@ "primary_color": "Основной цвет", "reset": "Сбросить" }, + "time_format": { + "description": "Отображение времени в пользовательском интерфейсе", + "dropdown_label": "Формат времени", + "formats": { + "12": "12-часовой (AM/PM)", + "24": "24-часовой", + "language": "Автоматически (определять из настроек языка)", + "system": "Использовать локализацию системы" + }, + "header": "Формат времени" + }, "vibrate": { "description": "Получать тактильный отклик при управлении устройствами", "header": "Вибрация" diff --git a/translations/frontend/zh-Hans.json b/translations/frontend/zh-Hans.json index 852b197688..6ca80b6386 100644 --- a/translations/frontend/zh-Hans.json +++ b/translations/frontend/zh-Hans.json @@ -4008,6 +4008,17 @@ "primary_color": "主色调", "reset": "重置" }, + "time_format": { + "description": "选择时间的格式。", + "dropdown_label": "时间格式", + "formats": { + "12": "12 小时(上午/下午)", + "24": "24 小时", + "language": "自动(使用语言设置)", + "system": "使用系统区域设置" + }, + "header": "时间格式" + }, "vibrate": { "description": "控制设备时,在此设备上启用或禁用振动。", "header": "振动" From fd9bb4d8ccc211eeef72803b88056ccf3723933d Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 21 May 2021 09:09:31 +0200 Subject: [PATCH 072/117] Make chrome work-around work in iframes (#9200) --- .../snapshot/dialog-hassio-snapshot.ts | 34 +++++++++++-------- hassio/src/entrypoint.ts | 6 ++++ hassio/src/hassio-main.ts | 3 +- src/common/dom/get_main_window.ts | 8 +++++ src/common/navigate.ts | 17 +++++----- src/data/main_window.ts | 1 + src/dialogs/make-dialog-manager.ts | 17 ++++++---- src/entrypoints/core.ts | 3 ++ src/entrypoints/custom-panel.ts | 8 ++++- src/state/url-sync-mixin.ts | 22 +++++++----- 10 files changed, 79 insertions(+), 40 deletions(-) create mode 100644 src/common/dom/get_main_window.ts create mode 100644 src/data/main_window.ts diff --git a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts index 2fa53b66bf..81f21bb908 100755 --- a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts +++ b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts @@ -20,6 +20,7 @@ import { showAlertDialog, showConfirmationDialog, } from "../../../../src/dialogs/generic/show-dialog-box"; +import { HassDialog } from "../../../../src/dialogs/make-dialog-manager"; import { PolymerChangedEvent } from "../../../../src/polymer-types"; import { haStyle, haStyleDialog } from "../../../../src/resources/styles"; import { HomeAssistant } from "../../../../src/types"; @@ -68,7 +69,9 @@ interface FolderItem { } @customElement("dialog-hassio-snapshot") -class HassioSnapshotDialog extends LitElement { +class HassioSnapshotDialog + extends LitElement + implements HassDialog { @property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public supervisor?: Supervisor; @@ -106,12 +109,21 @@ class HassioSnapshotDialog extends LitElement { } } + public closeDialog() { + this._dialogParams = undefined; + this._snapshot = undefined; + this._snapshotPassword = ""; + this._folders = []; + this._addons = []; + fireEvent(this, "dialog-closed", { dialog: this.localName }); + } + protected render(): TemplateResult { if (!this._dialogParams || !this._snapshot) { return html``; } return html` - +
${this._computeName} @@ -359,7 +371,7 @@ class HassioSnapshotDialog extends LitElement { .then( () => { alert("Snapshot restored!"); - this._closeDialog(); + this.closeDialog(); }, (error) => { this._error = error.body.message; @@ -371,7 +383,7 @@ class HassioSnapshotDialog extends LitElement { method: "POST", body: JSON.stringify(data), }); - this._closeDialog(); + this.closeDialog(); } } @@ -410,7 +422,7 @@ class HassioSnapshotDialog extends LitElement { .then( () => { alert("Snapshot restored!"); - this._closeDialog(); + this.closeDialog(); }, (error) => { this._error = error.body.message; @@ -422,7 +434,7 @@ class HassioSnapshotDialog extends LitElement { method: "POST", body: JSON.stringify(data), }); - this._closeDialog(); + this.closeDialog(); } } @@ -445,7 +457,7 @@ class HassioSnapshotDialog extends LitElement { if (this._dialogParams!.onDelete) { this._dialogParams!.onDelete(); } - this._closeDialog(); + this.closeDialog(); }, (error) => { this._error = error.body.message; @@ -496,14 +508,6 @@ class HassioSnapshotDialog extends LitElement { private get _computeSize() { return Math.ceil(this._snapshot!.size * 10) / 10 + " MB"; } - - private _closeDialog() { - this._dialogParams = undefined; - this._snapshot = undefined; - this._snapshotPassword = ""; - this._folders = []; - this._addons = []; - } } declare global { diff --git a/hassio/src/entrypoint.ts b/hassio/src/entrypoint.ts index 24d3e45359..48c4a33180 100644 --- a/hassio/src/entrypoint.ts +++ b/hassio/src/entrypoint.ts @@ -15,5 +15,11 @@ body { padding: 0; height: 100vh; } +@media (prefers-color-scheme: dark) { + body { + background-color: #111111; + color: #e1e1e1; + } +} `; document.head.appendChild(styleEl); diff --git a/hassio/src/hassio-main.ts b/hassio/src/hassio-main.ts index c91a024347..6ee732b846 100644 --- a/hassio/src/hassio-main.ts +++ b/hassio/src/hassio-main.ts @@ -4,6 +4,7 @@ import { atLeastVersion } from "../../src/common/config/version"; import { applyThemesOnElement } from "../../src/common/dom/apply_themes_on_element"; import { fireEvent } from "../../src/common/dom/fire_event"; import { isNavigationClick } from "../../src/common/dom/is-navigation-click"; +import { mainWindow } from "../../src/common/dom/get_main_window"; import { navigate } from "../../src/common/navigate"; import { HassioPanelInfo } from "../../src/data/hassio/supervisor"; import { Supervisor } from "../../src/data/supervisor/supervisor"; @@ -50,7 +51,7 @@ export class HassioMain extends SupervisorBaseElement { // Joakim - April 26, 2021 // Due to changes in behavior in Google Chrome, we changed navigate to listen on the top element - top.addEventListener("location-changed", (ev) => + mainWindow.addEventListener("location-changed", (ev) => // @ts-ignore fireEvent(this, ev.type, ev.detail, { bubbles: false, diff --git a/src/common/dom/get_main_window.ts b/src/common/dom/get_main_window.ts new file mode 100644 index 0000000000..5bf9e2687b --- /dev/null +++ b/src/common/dom/get_main_window.ts @@ -0,0 +1,8 @@ +import { MAIN_WINDOW_NAME } from "../../data/main_window"; + +export const mainWindow = + window.name === MAIN_WINDOW_NAME + ? window + : parent.name === MAIN_WINDOW_NAME + ? parent + : top; diff --git a/src/common/navigate.ts b/src/common/navigate.ts index 7bbc589f29..662ad2bc1f 100644 --- a/src/common/navigate.ts +++ b/src/common/navigate.ts @@ -1,4 +1,5 @@ import { fireEvent } from "./dom/fire_event"; +import { mainWindow } from "./dom/get_main_window"; declare global { // for fire event @@ -12,24 +13,24 @@ declare global { export const navigate = (_node: any, path: string, replace = false) => { if (__DEMO__) { if (replace) { - top.history.replaceState( - top.history.state?.root ? { root: true } : null, + mainWindow.history.replaceState( + mainWindow.history.state?.root ? { root: true } : null, "", - `${top.location.pathname}#${path}` + `${mainWindow.location.pathname}#${path}` ); } else { - top.location.hash = path; + mainWindow.location.hash = path; } } else if (replace) { - top.history.replaceState( - top.history.state?.root ? { root: true } : null, + mainWindow.history.replaceState( + mainWindow.history.state?.root ? { root: true } : null, "", path ); } else { - top.history.pushState(null, "", path); + mainWindow.history.pushState(null, "", path); } - fireEvent(top, "location-changed", { + fireEvent(mainWindow, "location-changed", { replace, }); }; diff --git a/src/data/main_window.ts b/src/data/main_window.ts new file mode 100644 index 0000000000..2a6a6d3e30 --- /dev/null +++ b/src/data/main_window.ts @@ -0,0 +1 @@ +export const MAIN_WINDOW_NAME = "ha-main-window"; diff --git a/src/dialogs/make-dialog-manager.ts b/src/dialogs/make-dialog-manager.ts index 17475259ab..2acfe6473f 100644 --- a/src/dialogs/make-dialog-manager.ts +++ b/src/dialogs/make-dialog-manager.ts @@ -1,4 +1,5 @@ import { HASSDomEvent, ValidHassDomEvent } from "../common/dom/fire_event"; +import { mainWindow } from "../common/dom/get_main_window"; import { ProvideHassElement } from "../mixins/provide-hass-lit-mixin"; declare global { @@ -67,25 +68,26 @@ export const showDialog = async ( } if (addHistory) { - top.history.replaceState( + mainWindow.history.replaceState( { dialog: dialogTag, open: false, oldState: - top.history.state?.open && top.history.state?.dialog !== dialogTag - ? top.history.state + mainWindow.history.state?.open && + mainWindow.history.state?.dialog !== dialogTag + ? mainWindow.history.state : null, }, "" ); try { - top.history.pushState( + mainWindow.history.pushState( { dialog: dialogTag, dialogParams: dialogParams, open: true }, "" ); } catch (err) { // dialogParams could not be cloned, probably contains callback - top.history.pushState( + mainWindow.history.pushState( { dialog: dialogTag, dialogParams: null, open: true }, "" ); @@ -96,7 +98,10 @@ export const showDialog = async ( }; export const replaceDialog = () => { - top.history.replaceState({ ...top.history.state, replaced: true }, ""); + mainWindow.history.replaceState( + { ...mainWindow.history.state, replaced: true }, + "" + ); }; export const closeDialog = async (dialogTag: string): Promise => { diff --git a/src/entrypoints/core.ts b/src/entrypoints/core.ts index 87c6275449..964c2ca99c 100644 --- a/src/entrypoints/core.ts +++ b/src/entrypoints/core.ts @@ -25,6 +25,9 @@ import { subscribeUser } from "../data/ws-user"; import type { ExternalAuth } from "../external_app/external_auth"; import "../resources/safari-14-attachshadow-patch"; import { HomeAssistant } from "../types"; +import { MAIN_WINDOW_NAME } from "../data/main_window"; + +window.name = MAIN_WINDOW_NAME; declare global { interface Window { diff --git a/src/entrypoints/custom-panel.ts b/src/entrypoints/custom-panel.ts index 856946d33b..6d77428bbc 100644 --- a/src/entrypoints/custom-panel.ts +++ b/src/entrypoints/custom-panel.ts @@ -47,7 +47,13 @@ function initialize( ) { const style = document.createElement("style"); - style.innerHTML = "body{margin:0}"; + style.innerHTML = `body { margin:0; } + @media (prefers-color-scheme: dark) { + body { + background-color: #111111; + color: #e1e1e1; + } + }`; document.head.appendChild(style); const config = panel.config._panel_custom; diff --git a/src/state/url-sync-mixin.ts b/src/state/url-sync-mixin.ts index 7597004b53..684f9a79dc 100644 --- a/src/state/url-sync-mixin.ts +++ b/src/state/url-sync-mixin.ts @@ -1,6 +1,7 @@ /* eslint-disable no-console */ import { ReactiveElement } from "lit"; import { HASSDomEvent } from "../common/dom/fire_event"; +import { mainWindow } from "../common/dom/get_main_window"; import { closeDialog, DialogClosedParams, @@ -28,13 +29,16 @@ export const urlSyncMixin = < if (history.length === 1) { history.replaceState({ ...history.state, root: true }, ""); } - top.addEventListener("popstate", this._popstateChangeListener); + mainWindow.addEventListener("popstate", this._popstateChangeListener); this.addEventListener("dialog-closed", this._dialogClosedListener); } public disconnectedCallback(): void { super.disconnectedCallback(); - top.removeEventListener("popstate", this._popstateChangeListener); + mainWindow.removeEventListener( + "popstate", + this._popstateChangeListener + ); this.removeEventListener("dialog-closed", this._dialogClosedListener); } @@ -45,21 +49,21 @@ export const urlSyncMixin = < console.log("dialog closed", ev.detail.dialog); console.log( "open", - top.history.state?.open, + mainWindow.history.state?.open, "dialog", - top.history.state?.dialog + mainWindow.history.state?.dialog ); } // If not closed by navigating back, and not a new dialog is open, remove the open state from history if ( - top.history.state?.open && - top.history.state?.dialog === ev.detail.dialog + mainWindow.history.state?.open && + mainWindow.history.state?.dialog === ev.detail.dialog ) { if (DEBUG) { console.log("remove state", ev.detail.dialog); } this._ignoreNextPopState = true; - top.history.back(); + mainWindow.history.back(); } }; @@ -73,7 +77,7 @@ export const urlSyncMixin = < if (DEBUG) { console.log("remove old state", ev.state.oldState); } - top.history.back(); + mainWindow.history.back(); return; } this._ignoreNextPopState = false; @@ -98,7 +102,7 @@ export const urlSyncMixin = < console.log("dialog could not be closed"); } // dialog could not be closed, push state again - top.history.pushState( + mainWindow.history.pushState( { dialog: state.dialog, open: true, From 1255b565222480bd82746dd914aa4310d338f4b6 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Fri, 21 May 2021 10:11:31 +0200 Subject: [PATCH 073/117] Add missing translations to voice command dialog (#9221) --- .../voice-command-dialog/ha-voice-command-dialog.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts index f4cf783ad3..649c209678 100644 --- a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts +++ b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts @@ -117,9 +117,13 @@ export class HaVoiceCommandDialog extends LitElement { href="${this._agentInfo.onboarding.url}" target="_blank" rel="noreferrer" - >Yes!${this.hass.localize("ui.common.yes")}! + ${this.hass.localize("ui.common.no")} - No
` @@ -155,7 +159,7 @@ export class HaVoiceCommandDialog extends LitElement {
Date: Sat, 22 May 2021 01:52:23 +0000 Subject: [PATCH 074/117] Translation update --- translations/frontend/bg.json | 8 ++++++++ translations/frontend/ca.json | 13 ++++++++++++- translations/frontend/es.json | 11 +++++++++++ translations/frontend/fr.json | 10 ++++++++++ translations/frontend/nb.json | 15 +++++++++++++-- translations/frontend/zh-Hant.json | 11 +++++++++++ 6 files changed, 65 insertions(+), 3 deletions(-) diff --git a/translations/frontend/bg.json b/translations/frontend/bg.json index 183fb56d1e..f356d57db5 100644 --- a/translations/frontend/bg.json +++ b/translations/frontend/bg.json @@ -3481,6 +3481,14 @@ "primary_color": "Основен цвят", "reset": "Нулиране" }, + "time_format": { + "formats": { + "12": "12 часа (AM/PM)", + "24": "24 часа", + "language": "Авто (езикова настройка)", + "system": "Системна настройка" + } + }, "vibrate": { "description": "Разрешаване или забраняване на вибрациите на това устройство при управление на устройства.", "header": "Вибрация" diff --git a/translations/frontend/ca.json b/translations/frontend/ca.json index d8e67eac71..54f2d6856f 100644 --- a/translations/frontend/ca.json +++ b/translations/frontend/ca.json @@ -3955,7 +3955,7 @@ "header": "Mòduls d'autenticació amb múltiples passos" }, "number_format": { - "description": "Trieu el format dels números.", + "description": "Tria el format dels números.", "dropdown_label": "Format dels números", "formats": { "comma_decimal": "1,234,567.89", @@ -4008,6 +4008,17 @@ "primary_color": "Color primari", "reset": "Restablir" }, + "time_format": { + "description": "Tria el format de data i hora.", + "dropdown_label": "Format de data i hora", + "formats": { + "12": "12 hores (AM/PM)", + "24": "24 hores", + "language": "Automàtic (utilitza la configuració d'idioma)", + "system": "Utilitza la configuració regional del sistema" + }, + "header": "Format de data i hora" + }, "vibrate": { "description": "Activa o desactiva la vibració en d'aquest dispositiu.", "header": "Vibra" diff --git a/translations/frontend/es.json b/translations/frontend/es.json index 2df7daeb2b..26931a3a32 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -4008,6 +4008,17 @@ "primary_color": "Color primario", "reset": "Reiniciar" }, + "time_format": { + "description": "Elije cómo se formatean las horas.", + "dropdown_label": "Formato de hora", + "formats": { + "12": "12 horas (AM/PM)", + "24": "24 horas", + "language": "Automático (utilizar la configuración del idioma)", + "system": "Utilizar la configuración regional del sistema" + }, + "header": "Formato de hora" + }, "vibrate": { "description": "Activar o deshabilitar la vibración en este dispositivo al controlar dispositivos.", "header": "Vibrar" diff --git a/translations/frontend/fr.json b/translations/frontend/fr.json index 2a9dac1081..cef4235037 100644 --- a/translations/frontend/fr.json +++ b/translations/frontend/fr.json @@ -4004,6 +4004,16 @@ "primary_color": "Couleur primaire", "reset": "Réinitialiser" }, + "time_format": { + "description": "Définir le formatage des nombres", + "dropdown_label": "Format de l'heure", + "formats": { + "12": "12 heures (AM / PM)", + "24": "24 heures", + "system": "Utiliser les paramètres régionaux du système" + }, + "header": "Format de l'heure" + }, "vibrate": { "description": "Activer ou désactiver les vibrations sur cet appareil lors du contrôle des périphériques.", "header": "Vibrer" diff --git a/translations/frontend/nb.json b/translations/frontend/nb.json index 54cf0b3057..3a5b61af8a 100644 --- a/translations/frontend/nb.json +++ b/translations/frontend/nb.json @@ -1202,7 +1202,7 @@ "zha_reconfigure_device": { "attribute": "Attributt", "battery_device_warning": "Du må vekke batteridrevne enheter før du starter omkonfigureringsprosessen. Se enhetens håndbok for instruksjoner om hvordan du vekker enheten.", - "bind_header": "Bindende", + "bind_header": "Binding", "button_hide": "Skjul detaljer", "button_show": "Vis detaljer", "cluster_header": "Klynge", @@ -1212,7 +1212,7 @@ "heading": "Konfigurerer enheten på nytt", "in_progress": "Enheten konfigureres på nytt. Dette kan ta litt tid.", "introduction": "Konfigurer en enhet på nytt på Zigbee-nettverket. Bruk denne funksjonen hvis enheten ikke fungerer som den skal.", - "min_max_change": "min./maks./endring", + "min_max_change": "min/maks/endring", "reporting_header": "Rapportering", "run_in_background": "Du kan lukke denne dialogen, og omkonfigurasjonen vil fortsette i bakgrunnen.", "start_reconfiguration": "Start rekonfigurasjon" @@ -4008,6 +4008,17 @@ "primary_color": "Primærfarge", "reset": "Nullstille" }, + "time_format": { + "description": "Velg hvordan tidene skal formateres.", + "dropdown_label": "Tidsformat", + "formats": { + "12": "12 timer (AM/PM)", + "24": "24 timer", + "language": "Automatisk (bruk språkinnstilling)", + "system": "Bruk systemområdet" + }, + "header": "Tidsformat" + }, "vibrate": { "description": "Aktiver eller deaktiver vibrasjoner på denne enheten når du kontrollerer enheter.", "header": "Vibrere" diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index c71d65162b..4a3d038d87 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -4008,6 +4008,17 @@ "primary_color": "主色彩", "reset": "重置" }, + "time_format": { + "description": "選擇時間顯示格式。", + "dropdown_label": "時間格式", + "formats": { + "12": "12 小時制(AM/PM)", + "24": "24 小時制", + "language": "自動(使用語言設定)", + "system": "使用系統位置" + }, + "header": "時間格式" + }, "vibrate": { "description": "當控制裝置時、開啟或關閉此裝置震動。", "header": "震動" From abb9f8e233d5110d881a1b57aec77ff0a19c36b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Sat, 22 May 2021 15:12:51 +0200 Subject: [PATCH 075/117] Remove padding when narrow (#9209) --- src/components/ha-tab.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/ha-tab.ts b/src/components/ha-tab.ts index ac0d81d921..7575e112e5 100644 --- a/src/components/ha-tab.ts +++ b/src/components/ha-tab.ts @@ -119,6 +119,9 @@ export class HaTab extends LitElement { :host([narrow]) { padding: 0 16px; } + :host([narrow]) div { + padding: 0; + } `; } } From d05e02ab3eb6561c2690c3e751a2eae8ae34301d Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 22 May 2021 19:26:27 +0200 Subject: [PATCH 076/117] Add the Supervisor as an ignorable discovery source (#9229) --- src/data/config_flow.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/data/config_flow.ts b/src/data/config_flow.ts index 04ecff9915..caa61f48bc 100644 --- a/src/data/config_flow.ts +++ b/src/data/config_flow.ts @@ -13,6 +13,7 @@ export const DISCOVERY_SOURCES = [ "zeroconf", "discovery", "mqtt", + "hassio", ]; export const ATTENTION_SOURCES = ["reauth"]; From 2ee92f48e6eaa0de017822e99d6fa19d1ca12d27 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 23 May 2021 02:04:38 +0000 Subject: [PATCH 077/117] Translation update --- translations/frontend/de.json | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/translations/frontend/de.json b/translations/frontend/de.json index da0b73e893..42ef8f7bc5 100644 --- a/translations/frontend/de.json +++ b/translations/frontend/de.json @@ -2917,7 +2917,7 @@ "controller_in_inclusion_mode": "Ihr Z-Wave-Controller befindet sich jetzt im Inklusionsmodus.", "follow_device_instructions": "Befolge die mit dem Gerät gelieferten Anweisungen, um die Kopplung am Gerät auszulösen.", "inclusion_failed": "Der Knoten konnte nicht hinzugefügt werden. Bitte überprüfe die Protokolle für weitere Informationen.", - "inclusion_finished": "Der Knoten wurde hinzugefügt. Es kann einige Minuten dauern, bis alle Einheiten angezeigt werden, da der Knoten im Hintergrund fertig eingerichtet wird.", + "inclusion_finished": "Der Knoten wurde hinzugefügt.", "interview_failed": "Das Geräteinterview ist fehlgeschlagen. Zusätzliche Informationen sind möglicherweise in den Logs verfügbar.", "interview_started": "Das Gerät wird gerade eingerichtet. Dies könnte eine Weile dauern.", "introduction": "Dieser Assistent führt dich durch das Hinzufügen eines Knotens zu deinem Z-Wave-Netzwerk.", @@ -4009,14 +4009,15 @@ "reset": "zurücksetzen" }, "time_format": { - "description": "Wählen Sie, wie die Zeiten formatiert werden sollen.", - "dropdown_label": "Zeitformatierung", + "description": "Wähle aus, wie Zeiten formatiert werden sollen.", + "dropdown_label": "Zeitformat", "formats": { "12": "12 Stunden (AM/PM)", "24": "24 Stunden", - "system": "Systemstandart verwenden" + "language": "Auto (Spracheinstellung verwenden)", + "system": "Systemeinstellungen verwenden" }, - "header": "Zeitformatierung" + "header": "Zeitformat" }, "vibrate": { "description": "Aktiviere oder deaktiviere die Vibration an diesem Gerät, wenn du Geräte steuerst.", From 583cc4bc8aa82cba2cb4912c306111eb45de20c5 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 24 May 2021 02:01:00 +0000 Subject: [PATCH 078/117] Translation update --- translations/frontend/it.json | 11 ++++++++ translations/frontend/ko.json | 11 ++++++++ translations/frontend/pt-BR.json | 44 +++++++++++++++++++++++++++++- translations/frontend/zh-Hans.json | 2 +- 4 files changed, 66 insertions(+), 2 deletions(-) diff --git a/translations/frontend/it.json b/translations/frontend/it.json index 5a5c997ed3..27eb316235 100644 --- a/translations/frontend/it.json +++ b/translations/frontend/it.json @@ -4008,6 +4008,17 @@ "primary_color": "Colore principale", "reset": "Reset" }, + "time_format": { + "description": "Scegli come vengono formattate le ore.", + "dropdown_label": "Formato orario", + "formats": { + "12": "12 ore (AM/PM)", + "24": "24 ore", + "language": "Automatico (usa l'impostazione della lingua)", + "system": "Usa le impostazioni locali del sistema" + }, + "header": "Formato orario" + }, "vibrate": { "description": "Abilitare o disabilitare la vibrazione su questo dispositivo durante il controllo dei dispositivi.", "header": "Vibrazione" diff --git a/translations/frontend/ko.json b/translations/frontend/ko.json index 436c954629..d4dc2576f4 100644 --- a/translations/frontend/ko.json +++ b/translations/frontend/ko.json @@ -4008,6 +4008,17 @@ "primary_color": "주 색상", "reset": "초기화" }, + "time_format": { + "description": "시간 형식을 선택하십시오.", + "dropdown_label": "시간 형식", + "formats": { + "12": "12시간(오전/오후)", + "24": "24시간", + "language": "자동 (언어 설정 사용)", + "system": "시스템 로케일 사용" + }, + "header": "시간 형식" + }, "vibrate": { "description": "기기를 제어할 때 이 기기에서 진동을 활성화 또는 비활성화합니다.", "header": "진동 효과" diff --git a/translations/frontend/pt-BR.json b/translations/frontend/pt-BR.json index 6a149061b7..87168ecd09 100644 --- a/translations/frontend/pt-BR.json +++ b/translations/frontend/pt-BR.json @@ -120,9 +120,15 @@ } }, "snapshot": { + "created": "Criado", "folder": { "homeassistant": "Configuração do Home Assistant" } + }, + "system": { + "supervisor": { + "search": "Procurar" + } } }, "ui": { @@ -694,6 +700,12 @@ "zha_device_card": { "device_name_placeholder": "Alterar o nome do dispositivo" } + }, + "zha_reconfigure_device": { + "attribute": "Atributo", + "bind_header": "Vinculação", + "min_max_change": "min/máx/mudança", + "reporting_header": "Relatório" } }, "duration": { @@ -732,7 +744,8 @@ "caption": "Áreas", "data_table": { "area": "Área", - "devices": "Dispositivos" + "devices": "Dispositivos", + "entities": "Entidades" }, "delete": { "confirmation_text": "Todos os dispositivos nesta área ficarão sem designação.", @@ -744,6 +757,7 @@ "create": "Criar", "default_name": "Nova Zona", "delete": "Excluir", + "linked_entities_caption": "Entidades", "name": "Nome", "name_required": "Nome é obrigatório", "unknown_error": "Erro desconhecido", @@ -1131,10 +1145,15 @@ "remote": { "access_is_being_prepared": "O acesso remoto está sendo preparado. Vamos notificá-lo quando estiver pronto.", "certificate_info": "Informações do certificado", + "connected": "Conectado", "info": "O Home Assistant Cloud fornece uma conexão remota segura à sua instância enquanto estiver fora de casa.", "instance_is_available": "Sua instância está disponível em", "instance_will_be_available": "Sua instância estará disponível em", "link_learn_how_it_works": "Aprenda como funciona", + "not_connected": "Não Conectado", + "remote_enabled": { + "caption": "Conectar automaticamente" + }, "title": "Controle Remoto" }, "sign_out": "Sair", @@ -1475,6 +1494,7 @@ "license": "Publicado sob a licença Apache 2.0", "path_configuration": "Caminho para configuration.yaml: {path}", "server": "servidor", + "setup_time": "Tempo de configuração", "source": "Código fonte:", "system_health_error": "O componente System Health não foi carregado. Adicione 'system_health:' ao configuration.yaml", "system_health": { @@ -1524,6 +1544,7 @@ }, "finish": "Terminar", "loading_first_time": "Aguarde enquanto a integração está sendo instalada", + "next": "Próximo", "not_all_required_fields": "Nem todos os campos obrigatórios são preenchidos.", "submit": "Enviar" }, @@ -1785,6 +1806,8 @@ "add_scene": "Adicionar cena", "delete_confirm": "Tem certeza de que deseja excluir esta cena?", "delete_scene": "Excluir cena", + "duplicate": "Duplicado", + "duplicate_scene": "Cena duplicada", "edit_scene": "Editar cena", "header": "Editor de cena", "headers": { @@ -2082,6 +2105,14 @@ "introduction": "As zonas permitem especificar determinadas regiões da Terra. Quando uma pessoa está dentro de uma zona, o estado assume o nome da zona. As zonas também podem ser usadas como gatilho ou condição nas configurações de automações.", "no_zones_created_yet": "Parece que você ainda não criou nenhuma zona." }, + "zwave_js": { + "logs": { + "log_level": "Nível de Log" + }, + "navigation": { + "logs": "Logs" + } + }, "zwave": { "button": "Configurar", "common": { @@ -2971,6 +3002,17 @@ "primary_color": "Cor Principal", "reset": "Redefinir" }, + "time_format": { + "description": "Escolha como os horários são formatados.", + "dropdown_label": "Formato de hora", + "formats": { + "12": "Horas", + "24": "Horas", + "language": "Auto (usar configuração de idioma)", + "system": "Use a localidade do sistema" + }, + "header": "Formato de hora" + }, "vibrate": { "description": "Ative ou desative a vibração neste dispositivo ao controlar dispositivos.", "header": "Vibrar" diff --git a/translations/frontend/zh-Hans.json b/translations/frontend/zh-Hans.json index 6ca80b6386..01eee193b8 100644 --- a/translations/frontend/zh-Hans.json +++ b/translations/frontend/zh-Hans.json @@ -2192,7 +2192,7 @@ "configure": "选项", "delete": "删除", "delete_confirm": "您确定要删除此集成吗?", - "depends_on_cloud": "取决于云端", + "depends_on_cloud": "依赖云端服务", "device_unavailable": "设备不可用", "devices": "{count} {count, plural,\n one {个设备}\n other {个设备}\n}", "disable_restart_confirm": "重启 Home Assistant 以完成此集成的禁用", From 0af14eb77e39856e7f0417901b316dbff81bbf8c Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Mon, 24 May 2021 22:37:29 +0200 Subject: [PATCH 079/117] Add refresh button to state dev tools (#9231) --- .../state/developer-tools-state.js | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/panels/developer-tools/state/developer-tools-state.js b/src/panels/developer-tools/state/developer-tools-state.js index 5d7cd84cc4..aff517c2ba 100644 --- a/src/panels/developer-tools/state/developer-tools-state.js +++ b/src/panels/developer-tools/state/developer-tools-state.js @@ -2,6 +2,7 @@ import "@material/mwc-button"; import { mdiClipboardTextMultipleOutline, mdiInformationOutline, + mdiRefresh, } from "@mdi/js"; import "@polymer/paper-checkbox/paper-checkbox"; import "@polymer/paper-input/paper-input"; @@ -46,8 +47,10 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { padding: 0 16px; } - mwc-button { + .button-row { + display: flex; margin-top: 8px; + align-items: center; } .table-wrapper { @@ -139,9 +142,19 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { error="[[!validJSON]]" on-value-changed="_yamlChanged" > - [[localize('ui.panel.developer-tools.tabs.states.set_state')]] +
+ [[localize('ui.panel.developer-tools.tabs.states.set_state')]] + +
diff --git a/src/dialogs/more-info/controls/more-info-person.ts b/src/dialogs/more-info/controls/more-info-person.ts index f1b610d26d..59cab3c14b 100644 --- a/src/dialogs/more-info/controls/more-info-person.ts +++ b/src/dialogs/more-info/controls/more-info-person.ts @@ -24,6 +24,7 @@ class MoreInfoPerson extends LitElement { return html` diff --git a/src/dialogs/more-info/controls/more-info-remote.ts b/src/dialogs/more-info/controls/more-info-remote.ts index c8e9c8b779..421537bf67 100644 --- a/src/dialogs/more-info/controls/more-info-remote.ts +++ b/src/dialogs/more-info/controls/more-info-remote.ts @@ -48,6 +48,7 @@ class MoreInfoRemote extends LitElement { : ""} diff --git a/src/dialogs/more-info/controls/more-info-timer.ts b/src/dialogs/more-info/controls/more-info-timer.ts index 92d06002bb..daf2e8e97f 100644 --- a/src/dialogs/more-info/controls/more-info-timer.ts +++ b/src/dialogs/more-info/controls/more-info-timer.ts @@ -18,6 +18,7 @@ class MoreInfoTimer extends LitElement { return html` diff --git a/src/dialogs/more-info/controls/more-info-vacuum.ts b/src/dialogs/more-info/controls/more-info-vacuum.ts index ca6a5fb73b..c1841b7a5f 100644 --- a/src/dialogs/more-info/controls/more-info-vacuum.ts +++ b/src/dialogs/more-info/controls/more-info-vacuum.ts @@ -190,6 +190,7 @@ class MoreInfoVacuum extends LitElement { : ""} diff --git a/src/translations/en.json b/src/translations/en.json index 8eca3f64cd..cfa351e689 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -522,6 +522,9 @@ "calendar": { "my_calendars": "My Calendars", "today": "Today" + }, + "attributes": { + "expansion_header": "Attributes" } }, "dialogs": { From 21a3a8c5941b0152b71b45d1a59e31f615323b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Tue, 25 May 2021 17:46:36 +0200 Subject: [PATCH 089/117] Navigate cleanup (#9202) --- demo/src/ha-demo.ts | 2 +- .../src/addon-store/hassio-addon-repository.ts | 2 +- hassio/src/addon-store/hassio-addon-store.ts | 2 +- hassio/src/addon-view/hassio-addon-dashboard.ts | 2 +- hassio/src/addon-view/info/hassio-addon-info.ts | 4 ++-- hassio/src/dashboard/hassio-addons.ts | 4 ++-- hassio/src/hassio-main.ts | 2 +- hassio/src/hassio-my-redirect.ts | 2 +- hassio/src/ingress-view/hassio-ingress-view.ts | 4 ++-- src/common/navigate.ts | 12 ++++++++---- src/data/automation.ts | 7 ++----- src/data/scene.ts | 7 ++----- src/data/script.ts | 7 ++----- src/data/zone.ts | 7 ++----- .../more-info/controls/more-info-person.ts | 2 +- src/dialogs/more-info/ha-more-info-dialog.ts | 2 +- src/dialogs/quick-bar/ha-quick-bar.ts | 2 +- src/entrypoints/custom-panel.ts | 4 ++-- src/layouts/hass-router-page.ts | 4 ++-- src/layouts/home-assistant.ts | 4 ++-- src/mixins/navigate-mixin.js | 2 +- src/onboarding/onboarding-restore-snapshot.ts | 2 +- .../config/areas/dialog-area-registry-detail.ts | 2 +- .../config/areas/ha-config-areas-dashboard.ts | 2 +- .../config/automation/dialog-new-automation.ts | 6 +++--- .../config/automation/ha-automation-editor.ts | 4 ++-- .../config/automation/ha-automation-picker.ts | 2 +- .../config/blueprint/ha-blueprint-overview.ts | 11 ++++------- src/panels/config/cloud/ha-config-cloud.ts | 4 ++-- .../device-detail/ha-device-automation-card.ts | 4 ++-- .../ozw/ha-device-actions-ozw.ts | 1 - .../zha/ha-device-actions-zha.ts | 7 ++----- .../config/devices/ha-config-device-page.ts | 2 +- .../devices/ha-config-devices-dashboard.ts | 4 ++-- src/panels/config/entities/ha-config-entities.ts | 2 +- .../integrations/ha-config-integrations.ts | 2 +- .../ozw/ozw-config-dashboard.ts | 8 +++----- .../ozw/ozw-network-dashboard.ts | 2 +- .../integration-panels/ozw/ozw-network-nodes.ts | 4 ++-- .../integration-panels/ozw/ozw-node-config.ts | 6 ++++-- .../integration-panels/ozw/ozw-node-dashboard.ts | 6 ++++-- .../integration-panels/ozw/ozw-node-router.ts | 3 +-- .../integration-panels/zha/zha-add-group-page.ts | 2 +- .../zha/zha-config-dashboard-router.ts | 3 +-- .../integration-panels/zha/zha-group-page.ts | 2 +- .../zha/zha-groups-dashboard.ts | 2 +- .../zha/zha-network-visualization-page.ts | 6 +----- .../zwave/zwave-config-router.ts | 3 +-- .../integration-panels/zwave/zwave-migration.ts | 2 +- .../zwave_js/zwave_js-config-router.ts | 3 +-- .../dashboards/ha-config-lovelace-dashboards.ts | 3 +-- src/panels/config/scene/ha-scene-editor.ts | 4 ++-- src/panels/config/script/ha-script-editor.ts | 4 ++-- src/panels/config/tags/ha-config-tags.ts | 2 +- src/panels/config/zone/ha-config-zone.ts | 4 ++-- src/panels/custom/ha-panel-custom.ts | 6 +++--- .../developer-tools/ha-panel-developer-tools.ts | 2 +- src/panels/lovelace/common/handle-action.ts | 2 +- .../editor/view-editor/hui-dialog-edit-view.ts | 2 +- src/panels/lovelace/hui-root.ts | 16 +++++++--------- src/panels/map/ha-panel-map.js | 2 +- src/panels/my/ha-panel-my.ts | 10 ++++------ 62 files changed, 111 insertions(+), 137 deletions(-) diff --git a/demo/src/ha-demo.ts b/demo/src/ha-demo.ts index 70bcbb50d4..349968e28d 100644 --- a/demo/src/ha-demo.ts +++ b/demo/src/ha-demo.ts @@ -70,7 +70,7 @@ class HaDemo extends HomeAssistantAppEl { } e.preventDefault(); - navigate(this, href); + navigate(href); }, { capture: true } ); diff --git a/hassio/src/addon-store/hassio-addon-repository.ts b/hassio/src/addon-store/hassio-addon-repository.ts index 6c510374e0..513f053d1c 100644 --- a/hassio/src/addon-store/hassio-addon-repository.ts +++ b/hassio/src/addon-store/hassio-addon-repository.ts @@ -120,7 +120,7 @@ class HassioAddonRepositoryEl extends LitElement { } private _addonTapped(ev) { - navigate(this, `/hassio/addon/${ev.currentTarget.addon.slug}`); + navigate(`/hassio/addon/${ev.currentTarget.addon.slug}`); } static get styles(): CSSResultGroup { diff --git a/hassio/src/addon-store/hassio-addon-store.ts b/hassio/src/addon-store/hassio-addon-store.ts index 13e55215b0..a1dbe3237f 100644 --- a/hassio/src/addon-store/hassio-addon-store.ts +++ b/hassio/src/addon-store/hassio-addon-store.ts @@ -138,7 +138,7 @@ class HassioAddonStore extends LitElement { protected firstUpdated(changedProps: PropertyValues) { super.firstUpdated(changedProps); const repositoryUrl = extractSearchParam("repository_url"); - navigate(this, "/hassio/store", true); + navigate("/hassio/store", { replace: true }); if (repositoryUrl) { this._manageRepositories(repositoryUrl); } diff --git a/hassio/src/addon-view/hassio-addon-dashboard.ts b/hassio/src/addon-view/hassio-addon-dashboard.ts index 8b7fd81e80..47c5fdeac1 100644 --- a/hassio/src/addon-view/hassio-addon-dashboard.ts +++ b/hassio/src/addon-view/hassio-addon-dashboard.ts @@ -175,7 +175,7 @@ class HassioAddonDashboard extends LitElement { if (!validAddon) { this._error = this.supervisor.localize("my.error_addon_not_found"); } else { - navigate(this, `/hassio/addon/${requestedAddon}`, true); + navigate(`/hassio/addon/${requestedAddon}`, { replace: true }); } } } diff --git a/hassio/src/addon-view/info/hassio-addon-info.ts b/hassio/src/addon-view/info/hassio-addon-info.ts index 6c1291b63b..0fe37230bb 100644 --- a/hassio/src/addon-view/info/hassio-addon-info.ts +++ b/hassio/src/addon-view/info/hassio-addon-info.ts @@ -761,7 +761,7 @@ class HassioAddonInfo extends LitElement { } private _openIngress(): void { - navigate(this, `/hassio/ingress/${this.addon.slug}`); + navigate(`/hassio/ingress/${this.addon.slug}`); } private get _computeShowIngressUI(): boolean { @@ -1051,7 +1051,7 @@ class HassioAddonInfo extends LitElement { } private _openConfiguration(): void { - navigate(this, `/hassio/addon/${this.addon.slug}/config`); + navigate(`/hassio/addon/${this.addon.slug}/config`); } private async _uninstallClicked(ev: CustomEvent): Promise { diff --git a/hassio/src/dashboard/hassio-addons.ts b/hassio/src/dashboard/hassio-addons.ts index eb79281170..06abd3e4d5 100644 --- a/hassio/src/dashboard/hassio-addons.ts +++ b/hassio/src/dashboard/hassio-addons.ts @@ -96,11 +96,11 @@ class HassioAddons extends LitElement { } private _addonTapped(ev: any): void { - navigate(this, `/hassio/addon/${ev.currentTarget.addon.slug}/info`); + navigate(`/hassio/addon/${ev.currentTarget.addon.slug}/info`); } private _openStore(): void { - navigate(this, "/hassio/store"); + navigate("/hassio/store"); } } diff --git a/hassio/src/hassio-main.ts b/hassio/src/hassio-main.ts index 1006932d0b..280654bf7d 100644 --- a/hassio/src/hassio-main.ts +++ b/hassio/src/hassio-main.ts @@ -63,7 +63,7 @@ export class HassioMain extends SupervisorBaseElement { document.body.addEventListener("click", (ev) => { const href = isNavigationClick(ev); if (href) { - navigate(document.body, href); + navigate(href); } }); diff --git a/hassio/src/hassio-my-redirect.ts b/hassio/src/hassio-my-redirect.ts index f24ab95a5b..54d0d928ca 100644 --- a/hassio/src/hassio-my-redirect.ts +++ b/hassio/src/hassio-my-redirect.ts @@ -89,7 +89,7 @@ class HassioMyRedirect extends LitElement { return; } - navigate(this, url, true); + navigate(url, { replace: true }); } protected render(): TemplateResult { diff --git a/hassio/src/ingress-view/hassio-ingress-view.ts b/hassio/src/ingress-view/hassio-ingress-view.ts index 04ef8d250d..6329c3748d 100644 --- a/hassio/src/ingress-view/hassio-ingress-view.ts +++ b/hassio/src/ingress-view/hassio-ingress-view.ts @@ -105,7 +105,7 @@ class HassioIngressView extends LitElement { }); history.back(); } else { - navigate(this, `/hassio/ingress/${addonInfo.slug}`, true); + navigate(`/hassio/ingress/${addonInfo.slug}`, { replace: true }); } } } @@ -157,8 +157,8 @@ class HassioIngressView extends LitElement { await showAlertDialog(this, { text: "Add-on is not running. Please start it first", title: addon.name, + confirm: () => navigate(`/hassio/addon/${addon.slug}`), }); - navigate(this, `/hassio/addon/${addon.slug}/info`, true); return; } diff --git a/src/common/navigate.ts b/src/common/navigate.ts index 662ad2bc1f..e2e0f26dd0 100644 --- a/src/common/navigate.ts +++ b/src/common/navigate.ts @@ -4,13 +4,17 @@ import { mainWindow } from "./dom/get_main_window"; declare global { // for fire event interface HASSDomEvents { - "location-changed": { - replace: boolean; - }; + "location-changed": NavigateOptions; } } -export const navigate = (_node: any, path: string, replace = false) => { +export interface NavigateOptions { + replace?: boolean; +} + +export const navigate = (path: string, options?: NavigateOptions) => { + const replace = options?.replace || false; + if (__DEMO__) { if (replace) { mainWindow.history.replaceState( diff --git a/src/data/automation.ts b/src/data/automation.ts index 21bd303a62..d6e308ccf3 100644 --- a/src/data/automation.ts +++ b/src/data/automation.ts @@ -241,12 +241,9 @@ let inititialAutomationEditorData: Partial | undefined; export const getAutomationConfig = (hass: HomeAssistant, id: string) => hass.callApi("GET", `config/automation/config/${id}`); -export const showAutomationEditor = ( - el: HTMLElement, - data?: Partial -) => { +export const showAutomationEditor = (data?: Partial) => { inititialAutomationEditorData = data; - navigate(el, "/config/automation/edit/new"); + navigate("/config/automation/edit/new"); }; export const getAutomationEditorInitData = () => { diff --git a/src/data/scene.ts b/src/data/scene.ts index f77972af6a..5851c48584 100644 --- a/src/data/scene.ts +++ b/src/data/scene.ts @@ -20,12 +20,9 @@ export const SCENE_IGNORED_DOMAINS = [ let inititialSceneEditorData: Partial | undefined; -export const showSceneEditor = ( - el: HTMLElement, - data?: Partial -) => { +export const showSceneEditor = (data?: Partial) => { inititialSceneEditorData = data; - navigate(el, "/config/scene/edit/new"); + navigate("/config/scene/edit/new"); }; export const getSceneEditorInitData = () => { diff --git a/src/data/script.ts b/src/data/script.ts index dc7858768b..559af3a4e3 100644 --- a/src/data/script.ts +++ b/src/data/script.ts @@ -182,12 +182,9 @@ export const deleteScript = (hass: HomeAssistant, objectId: string) => let inititialScriptEditorData: Partial | undefined; -export const showScriptEditor = ( - el: HTMLElement, - data?: Partial -) => { +export const showScriptEditor = (data?: Partial) => { inititialScriptEditorData = data; - navigate(el, "/config/script/edit/new"); + navigate("/config/script/edit/new"); }; export const getScriptEditorInitData = () => { diff --git a/src/data/zone.ts b/src/data/zone.ts index 568e9ac465..737ae07dd8 100644 --- a/src/data/zone.ts +++ b/src/data/zone.ts @@ -56,12 +56,9 @@ export const deleteZone = (hass: HomeAssistant, zoneId: string) => let inititialZoneEditorData: Partial | undefined; -export const showZoneEditor = ( - el: HTMLElement, - data?: Partial -) => { +export const showZoneEditor = (data?: Partial) => { inititialZoneEditorData = data; - navigate(el, "/config/zone/new"); + navigate("/config/zone/new"); }; export const getZoneEditorInitData = () => { diff --git a/src/dialogs/more-info/controls/more-info-person.ts b/src/dialogs/more-info/controls/more-info-person.ts index 59cab3c14b..328b73dc97 100644 --- a/src/dialogs/more-info/controls/more-info-person.ts +++ b/src/dialogs/more-info/controls/more-info-person.ts @@ -55,7 +55,7 @@ class MoreInfoPerson extends LitElement { } private _handleAction() { - showZoneEditor(this, { + showZoneEditor({ latitude: this.stateObj!.attributes.latitude, longitude: this.stateObj!.attributes.longitude, }); diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index ff89f71c82..b5c72f87da 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -306,7 +306,7 @@ export class MoreInfoDialog extends LitElement { idToPassThroughUrl = stateObj.attributes.id; } - navigate(this, `/config/${domain}/edit/${idToPassThroughUrl}`); + navigate(`/config/${domain}/edit/${idToPassThroughUrl}`); this.closeDialog(); } diff --git a/src/dialogs/quick-bar/ha-quick-bar.ts b/src/dialogs/quick-bar/ha-quick-bar.ts index ea8c9e2e9d..1741d63ec8 100644 --- a/src/dialogs/quick-bar/ha-quick-bar.ts +++ b/src/dialogs/quick-bar/ha-quick-bar.ts @@ -557,7 +557,7 @@ export class QuickBar extends LitElement { categoryText: this.hass.localize( `ui.dialogs.quick-bar.commands.types.${categoryKey}` ), - action: () => navigate(this, item.path), + action: () => navigate(item.path), }; return { diff --git a/src/entrypoints/custom-panel.ts b/src/entrypoints/custom-panel.ts index 6d77428bbc..e2da175ea8 100644 --- a/src/entrypoints/custom-panel.ts +++ b/src/entrypoints/custom-panel.ts @@ -88,7 +88,7 @@ function initialize( if (window.parent.customPanel) { window.parent.customPanel.navigate( window.location.pathname, - ev.detail ? ev.detail.replace : false + ev.detail ); } }); @@ -122,7 +122,7 @@ function initialize( document.body.addEventListener("click", (ev) => { const href = isNavigationClick(ev); if (href) { - navigate(document.body, href); + navigate(href); } }); } diff --git a/src/layouts/hass-router-page.ts b/src/layouts/hass-router-page.ts index 17ed986ee3..5c37cd577c 100644 --- a/src/layouts/hass-router-page.ts +++ b/src/layouts/hass-router-page.ts @@ -99,7 +99,7 @@ export class HassRouterPage extends ReactiveElement { const defaultPage = routerOptions.defaultPage; if (route && route.path === "" && defaultPage !== undefined) { - navigate(this, `${route.prefix}/${defaultPage}`, true); + navigate(`${route.prefix}/${defaultPage}`, { replace: true }); } let newPage = route @@ -127,7 +127,7 @@ export class HassRouterPage extends ReactiveElement { // Update the url if we know where we're mounted. if (route) { - navigate(this, `${route.prefix}/${result}`, true); + navigate(`${route.prefix}/${result}`, { replace: true }); } } } diff --git a/src/layouts/home-assistant.ts b/src/layouts/home-assistant.ts index e9c5efa758..6b4004938d 100644 --- a/src/layouts/home-assistant.ts +++ b/src/layouts/home-assistant.ts @@ -45,7 +45,7 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { const path = curPath(); if (["", "/"].includes(path)) { - navigate(this, `/${getStorageDefaultPanelUrlPath()}`, true); + navigate(`/${getStorageDefaultPanelUrlPath()}`, { replace: true }); } this._route = { prefix: "", @@ -106,7 +106,7 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) { window.addEventListener("click", (ev) => { const href = isNavigationClick(ev); if (href) { - navigate(this, href); + navigate(href); } }); } diff --git a/src/mixins/navigate-mixin.js b/src/mixins/navigate-mixin.js index 7b8764c65b..2a2f8aac5d 100644 --- a/src/mixins/navigate-mixin.js +++ b/src/mixins/navigate-mixin.js @@ -9,7 +9,7 @@ export default dedupingMixin( (superClass) => class extends superClass { navigate(...args) { - navigate(this, ...args); + navigate(...args); } } ); diff --git a/src/onboarding/onboarding-restore-snapshot.ts b/src/onboarding/onboarding-restore-snapshot.ts index 9d133d3b82..32d604c7ac 100644 --- a/src/onboarding/onboarding-restore-snapshot.ts +++ b/src/onboarding/onboarding-restore-snapshot.ts @@ -63,7 +63,7 @@ class OnboardingRestoreSnapshot extends ProvideHassLitMixin(LitElement) { }); if (response.status === 401) { // If we get a unauthorized response, the restore is done - navigate(this, "/", true); + navigate("/", { replace: true }); location.reload(); } } catch (err) { diff --git a/src/panels/config/areas/dialog-area-registry-detail.ts b/src/panels/config/areas/dialog-area-registry-detail.ts index 9d192b91ee..0add7268b5 100644 --- a/src/panels/config/areas/dialog-area-registry-detail.ts +++ b/src/panels/config/areas/dialog-area-registry-detail.ts @@ -149,7 +149,7 @@ class DialogAreaDetail extends LitElement { this._submitting = false; } - navigate(this, "/config/areas/dashboard"); + navigate("/config/areas/dashboard"); } static get styles(): CSSResultGroup { diff --git a/src/panels/config/areas/ha-config-areas-dashboard.ts b/src/panels/config/areas/ha-config-areas-dashboard.ts index e0888c063f..92bdbe225b 100644 --- a/src/panels/config/areas/ha-config-areas-dashboard.ts +++ b/src/panels/config/areas/ha-config-areas-dashboard.ts @@ -192,7 +192,7 @@ export class HaConfigAreasDashboard extends LitElement { private _handleRowClicked(ev: HASSDomEvent) { const areaId = ev.detail.id; - navigate(this, `/config/areas/area/${areaId}`); + navigate(`/config/areas/area/${areaId}`); } private _openDialog(entry?: AreaRegistryEntry) { diff --git a/src/panels/config/automation/dialog-new-automation.ts b/src/panels/config/automation/dialog-new-automation.ts index 3ab6c12b2b..a86d06bc19 100644 --- a/src/panels/config/automation/dialog-new-automation.ts +++ b/src/panels/config/automation/dialog-new-automation.ts @@ -108,7 +108,7 @@ class DialogNewAutomation extends LitElement implements HassDialog { replaceDialog(); showThingtalkDialog(this, { callback: (config: Partial | undefined) => - showAutomationEditor(this, config), + showAutomationEditor(config), input: this.shadowRoot!.querySelector("paper-input")!.value as string, }); this.closeDialog(); @@ -117,13 +117,13 @@ class DialogNewAutomation extends LitElement implements HassDialog { private async _blueprintPicked(ev: CustomEvent) { this.closeDialog(); await nextRender(); - showAutomationEditor(this, { use_blueprint: { path: ev.detail.value } }); + showAutomationEditor({ use_blueprint: { path: ev.detail.value } }); } private async _blank() { this.closeDialog(); await nextRender(); - showAutomationEditor(this); + showAutomationEditor(); } static get styles(): CSSResultGroup { diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 3df134e59b..8d6057762d 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -450,7 +450,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { // Wait for dialog to complate closing await new Promise((resolve) => setTimeout(resolve, 0)); } - showAutomationEditor(this, { + showAutomationEditor({ ...this._config, id: undefined, alias: `${this._config?.alias} (${this.hass.localize( @@ -503,7 +503,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { this._dirty = false; if (!this.automationId) { - navigate(this, `/config/automation/edit/${id}`, true); + navigate(`/config/automation/edit/${id}`, { replace: true }); } }, (errors) => { diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index c7526a58da..e2970fc3a5 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -324,7 +324,7 @@ class HaAutomationPicker extends LitElement { ) { showNewAutomationDialog(this); } else { - navigate(this, "/config/automation/edit/new"); + navigate("/config/automation/edit/new"); } } diff --git a/src/panels/config/blueprint/ha-blueprint-overview.ts b/src/panels/config/blueprint/ha-blueprint-overview.ts index 9f0618dc60..37b4fba05f 100644 --- a/src/panels/config/blueprint/ha-blueprint-overview.ts +++ b/src/panels/config/blueprint/ha-blueprint-overview.ts @@ -46,11 +46,8 @@ interface BlueprintMetaDataPath extends BlueprintMetaData { } const createNewFunctions = { - automation: ( - context: HaBlueprintOverview, - blueprintMeta: BlueprintMetaDataPath - ) => { - showAutomationEditor(context, { + automation: (blueprintMeta: BlueprintMetaDataPath) => { + showAutomationEditor({ alias: blueprintMeta.name, use_blueprint: { path: blueprintMeta.path }, }); @@ -183,7 +180,7 @@ class HaBlueprintOverview extends LitElement { super.firstUpdated(changedProps); if (this.route.path === "/import") { const url = extractSearchParam("blueprint_url"); - navigate(this, "/config/blueprint/dashboard", true); + navigate("/config/blueprint/dashboard", { replace: true }); if (url) { this._addBlueprint(url); } @@ -280,7 +277,7 @@ class HaBlueprintOverview extends LitElement { private _createNew(ev) { const blueprint = ev.currentTarget.blueprint as BlueprintMetaDataPath; - createNewFunctions[blueprint.domain](this, blueprint); + createNewFunctions[blueprint.domain](blueprint); } private _share(ev) { diff --git a/src/panels/config/cloud/ha-config-cloud.ts b/src/panels/config/cloud/ha-config-cloud.ts index 62db01a437..8fe5c0a085 100644 --- a/src/panels/config/cloud/ha-config-cloud.ts +++ b/src/panels/config/cloud/ha-config-cloud.ts @@ -81,7 +81,7 @@ class HaConfigCloud extends HassRouterPage { super.firstUpdated(changedProps); this.addEventListener("cloud-done", (ev) => { this._flashMessage = (ev as any).detail.flashMessage; - navigate(this, "/config/cloud/login"); + navigate("/config/cloud/login"); }); } @@ -95,7 +95,7 @@ class HaConfigCloud extends HassRouterPage { if (oldStatus === undefined) { this._resolveCloudStatusLoaded(); } else if (oldStatus.logged_in !== this.cloudStatus.logged_in) { - navigate(this, this.route.prefix, true); + navigate(this.route.prefix, { replace: true }); } } } diff --git a/src/panels/config/devices/device-detail/ha-device-automation-card.ts b/src/panels/config/devices/device-detail/ha-device-automation-card.ts index b77958e820..741c426f3d 100644 --- a/src/panels/config/devices/device-detail/ha-device-automation-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-automation-card.ts @@ -72,12 +72,12 @@ export abstract class HaDeviceAutomationCard< return; } if (this.script) { - showScriptEditor(this, { sequence: [automation as DeviceAction] }); + showScriptEditor({ sequence: [automation as DeviceAction] }); return; } const data = {}; data[this.type] = [automation]; - showAutomationEditor(this, data); + showAutomationEditor(data); } static get styles(): CSSResultGroup { diff --git a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts index d932d2edc4..3608c6514d 100644 --- a/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts +++ b/src/panels/config/devices/device-detail/integration-elements/ozw/ha-device-actions-ozw.ts @@ -66,7 +66,6 @@ export class HaDeviceActionsOzw extends LitElement { private async _nodeDetailsClicked() { navigate( - this, `/config/ozw/network/${this.ozw_instance}/node/${this.node_id}/dashboard` ); } diff --git a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts index cffd1ca1e2..2a0337c043 100644 --- a/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts +++ b/src/panels/config/devices/device-detail/integration-elements/zha/ha-device-actions-zha.ts @@ -107,14 +107,11 @@ export class HaDeviceActionsZha extends LitElement { } private _onAddDevicesClick() { - navigate(this, "/config/zha/add/" + this._zhaDevice!.ieee); + navigate(`/config/zha/add/${this._zhaDevice!.ieee}`); } private _onViewInVisualizationClick() { - navigate( - this, - "/config/zha/visualization/" + this._zhaDevice!.device_reg_id - ); + navigate(`/config/zha/visualization/${this._zhaDevice!.device_reg_id}`); } private async _handleZigbeeInfoClicked() { diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index 8211702ead..3e2cdcfd4e 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -533,7 +533,7 @@ export class HaConfigDevicePage extends LitElement { this._entities(this.deviceId, this.entities).forEach((entity) => { entities[entity.entity_id] = ""; }); - showSceneEditor(this, { + showSceneEditor({ entities, }); } diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index 3c8c47af0c..b30b7a24d4 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -455,7 +455,7 @@ export class HaConfigDeviceDashboard extends LitElement { private _handleRowClicked(ev: HASSDomEvent) { const deviceId = ev.detail.id; this._ignoreLocationChange = true; - navigate(this, `/config/devices/device/${deviceId}`); + navigate(`/config/devices/device/${deviceId}`); } private _showDisabledChanged(ev: CustomEvent) { @@ -473,7 +473,7 @@ export class HaConfigDeviceDashboard extends LitElement { if ( this._activeFilters(this.entries, this._searchParms, this.hass.localize) ) { - navigate(this, window.location.pathname, true); + navigate(window.location.pathname, { replace: true }); } this._showDisabled = true; } diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index 82bcdf3e8c..40c32e4d3c 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -837,7 +837,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { if ( this._activeFilters(this._searchParms, this.hass.localize, this._entries) ) { - navigate(this, window.location.pathname, true); + navigate(window.location.pathname, { replace: true }); } this._showDisabled = true; this._showReadOnly = true; diff --git a/src/panels/config/integrations/ha-config-integrations.ts b/src/panels/config/integrations/ha-config-integrations.ts index 3041e10fc4..20546603cb 100644 --- a/src/panels/config/integrations/ha-config-integrations.ts +++ b/src/panels/config/integrations/ha-config-integrations.ts @@ -599,7 +599,7 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { private async _handleAdd(localizePromise: Promise) { const domain = extractSearchParam("domain"); - navigate(this, "/config/integrations", true); + navigate("/config/integrations", { replace: true }); if (!domain) { return; } diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts index 5d4f673eff..2d64773059 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-config-dashboard.ts @@ -143,11 +143,9 @@ class OZWConfigDashboard extends LitElement { private async _fetchData() { this._instances = await fetchOZWInstances(this.hass!); if (this._instances.length === 1) { - navigate( - this, - `/config/ozw/network/${this._instances[0].ozw_instance}`, - true - ); + navigate(`/config/ozw/network/${this._instances[0].ozw_instance}`, { + replace: true, + }); } } diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts index aa56687d6c..46ba6fbd7d 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-network-dashboard.ts @@ -46,7 +46,7 @@ class OZWNetworkDashboard extends LitElement { protected firstUpdated() { if (!this.ozwInstance) { - navigate(this, "/config/ozw/dashboard", true); + navigate("/config/ozw/dashboard", { replace: true }); } else if (this.hass) { this._fetchData(); } diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts index 9de8234c6b..ce9ec48b4b 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-network-nodes.ts @@ -88,7 +88,7 @@ class OZWNetworkNodes extends LitElement { protected firstUpdated() { if (!this.ozwInstance) { - navigate(this, "/config/ozw/dashboard", true); + navigate("/config/ozw/dashboard", { replace: true }); } else if (this.hass) { this._fetchData(); } @@ -117,7 +117,7 @@ class OZWNetworkNodes extends LitElement { private _handleRowClicked(ev: HASSDomEvent) { const nodeId = ev.detail.id; - navigate(this, `/config/ozw/network/${this.ozwInstance}/node/${nodeId}`); + navigate(`/config/ozw/network/${this.ozwInstance}/node/${nodeId}`); } static get styles(): CSSResultGroup { diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts index 4eeda2d481..db7e9ee6e0 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-node-config.ts @@ -47,9 +47,11 @@ class OZWNodeConfig extends LitElement { protected firstUpdated() { if (!this.ozwInstance) { - navigate(this, "/config/ozw/dashboard", true); + navigate("/config/ozw/dashboard", { replace: true }); } else if (!this.nodeId) { - navigate(this, `/config/ozw/network/${this.ozwInstance}/nodes`, true); + navigate(`/config/ozw/network/${this.ozwInstance}/nodes`, { + replace: true, + }); } else { this._fetchData(); } diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts index af7d2089e0..c34a5bf729 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-node-dashboard.ts @@ -43,9 +43,11 @@ class OZWNodeDashboard extends LitElement { protected firstUpdated() { if (!this.ozwInstance) { - navigate(this, "/config/ozw/dashboard", true); + navigate("/config/ozw/dashboard", { replace: true }); } else if (!this.nodeId) { - navigate(this, `/config/ozw/network/${this.ozwInstance}/nodes`, true); + navigate(`/config/ozw/network/${this.ozwInstance}/nodes`, { + replace: true, + }); } else if (this.hass) { this._fetchData(); } diff --git a/src/panels/config/integrations/integration-panels/ozw/ozw-node-router.ts b/src/panels/config/integrations/integration-panels/ozw/ozw-node-router.ts index 5168e21138..f5676bdcaa 100644 --- a/src/panels/config/integrations/integration-panels/ozw/ozw-node-router.ts +++ b/src/panels/config/integrations/integration-panels/ozw/ozw-node-router.ts @@ -68,11 +68,10 @@ class OZWNodeRouter extends HassRouterPage { if (this._configEntry && !searchParams.has("config_entry")) { searchParams.append("config_entry", this._configEntry); navigate( - this, `${this.routeTail.prefix}${ this.routeTail.path }?${searchParams.toString()}`, - true + { replace: true } ); } } diff --git a/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts index b628231d84..34ed5174e2 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-add-group-page.ts @@ -138,7 +138,7 @@ export class ZHAAddGroupPage extends LitElement { this._processingAdd = false; this._groupName = ""; this._zhaDevicesDataTable.clearSelection(); - navigate(this, `/config/zha/group/${group.group_id}`, true); + navigate(`/config/zha/group/${group.group_id}`, { replace: true }); } private _handleNameChange(ev: PolymerChangedEvent) { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts index 87ed324256..8b0963b190 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-config-dashboard-router.ts @@ -67,11 +67,10 @@ class ZHAConfigDashboardRouter extends HassRouterPage { if (this._configEntry && !searchParams.has("config_entry")) { searchParams.append("config_entry", this._configEntry); navigate( - this, `${this.routeTail.prefix}${ this.routeTail.path }?${searchParams.toString()}`, - true + { replace: true } ); } } diff --git a/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts index d26a92f275..9d22b43bbb 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-group-page.ts @@ -273,7 +273,7 @@ export class ZHAGroupPage extends LitElement { private async _deleteGroup(): Promise { await removeGroups(this.hass, [this.groupId]); - navigate(this, `/config/zha/groups`, true); + navigate(`/config/zha/groups`, { replace: true }); } static get styles(): CSSResultGroup { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts b/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts index 3eff559dcc..39f77d934b 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-groups-dashboard.ts @@ -140,7 +140,7 @@ export class ZHAGroupsDashboard extends LitElement { private _handleRowClicked(ev: HASSDomEvent) { const groupId = ev.detail.id; - navigate(this, `/config/zha/group/${groupId}`); + navigate(`/config/zha/group/${groupId}`); } static get styles(): CSSResultGroup { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts index bd9d3cee82..1cfab1d687 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts @@ -100,11 +100,7 @@ export class ZHANetworkVisualizationPage extends LitElement { if (ieee) { const device = this._devices.get(ieee); if (device) { - navigate( - this, - `/config/devices/device/${device.device_reg_id}`, - false - ); + navigate(`/config/devices/device/${device.device_reg_id}`); } } }); diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-config-router.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-config-router.ts index e5c53c9b53..4ebb4b9970 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-config-router.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-config-router.ts @@ -46,11 +46,10 @@ class ZWaveConfigRouter extends HassRouterPage { if (this._configEntry && !searchParams.has("config_entry")) { searchParams.append("config_entry", this._configEntry); navigate( - this, `${this.routeTail.prefix}${ this.routeTail.path }?${searchParams.toString()}`, - true + { replace: true } ); } } diff --git a/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts b/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts index fa05774fc2..318744d30b 100644 --- a/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts +++ b/src/panels/config/integrations/integration-panels/zwave/zwave-migration.ts @@ -439,7 +439,7 @@ export class ZwaveMigration extends LitElement { } private _navigateOzw() { - navigate(this, "/config/ozw"); + navigate("/config/ozw"); } private _networkStopped(): void { diff --git a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-router.ts b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-router.ts index b20a1b0661..c81eacadea 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-router.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-router.ts @@ -64,11 +64,10 @@ class ZWaveJSConfigRouter extends HassRouterPage { if (this._configEntry && !searchParams.has("config_entry")) { searchParams.append("config_entry", this._configEntry); navigate( - this, `${this.routeTail.prefix}${ this.routeTail.path }?${searchParams.toString()}`, - true + { replace: true } ); } } diff --git a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts index ebe0b30dec..21d3b7f595 100644 --- a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts +++ b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts @@ -239,8 +239,7 @@ export class HaConfigLovelaceDashboards extends LitElement { private _navigate(ev: Event) { ev.stopPropagation(); - const url = `/${(ev.target as any).urlPath}`; - navigate(this, url); + navigate(`/${(ev.target as any).urlPath}`); } private _editDashboard(ev: CustomEvent) { diff --git a/src/panels/config/scene/ha-scene-editor.ts b/src/panels/config/scene/ha-scene-editor.ts index 9fcfffd70e..bf4b44e295 100644 --- a/src/panels/config/scene/ha-scene-editor.ts +++ b/src/panels/config/scene/ha-scene-editor.ts @@ -749,7 +749,7 @@ export class HaSceneEditor extends SubscribeMixin( // Wait for dialog to complete closing await new Promise((resolve) => setTimeout(resolve, 0)); } - showSceneEditor(this, { + showSceneEditor({ ...this._config, id: undefined, name: `${this._config?.name} (${this.hass.localize( @@ -796,7 +796,7 @@ export class HaSceneEditor extends SubscribeMixin( this._dirty = false; if (!this.sceneId) { - navigate(this, `/config/scene/edit/${id}`, true); + navigate(`/config/scene/edit/${id}`, { replace: true }); } } catch (err) { this._errors = err.body.message || err.message; diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index 4d0cec0df5..dc7abce376 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -600,7 +600,7 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { // Wait for dialog to complate closing await new Promise((resolve) => setTimeout(resolve, 0)); } - showScriptEditor(this, { + showScriptEditor({ ...this._config, alias: `${this._config?.alias} (${this.hass.localize( "ui.panel.config.script.picker.duplicate" @@ -665,7 +665,7 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { this._dirty = false; if (!this.scriptEntityId) { - navigate(this, `/config/script/edit/${id}`, true); + navigate(`/config/script/edit/${id}`, { replace: true }); } }, (errors) => { diff --git a/src/panels/config/tags/ha-config-tags.ts b/src/panels/config/tags/ha-config-tags.ts index b8745a6117..030bb53213 100644 --- a/src/panels/config/tags/ha-config-tags.ts +++ b/src/panels/config/tags/ha-config-tags.ts @@ -260,7 +260,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) { ), trigger: [{ platform: "tag", tag_id: tag.id } as TagTrigger], }; - showAutomationEditor(this, data); + showAutomationEditor(data); } private _addTag() { diff --git a/src/panels/config/zone/ha-config-zone.ts b/src/panels/config/zone/ha-config-zone.ts index 3d4082b580..e5f6883d20 100644 --- a/src/panels/config/zone/ha-config-zone.ts +++ b/src/panels/config/zone/ha-config-zone.ts @@ -269,7 +269,7 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { ["storage", "default"].includes(this.hass.config.config_source); this._fetchData(); if (this.route.path === "/new") { - navigate(this, "/config/zone", true); + navigate("/config/zone", { replace: true }); this._createZone(); } } @@ -399,7 +399,7 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { ) { return; } - navigate(this, "/config/core"); + navigate("/config/core"); } private async _createEntry(values: ZoneMutableParams) { diff --git a/src/panels/custom/ha-panel-custom.ts b/src/panels/custom/ha-panel-custom.ts index 02eb6f7f5c..907bc9c655 100644 --- a/src/panels/custom/ha-panel-custom.ts +++ b/src/panels/custom/ha-panel-custom.ts @@ -1,6 +1,6 @@ import { PropertyValues, ReactiveElement } from "lit"; import { property } from "lit/decorators"; -import { navigate } from "../../common/navigate"; +import { navigate, NavigateOptions } from "../../common/navigate"; import { CustomPanelInfo } from "../../data/panel_custom"; import { HomeAssistant, Route } from "../../types"; import { createCustomPanelElement } from "../../util/custom-panel/create-custom-panel-element"; @@ -34,8 +34,8 @@ export class HaPanelCustom extends ReactiveElement { // Since navigate fires events on `window`, we need to expose this as a function // to allow custom panels to forward their location changes to the main window // instead of their iframe window. - public navigate = (path: string, replace?: boolean) => - navigate(this, path, replace); + public navigate = (path: string, options?: NavigateOptions) => + navigate(path, options); public registerIframe(initialize, setProperties) { initialize(this.panel, { diff --git a/src/panels/developer-tools/ha-panel-developer-tools.ts b/src/panels/developer-tools/ha-panel-developer-tools.ts index f8504f64c3..3d05125563 100644 --- a/src/panels/developer-tools/ha-panel-developer-tools.ts +++ b/src/panels/developer-tools/ha-panel-developer-tools.ts @@ -77,7 +77,7 @@ class PanelDeveloperTools extends LitElement { private handlePageSelected(ev) { const newPage = ev.detail.item.getAttribute("page-name"); if (newPage !== this._page) { - navigate(this, `/developer-tools/${newPage}`); + navigate(`/developer-tools/${newPage}`); } else { scrollTo(0, 0); } diff --git a/src/panels/lovelace/common/handle-action.ts b/src/panels/lovelace/common/handle-action.ts index 3be3790397..7bdbea4f49 100644 --- a/src/panels/lovelace/common/handle-action.ts +++ b/src/panels/lovelace/common/handle-action.ts @@ -101,7 +101,7 @@ export const handleAction = async ( } case "navigate": if (actionConfig.navigation_path) { - navigate(node, actionConfig.navigation_path); + navigate(actionConfig.navigation_path); } else { showToast(node, { message: hass.localize( diff --git a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts index 80ce3794b2..0faeff3dfc 100644 --- a/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts +++ b/src/panels/lovelace/editor/view-editor/hui-dialog-edit-view.ts @@ -228,7 +228,7 @@ export class HuiDialogEditView extends LitElement { deleteView(this._params.lovelace!.config, this._params.viewIndex!) ); this.closeDialog(); - navigate(this, `/${window.location.pathname.split("/")[1]}`); + navigate(`/${window.location.pathname.split("/")[1]}`); } catch (err) { showAlertDialog(this, { text: `Deleting failed: ${err.message}`, diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 915c344322..f8f98751fd 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -680,21 +680,21 @@ class HUIRoot extends LitElement { if (!shouldHandleRequestSelectedEvent(ev)) { return; } - navigate(this, "/config/lovelace/dashboards"); + navigate("/config/lovelace/dashboards"); } private _handleManageResources(ev: CustomEvent): void { if (!shouldHandleRequestSelectedEvent(ev)) { return; } - navigate(this, "/config/lovelace/resources"); + navigate("/config/lovelace/resources"); } private _handleUnusedEntities(ev: CustomEvent): void { if (!shouldHandleRequestSelectedEvent(ev)) { return; } - navigate(this, `${this.route?.prefix}/hass-unused-entities`); + navigate(`${this.route?.prefix}/hass-unused-entities`); } private _showVoiceCommandDialog(): void { @@ -724,14 +724,12 @@ class HUIRoot extends LitElement { private _navigateToView(path: string | number, replace?: boolean) { if (!this.lovelace!.editMode) { - navigate(this, `${this.route!.prefix}/${path}`, replace); + navigate(`${this.route!.prefix}/${path}`, { replace }); return; } - navigate( - this, - `${this.route!.prefix}/${path}?${addSearchParam({ edit: "1" })}`, - replace - ); + navigate(`${this.route!.prefix}/${path}?${addSearchParam({ edit: "1" })}`, { + replace, + }); } private _editView() { diff --git a/src/panels/map/ha-panel-map.js b/src/panels/map/ha-panel-map.js index e42a8c233b..108c984765 100644 --- a/src/panels/map/ha-panel-map.js +++ b/src/panels/map/ha-panel-map.js @@ -94,7 +94,7 @@ class HaPanelMap extends LocalizeMixin(PolymerElement) { } openZonesEditor() { - navigate(this, "/config/zone"); + navigate("/config/zone"); } fitMap() { diff --git a/src/panels/my/ha-panel-my.ts b/src/panels/my/ha-panel-my.ts index f052a10d42..73effdcc7a 100644 --- a/src/panels/my/ha-panel-my.ts +++ b/src/panels/my/ha-panel-my.ts @@ -173,11 +173,9 @@ class HaPanelMy extends LitElement { this._error = "no_supervisor"; return; } - navigate( - this, - `/hassio/_my_redirect/${path}${window.location.search}`, - true - ); + navigate(`/hassio/_my_redirect/${path}${window.location.search}`, { + replace: true, + }); return; } @@ -204,7 +202,7 @@ class HaPanelMy extends LitElement { return; } - navigate(this, url, true); + navigate(url, { replace: true }); } protected render() { From 2b8033a97f4f39237717249e9b410a6cccbca62d Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Tue, 25 May 2021 17:58:20 +0200 Subject: [PATCH 090/117] Prevent cutting off of attributes in more-info light (#9219) * Prevent cutting off of attributes in more-info light * Update src/dialogs/more-info/controls/more-info-light.ts Co-authored-by: Bram Kragten --- src/dialogs/more-info/controls/more-info-light.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/dialogs/more-info/controls/more-info-light.ts b/src/dialogs/more-info/controls/more-info-light.ts index ed0c1a096d..3ac4d2e143 100644 --- a/src/dialogs/more-info/controls/more-info-light.ts +++ b/src/dialogs/more-info/controls/more-info-light.ts @@ -553,8 +553,6 @@ class MoreInfoLight extends LitElement { .content > * { width: 100%; - max-height: 84px; - overflow: hidden; } .color_temp { From 1bb025ccd04ef9200dc38c3dd9e645263d066a9c Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Tue, 25 May 2021 11:59:00 -0400 Subject: [PATCH 091/117] Add log level changed message when user changes Z-Wave JS log level (#9238) Co-authored-by: Bram Kragten --- .../integration-panels/zwave_js/zwave_js-logs.ts | 10 ++++++++-- src/translations/en.json | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts index 90e0d44edd..37a984666e 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-logs.ts @@ -118,10 +118,16 @@ class ZWaveJSLogs extends SubscribeMixin(LitElement) { if (ev.target === undefined || this._logConfig === undefined) { return; } - if (this._logConfig.level === ev.target.selected) { + const selected = ev.target.selected; + if (this._logConfig.level === selected) { return; } - setZWaveJSLogLevel(this.hass!, this.configEntryId, ev.target.selected); + setZWaveJSLogLevel(this.hass!, this.configEntryId, selected); + this._logConfig.level = selected; + this._textarea!.value += `${this.hass.localize( + "ui.panel.config.zwave_js.logs.log_level_changed", + { level: selected.charAt(0).toUpperCase() + selected.slice(1) } + )}\n`; } static get styles(): CSSResultArray { diff --git a/src/translations/en.json b/src/translations/en.json index cfa351e689..255c6ed7a4 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2664,7 +2664,8 @@ "logs": { "title": "Z-Wave JS Logs", "log_level": "Log Level", - "subscribed_to_logs": "Subscribed to Z-Wave JS Log Messages..." + "subscribed_to_logs": "Subscribed to Z-Wave JS Log Messages...", + "log_level_changed": "Log Level changed to: {level}" } } }, From c32a4546f30362a71292c50d7d95a58a4e3554ba Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Tue, 25 May 2021 18:12:56 +0200 Subject: [PATCH 092/117] Translate NC account connection state (#9167) --- src/panels/config/cloud/account/cloud-account.js | 12 ++++++++---- src/translations/en.json | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/panels/config/cloud/account/cloud-account.js b/src/panels/config/cloud/account/cloud-account.js index ae3d8823ca..9670794dfc 100644 --- a/src/panels/config/cloud/account/cloud-account.js +++ b/src/panels/config/cloud/account/cloud-account.js @@ -92,7 +92,9 @@ class CloudAccount extends EventsMixin(LocalizeMixin(PolymerElement)) { [[localize('ui.panel.config.cloud.account.connection_status')]] -
[[cloudStatus.cloud]]
+
+ [[_computeConnectionStatus(cloudStatus.cloud)]] +
@@ -189,10 +191,12 @@ class CloudAccount extends EventsMixin(LocalizeMixin(PolymerElement)) { this._fetchSubscriptionInfo(); } - _computeRemoteConnected(connected) { - return connected + _computeConnectionStatus(status) { + return status === "connected" ? this.hass.localize("ui.panel.config.cloud.account.connected") - : this.hass.localize("ui.panel.config.cloud.account.not_connected"); + : status === "disconnected" + ? this.hass.localize("ui.panel.config.cloud.account.not_connected") + : this.hass.localize("ui.panel.config.cloud.account.connecting"); } async _fetchSubscriptionInfo() { diff --git a/src/translations/en.json b/src/translations/en.json index 255c6ed7a4..f25ae07695 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1780,6 +1780,7 @@ "integrations_introduction2": "Check the website for ", "integrations_link_all_features": " all available features", "connected": "Connected", + "connecting": "Connecting...", "not_connected": "Not Connected", "fetching_subscription": "Fetching subscription...", "tts": { From 0dd3757df23a9f60b8d3e2c4d2327ef562f4cbaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Tue, 25 May 2021 21:29:32 +0200 Subject: [PATCH 093/117] Refresh snapshot create/restore dialogs (#9223) Co-authored-by: Bram Kragten --- .../components/supervisor-formfield-label.ts | 55 +++ .../components/supervisor-snapshot-content.ts | 418 ++++++++++++++++++ .../snapshot/dialog-hassio-create-snapshot.ts | 293 ++---------- .../snapshot/dialog-hassio-snapshot.ts | 388 ++++------------ src/components/ha-button-menu.ts | 3 + src/data/hassio/snapshot.ts | 5 +- src/translations/en.json | 7 +- 7 files changed, 609 insertions(+), 560 deletions(-) create mode 100644 hassio/src/components/supervisor-formfield-label.ts create mode 100644 hassio/src/components/supervisor-snapshot-content.ts diff --git a/hassio/src/components/supervisor-formfield-label.ts b/hassio/src/components/supervisor-formfield-label.ts new file mode 100644 index 0000000000..e173c0c44c --- /dev/null +++ b/hassio/src/components/supervisor-formfield-label.ts @@ -0,0 +1,55 @@ +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import "../../../src/components/ha-svg-icon"; + +@customElement("supervisor-formfield-label") +class SupervisorFormfieldLabel extends LitElement { + @property({ type: String }) public label!: string; + + @property({ type: String }) public imageUrl?: string; + + @property({ type: String }) public iconPath?: string; + + @property({ type: String }) public version?: string; + + protected render(): TemplateResult { + return html` + ${this.imageUrl + ? html`` + : this.iconPath + ? html`` + : ""} + ${this.label} + ${this.version + ? html`(${this.version})` + : ""} + `; + } + + static get styles(): CSSResultGroup { + return css` + :host { + cursor: pointer; + display: flex; + align-items: center; + } + .label { + margin-right: 4px; + } + .version { + color: var(--secondary-text-color); + } + .icon { + max-height: 22px; + max-width: 22px; + margin-right: 8px; + } + `; + } +} + +declare global { + interface HTMLElementTagNameMap { + "supervisor-formfield-label": SupervisorFormfieldLabel; + } +} diff --git a/hassio/src/components/supervisor-snapshot-content.ts b/hassio/src/components/supervisor-snapshot-content.ts new file mode 100644 index 0000000000..8c87976329 --- /dev/null +++ b/hassio/src/components/supervisor-snapshot-content.ts @@ -0,0 +1,418 @@ +import { mdiFolder, mdiHomeAssistant, mdiPuzzle } from "@mdi/js"; +import { PaperInputElement } from "@polymer/paper-input/paper-input"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; +import { customElement, property } from "lit/decorators"; +import { atLeastVersion } from "../../../src/common/config/version"; +import { formatDate } from "../../../src/common/datetime/format_date"; +import { formatDateTime } from "../../../src/common/datetime/format_date_time"; +import "../../../src/components/ha-checkbox"; +import "../../../src/components/ha-formfield"; +import "../../../src/components/ha-radio"; +import type { HaRadio } from "../../../src/components/ha-radio"; +import { + HassioFullSnapshotCreateParams, + HassioPartialSnapshotCreateParams, + HassioSnapshotDetail, +} from "../../../src/data/hassio/snapshot"; +import { Supervisor } from "../../../src/data/supervisor/supervisor"; +import { PolymerChangedEvent } from "../../../src/polymer-types"; +import { HomeAssistant } from "../../../src/types"; +import "./supervisor-formfield-label"; + +interface CheckboxItem { + slug: string; + checked: boolean; + name: string; +} + +interface AddonCheckboxItem extends CheckboxItem { + version: string; +} + +const _computeFolders = (folders): CheckboxItem[] => { + const list: CheckboxItem[] = []; + if (folders.includes("homeassistant")) { + list.push({ + slug: "homeassistant", + name: "Home Assistant configuration", + checked: false, + }); + } + if (folders.includes("ssl")) { + list.push({ slug: "ssl", name: "SSL", checked: false }); + } + if (folders.includes("share")) { + list.push({ slug: "share", name: "Share", checked: false }); + } + if (folders.includes("addons/local")) { + list.push({ slug: "addons/local", name: "Local add-ons", checked: false }); + } + return list.sort((a, b) => (a.name > b.name ? 1 : -1)); +}; + +const _computeAddons = (addons): AddonCheckboxItem[] => + addons + .map((addon) => ({ + slug: addon.slug, + name: addon.name, + version: addon.version, + checked: false, + })) + .sort((a, b) => (a.name > b.name ? 1 : -1)); + +@customElement("supervisor-snapshot-content") +export class SupervisorSnapshotContent extends LitElement { + @property({ attribute: false }) public hass!: HomeAssistant; + + @property({ attribute: false }) public supervisor?: Supervisor; + + @property({ attribute: false }) public snapshot?: HassioSnapshotDetail; + + @property() public snapshotType: HassioSnapshotDetail["type"] = "full"; + + @property({ attribute: false }) public folders?: CheckboxItem[]; + + @property({ attribute: false }) public addons?: AddonCheckboxItem[]; + + @property({ type: Boolean }) public homeAssistant = false; + + @property({ type: Boolean }) public snapshotHasPassword = false; + + @property() public snapshotName = ""; + + @property() public snapshotPassword = ""; + + public willUpdate(changedProps) { + super.willUpdate(changedProps); + if (!this.hasUpdated) { + this.folders = _computeFolders( + this.snapshot + ? this.snapshot.folders + : ["homeassistant", "ssl", "share", "media", "addons/local"] + ); + this.addons = _computeAddons( + this.snapshot + ? this.snapshot.addons + : this.supervisor?.supervisor.addons + ); + this.snapshotType = this.snapshot?.type || "full"; + this.snapshotName = this.snapshot?.name || ""; + this.snapshotHasPassword = this.snapshot?.protected || false; + } + } + + protected render(): TemplateResult { + if (!this.supervisor) { + return html``; + } + const foldersSection = + this.snapshotType === "partial" ? this._getSection("folders") : undefined; + const addonsSection = + this.snapshotType === "partial" ? this._getSection("addons") : undefined; + + return html` + ${this.snapshot + ? html`
+ ${this.snapshot.type === "full" + ? this.supervisor.localize("snapshot.full_snapshot") + : this.supervisor.localize("snapshot.partial_snapshot")} + (${Math.ceil(this.snapshot.size * 10) / 10 + " MB"})
+ ${formatDateTime(new Date(this.snapshot.date), this.hass.locale)} +
` + : html` + `} + ${!this.snapshot || this.snapshot.type === "full" + ? html`
+ ${!this.snapshot + ? this.supervisor.localize("snapshot.type") + : this.supervisor.localize("snapshot.select_type")} +
+
+ + + + + + + + +
` + : ""} + ${this.snapshot && this.snapshotType === "partial" + ? html` + ${this.snapshot.homeassistant + ? html` + + `} + > + { + this.homeAssistant = !this.homeAssistant; + }} + > + + + ` + : ""} + ` + : ""} + ${this.snapshotType === "partial" + ? html` + ${foldersSection?.templates.length + ? html` + + `} + > + + + +
${foldersSection.templates}
+ ` + : ""} + ${addonsSection?.templates.length + ? html` + + `} + > + + + +
${addonsSection.templates}
+ ` + : ""} + ` + : ""} + ${!this.snapshot + ? html` + + ` + : ""} + ${this.snapshotHasPassword + ? html` + + + ` + : ""} + `; + } + + static get styles(): CSSResultGroup { + return css` + ha-checkbox { + --mdc-checkbox-touch-target-size: 16px; + display: block; + margin: 4px 12px 8px 0; + } + ha-formfield { + display: contents; + } + supervisor-formfield-label { + display: inline-flex; + align-items: center; + } + paper-input[type="password"] { + display: block; + margin: 4px 0 4px 16px; + } + .details { + color: var(--secondary-text-color); + } + .section-content { + display: flex; + flex-direction: column; + margin-left: 16px; + } + .security { + margin-top: 16px; + } + .snapshot-types { + display: flex; + } + .sub-header { + margin-top: 8px; + } + `; + } + + public snapshotDetails(): + | HassioPartialSnapshotCreateParams + | HassioFullSnapshotCreateParams { + const data: any = {}; + + if (!this.snapshot) { + data.name = this.snapshotName || formatDate(new Date(), this.hass.locale); + } + + if (this.snapshotHasPassword) { + data.password = this.snapshotPassword; + } + + if (this.snapshotType === "full") { + return data; + } + + const addons = this.addons + ?.filter((addon) => addon.checked) + .map((addon) => addon.slug); + const folders = this.folders + ?.filter((folder) => folder.checked) + .map((folder) => folder.slug); + + if (addons?.length) { + data.addons = addons; + } + if (folders?.length) { + data.folders = folders; + } + if (this.homeAssistant) { + data.homeassistant = this.homeAssistant; + } + + return data; + } + + private _getSection(section: string) { + const templates: TemplateResult[] = []; + const addons = + section === "addons" + ? new Map( + this.supervisor!.addon.addons.map((item) => [item.slug, item]) + ) + : undefined; + let checkedItems = 0; + this[section].forEach((item) => { + templates.push(html` + `} + > + + + `); + + if (item.checked) { + checkedItems++; + } + }); + + const checked = checkedItems === this[section].length; + + return { + templates, + checked, + indeterminate: !checked && checkedItems !== 0, + }; + } + + private _handleRadioValueChanged(ev: CustomEvent) { + const input = ev.currentTarget as HaRadio; + this[input.name] = input.value; + } + + private _handleTextValueChanged(ev: PolymerChangedEvent) { + const input = ev.currentTarget as PaperInputElement; + this[input.name!] = ev.detail.value; + } + + private _toggleHasPassword(): void { + this.snapshotHasPassword = !this.snapshotHasPassword; + } + + private _toggleSection(ev): void { + const section = ev.currentTarget.section; + + this[section] = (section === "addons" ? this.addons : this.folders)!.map( + (item) => ({ + ...item, + checked: ev.currentTarget.checked, + }) + ); + } + + private _updateSectionEntry(ev): void { + const item = ev.currentTarget.item; + const section = ev.currentTarget.section; + this[section] = this[section].map((entry) => + entry.slug === item.slug + ? { + ...entry, + checked: ev.currentTarget.checked, + } + : entry + ); + } +} + +declare global { + interface HTMLElementTagNameMap { + "supervisor-snapshot-content": SupervisorSnapshotContent; + } +} diff --git a/hassio/src/dialogs/snapshot/dialog-hassio-create-snapshot.ts b/hassio/src/dialogs/snapshot/dialog-hassio-create-snapshot.ts index 4afbf0acae..2bc817fe2b 100755 --- a/hassio/src/dialogs/snapshot/dialog-hassio-create-snapshot.ts +++ b/hassio/src/dialogs/snapshot/dialog-hassio-create-snapshot.ts @@ -1,91 +1,43 @@ import "@material/mwc-button"; -import "@polymer/paper-input/paper-input"; -import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; -import { customElement, property, state } from "lit/decorators"; -import { formatDate } from "../../../../src/common/datetime/format_date"; +import { customElement, property, query, state } from "lit/decorators"; import { fireEvent } from "../../../../src/common/dom/fire_event"; -import { compare } from "../../../../src/common/string/compare"; import "../../../../src/components/buttons/ha-progress-button"; -import "../../../../src/components/ha-checkbox"; -import type { HaCheckbox } from "../../../../src/components/ha-checkbox"; import { createCloseHeading } from "../../../../src/components/ha-dialog"; -import "../../../../src/components/ha-formfield"; -import "../../../../src/components/ha-radio"; -import type { HaRadio } from "../../../../src/components/ha-radio"; -import "../../../../src/components/ha-settings-row"; import { extractApiErrorMessage } from "../../../../src/data/hassio/common"; import { createHassioFullSnapshot, createHassioPartialSnapshot, - HassioFullSnapshotCreateParams, - HassioPartialSnapshotCreateParams, - HassioSnapshot, } from "../../../../src/data/hassio/snapshot"; import { showAlertDialog } from "../../../../src/dialogs/generic/show-dialog-box"; -import { PolymerChangedEvent } from "../../../../src/polymer-types"; import { haStyle, haStyleDialog } from "../../../../src/resources/styles"; import { HomeAssistant } from "../../../../src/types"; +import "../../components/supervisor-snapshot-content"; +import type { SupervisorSnapshotContent } from "../../components/supervisor-snapshot-content"; import { HassioCreateSnapshotDialogParams } from "./show-dialog-hassio-create-snapshot"; -interface CheckboxItem { - slug: string; - checked: boolean; - name?: string; - version?: string; -} - -const folderList = () => [ - { - slug: "homeassistant", - checked: true, - }, - { slug: "ssl", checked: true }, - { slug: "share", checked: true }, - { slug: "media", checked: true }, - { slug: "addons/local", checked: true }, -]; - @customElement("dialog-hassio-create-snapshot") class HassioCreateSnapshotDialog extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @state() private _snapshotName = ""; - - @state() private _snapshotPassword = ""; - - @state() private _snapshotHasPassword = false; - - @state() private _snapshotType: HassioSnapshot["type"] = "full"; - @state() private _dialogParams?: HassioCreateSnapshotDialogParams; - @state() private _addonList: CheckboxItem[] = []; + @state() private _error?: string; - @state() private _folderList: CheckboxItem[] = folderList(); + @state() private _creatingSnapshot = false; - @state() private _error = ""; + @query("supervisor-snapshot-content") + private _snapshotContent!: SupervisorSnapshotContent; public showDialog(params: HassioCreateSnapshotDialogParams) { this._dialogParams = params; - this._addonList = this._dialogParams.supervisor.supervisor.addons - .map((addon) => ({ - slug: addon.slug, - name: addon.name, - version: addon.version, - checked: true, - })) - .sort((a, b) => compare(a.name, b.name)); - this._snapshotType = "full"; - this._error = ""; - this._folderList = folderList(); - this._snapshotHasPassword = false; - this._snapshotPassword = ""; - this._snapshotName = ""; + this._creatingSnapshot = false; } public closeDialog() { this._dialogParams = undefined; + this._creatingSnapshot = false; + this._error = undefined; fireEvent(this, "dialog-closed", { dialog: this.localName }); } @@ -102,173 +54,29 @@ class HassioCreateSnapshotDialog extends LitElement { this._dialogParams.supervisor.localize("snapshot.create_snapshot") )} > - - -
-
- ${this._dialogParams.supervisor.localize("snapshot.type")}: -
- ` + : html` - - - - - - - -
- - ${ - this._snapshotType === "full" - ? undefined - : html` - ${this._dialogParams.supervisor.localize("snapshot.folders")}: -
- ${this._folderList.map( - (folder, idx) => html` -
- - - - ${this._dialogParams!.supervisor.localize( - `snapshot.folder.${folder.slug}` - )} - -
- ` - )} -
- - ${this._dialogParams.supervisor.localize("snapshot.addons")}: -
- ${this._addonList.map( - (addon, idx) => html` -
- - - - ${addon.name} - (${addon.version}) - - -
- ` - )} -
- ` - } - ${this._dialogParams.supervisor.localize("snapshot.security")}: -
-
- - - - ${this._dialogParams.supervisor.localize( - "snapshot.password_protection" - )} - - -
-
- - ${ - this._snapshotHasPassword - ? html` - - - ` - : undefined - } - ${ - this._error !== "" - ? html`

${this._error}

` - : undefined - } + `} + ${this._error ? html`

Error: ${this._error}

` : ""} ${this._dialogParams.supervisor.localize("common.close")} - + ${this._dialogParams.supervisor.localize("snapshot.create")} - + `; } - private _handleTextValueChanged(ev: PolymerChangedEvent) { - const input = ev.currentTarget as PaperInputElement; - this[`_${input.name}`] = ev.detail.value; - } - - private _handleCheckboxValueChanged(ev: CustomEvent) { - const input = ev.currentTarget as HaCheckbox; - this._snapshotHasPassword = input.checked; - } - - private _handleRadioValueChanged(ev: CustomEvent) { - const input = ev.currentTarget as HaRadio; - this[`_${input.name}`] = input.value; - } - - private _folderChecked(ev) { - const { idx, checked } = ev.currentTarget!; - this._folderList = this._folderList.map((folder, curIdx) => - curIdx === idx ? { ...folder, checked } : folder - ); - } - - private _addonChecked(ev) { - const { idx, checked } = ev.currentTarget!; - this._addonList = this._addonList.map((addon, curIdx) => - curIdx === idx ? { ...addon, checked } : addon - ); - } - - private async _createSnapshot(ev: CustomEvent): Promise { + private async _createSnapshot(): Promise { if (this._dialogParams!.supervisor.info.state !== "running") { showAlertDialog(this, { title: this._dialogParams!.supervisor.localize( @@ -282,40 +90,26 @@ class HassioCreateSnapshotDialog extends LitElement { }); return; } - const button = ev.currentTarget as any; - button.progress = true; + const snapshotDetails = this._snapshotContent.snapshotDetails(); + this._creatingSnapshot = true; this._error = ""; - if (this._snapshotHasPassword && !this._snapshotPassword.length) { + if ( + this._snapshotContent.snapshotHasPassword && + !this._snapshotContent.snapshotPassword.length + ) { this._error = this._dialogParams!.supervisor.localize( "snapshot.enter_password" ); - button.progress = false; + this._creatingSnapshot = false; return; } - const name = this._snapshotName || formatDate(new Date(), this.hass.locale); try { - if (this._snapshotType === "full") { - const data: HassioFullSnapshotCreateParams = { name }; - if (this._snapshotHasPassword) { - data.password = this._snapshotPassword; - } - await createHassioFullSnapshot(this.hass, data); + if (this._snapshotContent.snapshotType === "full") { + await createHassioFullSnapshot(this.hass, snapshotDetails); } else { - const data: HassioPartialSnapshotCreateParams = { - name, - folders: this._folderList - .filter((folder) => folder.checked) - .map((folder) => folder.slug), - addons: this._addonList - .filter((addon) => addon.checked) - .map((addon) => addon.slug), - }; - if (this._snapshotHasPassword) { - data.password = this._snapshotPassword; - } - await createHassioPartialSnapshot(this.hass, data); + await createHassioPartialSnapshot(this.hass, snapshotDetails); } this._dialogParams!.onCreate(); @@ -323,7 +117,7 @@ class HassioCreateSnapshotDialog extends LitElement { } catch (err) { this._error = extractApiErrorMessage(err); } - button.progress = false; + this._creatingSnapshot = false; } static get styles(): CSSResultGroup { @@ -331,22 +125,9 @@ class HassioCreateSnapshotDialog extends LitElement { haStyle, haStyleDialog, css` - .error { - color: var(--error-color); - } - paper-input[type="password"] { + ha-circular-progress { display: block; - margin: 4px 0 4px 16px; - } - span.version { - color: var(--secondary-text-color); - } - .checkbox-section { - display: grid; - } - .checkbox-line { - display: inline-flex; - align-items: center; + text-align: center; } `, ]; diff --git a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts index 81f21bb908..3ffbfcd53d 100755 --- a/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts +++ b/hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts @@ -1,13 +1,12 @@ -import "@material/mwc-button"; -import { mdiClose, mdiDelete, mdiDownload, mdiHistory } from "@mdi/js"; -import "@polymer/paper-checkbox/paper-checkbox"; -import type { PaperCheckboxElement } from "@polymer/paper-checkbox/paper-checkbox"; -import "@polymer/paper-input/paper-input"; +import { ActionDetail } from "@material/mwc-list"; +import "@material/mwc-list/mwc-list-item"; +import { mdiDotsVertical } from "@mdi/js"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; -import { customElement, property, state } from "lit/decorators"; -import { formatDateTime } from "../../../../src/common/datetime/format_date_time"; +import { customElement, property, query, state } from "lit/decorators"; import { fireEvent } from "../../../../src/common/dom/fire_event"; -import "../../../../src/components/ha-header-bar"; +import "../../../../src/components/buttons/ha-progress-button"; +import "../../../../src/components/ha-button-menu"; +import { createCloseHeading } from "../../../../src/components/ha-dialog"; import "../../../../src/components/ha-svg-icon"; import { getSignedPath } from "../../../../src/data/auth"; import { extractApiErrorMessage } from "../../../../src/data/hassio/common"; @@ -15,106 +14,45 @@ import { fetchHassioSnapshotInfo, HassioSnapshotDetail, } from "../../../../src/data/hassio/snapshot"; -import { Supervisor } from "../../../../src/data/supervisor/supervisor"; import { showAlertDialog, showConfirmationDialog, } from "../../../../src/dialogs/generic/show-dialog-box"; import { HassDialog } from "../../../../src/dialogs/make-dialog-manager"; -import { PolymerChangedEvent } from "../../../../src/polymer-types"; import { haStyle, haStyleDialog } from "../../../../src/resources/styles"; import { HomeAssistant } from "../../../../src/types"; +import "../../components/supervisor-snapshot-content"; +import type { SupervisorSnapshotContent } from "../../components/supervisor-snapshot-content"; import { HassioSnapshotDialogParams } from "./show-dialog-hassio-snapshot"; -const _computeFolders = (folders) => { - const list: Array<{ slug: string; name: string; checked: boolean }> = []; - if (folders.includes("homeassistant")) { - list.push({ - slug: "homeassistant", - name: "Home Assistant configuration", - checked: true, - }); - } - if (folders.includes("ssl")) { - list.push({ slug: "ssl", name: "SSL", checked: true }); - } - if (folders.includes("share")) { - list.push({ slug: "share", name: "Share", checked: true }); - } - if (folders.includes("addons/local")) { - list.push({ slug: "addons/local", name: "Local add-ons", checked: true }); - } - return list; -}; - -const _computeAddons = (addons) => - addons.map((addon) => ({ - slug: addon.slug, - name: addon.name, - version: addon.version, - checked: true, - })); - -interface AddonItem { - slug: string; - name: string; - version: string; - checked: boolean | null | undefined; -} - -interface FolderItem { - slug: string; - name: string; - checked: boolean | null | undefined; -} - @customElement("dialog-hassio-snapshot") class HassioSnapshotDialog extends LitElement implements HassDialog { @property({ attribute: false }) public hass!: HomeAssistant; - @property({ attribute: false }) public supervisor?: Supervisor; - @state() private _error?: string; - @state() private _onboarding = false; - @state() private _snapshot?: HassioSnapshotDetail; - @state() private _folders!: FolderItem[]; - - @state() private _addons!: AddonItem[]; - @state() private _dialogParams?: HassioSnapshotDialogParams; - @state() private _snapshotPassword!: string; + @state() private _restoringSnapshot = false; - @state() private _restoreHass = true; + @query("supervisor-snapshot-content") + private _snapshotContent!: SupervisorSnapshotContent; public async showDialog(params: HassioSnapshotDialogParams) { this._snapshot = await fetchHassioSnapshotInfo(this.hass, params.slug); - this._folders = _computeFolders( - this._snapshot?.folders - ).sort((a: FolderItem, b: FolderItem) => (a.name > b.name ? 1 : -1)); - this._addons = _computeAddons( - this._snapshot?.addons - ).sort((a: AddonItem, b: AddonItem) => (a.name > b.name ? 1 : -1)); - this._dialogParams = params; - this._onboarding = params.onboarding ?? false; - this.supervisor = params.supervisor; - if (!this._snapshot.homeassistant) { - this._restoreHass = false; - } + this._restoringSnapshot = false; } public closeDialog() { - this._dialogParams = undefined; this._snapshot = undefined; - this._snapshotPassword = ""; - this._folders = []; - this._addons = []; + this._dialogParams = undefined; + this._restoringSnapshot = false; + this._error = undefined; fireEvent(this, "dialog-closed", { dialog: this.localName }); } @@ -123,121 +61,41 @@ class HassioSnapshotDialog return html``; } return html` - -
- - ${this._computeName} - - - - -
-
- ${this._snapshot.type === "full" - ? "Full snapshot" - : "Partial snapshot"} - (${this._computeSize})
- ${formatDateTime(new Date(this._snapshot.date), this.hass.locale)} -
- ${this._snapshot.homeassistant - ? html`
Home Assistant:
- - Home Assistant - (${this._snapshot.homeassistant}) - ` - : ""} - ${this._folders.length - ? html` -
Folders:
- - ${this._folders.map( - (item) => html` - - ${item.name} - - ` - )} - - ` - : ""} - ${this._addons.length - ? html` -
Add-on:
- - ${this._addons.map( - (item) => html` - - ${item.name} - (${item.version}) - - ` - )} - - ` - : ""} - ${this._snapshot.protected - ? html` - - ` - : ""} - ${this._error ? html`

Error: ${this._error}

` : ""} + + ${this._restoringSnapshot + ? html` ` + : html` + `} + ${this._error ? html`

Error: ${this._error}

` : ""} -
- - - Restore Selected - - ${!this._onboarding - ? html` - - - - Delete Snapshot - - ` - : ""} -
-
- ${this._snapshot.type === "full" - ? html` - - - Restore Everything - - ` - : ""} - ${!this._onboarding - ? html` - - Download Snapshot - ` - : ""} -
+ + Restore + + + ev.stopPropagation()} + > + + + + Download Snapshot + Delete Snapshot +
`; } @@ -247,83 +105,47 @@ class HassioSnapshotDialog haStyle, haStyleDialog, css` - paper-checkbox { + ha-svg-icon { + color: var(--primary-text-color); + } + ha-circular-progress { display: block; - margin: 4px; - } - mwc-button ha-svg-icon { - margin-right: 4px; - } - .button-row { - display: grid; - gap: 8px; - margin-right: 8px; - } - .details { - color: var(--secondary-text-color); - } - .warning, - .error { - color: var(--error-color); - } - .buttons li { - list-style-type: none; - } - .buttons .icon { - margin-right: 16px; - } - .no-margin-top { - margin-top: 0; - } - span.version { - color: var(--secondary-text-color); - } - ha-header-bar { - --mdc-theme-on-primary: var(--primary-text-color); - --mdc-theme-primary: var(--mdc-theme-surface); - flex-shrink: 0; - } - /* overrule the ha-style-dialog max-height on small screens */ - @media all and (max-width: 450px), all and (max-height: 500px) { - ha-header-bar { - --mdc-theme-primary: var(--app-header-background-color); - --mdc-theme-on-primary: var(--app-header-text-color, white); - } + text-align: center; } `, ]; } - private _updateFolders(item: FolderItem, value: boolean | null | undefined) { - this._folders = this._folders.map((folder) => { - if (folder.slug === item.slug) { - folder.checked = value; - } - return folder; - }); + private _handleMenuAction(ev: CustomEvent) { + switch (ev.detail.index) { + case 0: + this._downloadClicked(); + break; + case 1: + this._deleteClicked(); + break; + } } - private _updateAddons(item: AddonItem, value: boolean | null | undefined) { - this._addons = this._addons.map((addon) => { - if (addon.slug === item.slug) { - addon.checked = value; - } - return addon; - }); + private async _restoreClicked() { + const snapshotDetails = this._snapshotContent.snapshotDetails(); + this._restoringSnapshot = true; + if (this._snapshotContent.snapshotType === "full") { + await this._fullRestoreClicked(snapshotDetails); + } else { + await this._partialRestoreClicked(snapshotDetails); + } + this._restoringSnapshot = false; } - private _passwordInput(ev: PolymerChangedEvent) { - this._snapshotPassword = ev.detail.value; - } - - private async _partialRestoreClicked() { + private async _partialRestoreClicked(snapshotDetails) { if ( - this.supervisor !== undefined && - this.supervisor.info.state !== "running" + this._dialogParams?.supervisor !== undefined && + this._dialogParams?.supervisor.info.state !== "running" ) { await showAlertDialog(this, { title: "Could not restore snapshot", - text: `Restoring a snapshot is not possible right now because the system is in ${this.supervisor.info.state} state.`, + text: `Restoring a snapshot is not possible right now because the system is in ${this._dialogParams?.supervisor.info.state} state.`, }); return; } @@ -337,40 +159,16 @@ class HassioSnapshotDialog return; } - const addons = this._addons - .filter((addon) => addon.checked) - .map((addon) => addon.slug); - - const folders = this._folders - .filter((folder) => folder.checked) - .map((folder) => folder.slug); - - const data: { - homeassistant: boolean; - addons: any; - folders: any; - password?: string; - } = { - homeassistant: this._restoreHass, - addons, - folders, - }; - - if (this._snapshot!.protected) { - data.password = this._snapshotPassword; - } - - if (!this._onboarding) { + if (!this._dialogParams?.onboarding) { this.hass .callApi( "POST", `hassio/snapshots/${this._snapshot!.slug}/restore/partial`, - data + snapshotDetails ) .then( () => { - alert("Snapshot restored!"); this.closeDialog(); }, (error) => { @@ -381,20 +179,20 @@ class HassioSnapshotDialog fireEvent(this, "restoring"); fetch(`/api/hassio/snapshots/${this._snapshot!.slug}/restore/partial`, { method: "POST", - body: JSON.stringify(data), + body: JSON.stringify(snapshotDetails), }); this.closeDialog(); } } - private async _fullRestoreClicked() { + private async _fullRestoreClicked(snapshotDetails) { if ( - this.supervisor !== undefined && - this.supervisor.info.state !== "running" + this._dialogParams?.supervisor !== undefined && + this._dialogParams?.supervisor.info.state !== "running" ) { await showAlertDialog(this, { title: "Could not restore snapshot", - text: `Restoring a snapshot is not possible right now because the system is in ${this.supervisor.info.state} state.`, + text: `Restoring a snapshot is not possible right now because the system is in ${this._dialogParams?.supervisor.info.state} state.`, }); return; } @@ -409,19 +207,15 @@ class HassioSnapshotDialog return; } - const data = this._snapshot!.protected - ? { password: this._snapshotPassword } - : undefined; - if (!this._onboarding) { + if (!this._dialogParams?.onboarding) { this.hass .callApi( "POST", `hassio/snapshots/${this._snapshot!.slug}/restore/full`, - data + snapshotDetails ) .then( () => { - alert("Snapshot restored!"); this.closeDialog(); }, (error) => { @@ -432,7 +226,7 @@ class HassioSnapshotDialog fireEvent(this, "restoring"); fetch(`/api/hassio/snapshots/${this._snapshot!.slug}/restore/full`, { method: "POST", - body: JSON.stringify(data), + body: JSON.stringify(snapshotDetails), }); this.closeDialog(); } @@ -473,7 +267,9 @@ class HassioSnapshotDialog `/api/hassio/snapshots/${this._snapshot!.slug}/download` ); } catch (err) { - alert(`Error: ${extractApiErrorMessage(err)}`); + await showAlertDialog(this, { + text: extractApiErrorMessage(err), + }); return; } @@ -504,10 +300,6 @@ class HassioSnapshotDialog ? this._snapshot.name || this._snapshot.slug : "Unnamed snapshot"; } - - private get _computeSize() { - return Math.ceil(this._snapshot!.size * 10) / 10 + " MB"; - } } declare global { diff --git a/src/components/ha-button-menu.ts b/src/components/ha-button-menu.ts index 52e27af49e..8223b68d1c 100644 --- a/src/components/ha-button-menu.ts +++ b/src/components/ha-button-menu.ts @@ -12,6 +12,8 @@ export class HaButtonMenu extends LitElement { @property({ type: Boolean }) public disabled = false; + @property({ type: Boolean }) public fixed = false; + @query("mwc-menu", true) private _menu?: Menu; public get items() { @@ -29,6 +31,7 @@ export class HaButtonMenu extends LitElement {
diff --git a/src/data/hassio/snapshot.ts b/src/data/hassio/snapshot.ts index 0281f0d9a4..ba34776228 100644 --- a/src/data/hassio/snapshot.ts +++ b/src/data/hassio/snapshot.ts @@ -42,11 +42,10 @@ export interface HassioFullSnapshotCreateParams { name: string; password?: string; } -export interface HassioPartialSnapshotCreateParams { - name: string; +export interface HassioPartialSnapshotCreateParams + extends HassioFullSnapshotCreateParams { folders?: string[]; addons?: string[]; - password?: string; homeassistant?: boolean; } diff --git a/src/translations/en.json b/src/translations/en.json index f25ae07695..79f039cfe5 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -3901,14 +3901,15 @@ "create_snapshot": "Create snapshot", "create": "Create", "created": "Created", - "name": "Name", - "type": "Type", + "name": "Snapshot name", + "type": "Snapshot type", + "select_type": "Select what to restore", "security": "Security", "full_snapshot": "Full snapshot", "partial_snapshot": "Partial snapshot", "addons": "Add-ons", "folders": "Folders", - "password": "Password", + "password": "Snapshot password", "password_protection": "Password protection", "password_protected": "password protected", "enter_password": "Please enter a password.", From d97fb19f0527146adc32bce0d2ea0e1a9484f088 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 25 May 2021 22:11:52 +0200 Subject: [PATCH 094/117] Ingress: Wait for dialog to close before navigating (#9250) --- hassio/src/ingress-view/hassio-ingress-view.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hassio/src/ingress-view/hassio-ingress-view.ts b/hassio/src/ingress-view/hassio-ingress-view.ts index 6329c3748d..710cf3b5e3 100644 --- a/hassio/src/ingress-view/hassio-ingress-view.ts +++ b/hassio/src/ingress-view/hassio-ingress-view.ts @@ -11,6 +11,7 @@ import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../src/common/dom/fire_event"; import { navigate } from "../../../src/common/navigate"; import { extractSearchParam } from "../../../src/common/url/search-params"; +import { nextRender } from "../../../src/common/util/render-status"; import { fetchHassioAddonInfo, HassioAddonDetails, @@ -95,6 +96,7 @@ class HassioIngressView extends LitElement { text: extractApiErrorMessage(err), title: requestedAddon, }); + await nextRender(); history.back(); return; } @@ -103,6 +105,7 @@ class HassioIngressView extends LitElement { text: this.supervisor.localize("my.error_addon_no_ingress"), title: addonInfo.name, }); + await nextRender(); history.back(); } else { navigate(`/hassio/ingress/${addonInfo.slug}`, { replace: true }); @@ -140,6 +143,7 @@ class HassioIngressView extends LitElement { text: "Unable to fetch add-on info to start Ingress", title: "Supervisor", }); + await nextRender(); history.back(); return; } @@ -149,6 +153,7 @@ class HassioIngressView extends LitElement { text: "Add-on does not support Ingress", title: addon.name, }); + await nextRender(); history.back(); return; } @@ -157,8 +162,9 @@ class HassioIngressView extends LitElement { await showAlertDialog(this, { text: "Add-on is not running. Please start it first", title: addon.name, - confirm: () => navigate(`/hassio/addon/${addon.slug}`), }); + await nextRender(); + navigate(`/hassio/addon/${addon.slug}/info`, { replace: true }); return; } @@ -171,6 +177,7 @@ class HassioIngressView extends LitElement { text: "Unable to create an Ingress session", title: addon.name, }); + await nextRender(); history.back(); return; } From 3d4d789f7fb541557b2b795c899c8d6df7cfb9a0 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Tue, 25 May 2021 22:39:21 +0200 Subject: [PATCH 095/117] Detect and format date & timestamp attributes (#9074) --- src/common/string/is_date.ts | 11 +++ src/common/string/is_timestamp.ts | 11 +++ src/components/ha-attributes.ts | 37 +--------- src/panels/lovelace/cards/hui-entity-card.ts | 8 ++- .../special-rows/hui-attribute-row.ts | 5 +- src/util/hass-attributes-util.ts | 67 +++++++++++++++++++ test-mocha/common/string/is_date.ts | 12 ++++ 7 files changed, 113 insertions(+), 38 deletions(-) create mode 100644 src/common/string/is_date.ts create mode 100644 src/common/string/is_timestamp.ts create mode 100644 test-mocha/common/string/is_date.ts diff --git a/src/common/string/is_date.ts b/src/common/string/is_date.ts new file mode 100644 index 0000000000..b075efc1e4 --- /dev/null +++ b/src/common/string/is_date.ts @@ -0,0 +1,11 @@ +// https://regex101.com/r/kc5C14/2 +const regExpString = "^\\d{4}-(0[1-9]|1[0-2])-([12]\\d|0[1-9]|3[01])"; + +const regExp = new RegExp(regExpString + "$"); +// 2nd expression without the "end of string" enforced, so it can be used +// to just verify the start of a string and then based on that result e.g. +// check for a full timestamp string efficiently. +const regExpNoStringEnd = new RegExp(regExpString); + +export const isDate = (input: string, allowCharsAfterDate = false): boolean => + allowCharsAfterDate ? regExpNoStringEnd.test(input) : regExp.test(input); diff --git a/src/common/string/is_timestamp.ts b/src/common/string/is_timestamp.ts new file mode 100644 index 0000000000..e4b7649529 --- /dev/null +++ b/src/common/string/is_timestamp.ts @@ -0,0 +1,11 @@ +// https://stackoverflow.com/a/14322189/1947205 +// Changes: +// 1. Do not allow a plus or minus at the start. +// 2. Enforce that we have a "T" or a blank after the date portion +// to ensure we have a timestamp and not only a date. +// 3. Disallow dates based on week number. +// 4. Disallow dates only consisting of a year. +// https://regex101.com/r/kc5C14/3 +const regexp = /^\d{4}-(0[1-9]|1[0-2])-([12]\d|0[1-9]|3[01])[T| ](((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)(\8[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)$/; + +export const isTimestamp = (input: string): boolean => regexp.test(input); diff --git a/src/components/ha-attributes.ts b/src/components/ha-attributes.ts index 68d3111caa..5c75269a0b 100644 --- a/src/components/ha-attributes.ts +++ b/src/components/ha-attributes.ts @@ -1,16 +1,14 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators"; -import { until } from "lit/directives/until"; import { haStyle } from "../resources/styles"; import { HomeAssistant } from "../types"; import hassAttributeUtil, { formatAttributeName, + formatAttributeValue, } from "../util/hass-attributes-util"; import "./ha-expansion-panel"; -let jsYamlPromise: Promise; - @customElement("ha-attributes") class HaAttributes extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @@ -124,38 +122,7 @@ class HaAttributes extends LitElement { return "-"; } const value = this.stateObj.attributes[attribute]; - return this.formatAttributeValue(value); - } - - private formatAttributeValue(value: any): string | TemplateResult { - if (value === null) { - return "-"; - } - // YAML handling - if ( - (Array.isArray(value) && value.some((val) => val instanceof Object)) || - (!Array.isArray(value) && value instanceof Object) - ) { - if (!jsYamlPromise) { - jsYamlPromise = import("js-yaml"); - } - const yaml = jsYamlPromise.then((jsYaml) => jsYaml.safeDump(value)); - return html`
${until(yaml, "")}
`; - } - // URL handling - if (typeof value === "string" && value.startsWith("http")) { - try { - // If invalid URL, exception will be raised - const url = new URL(value); - if (url.protocol === "http:" || url.protocol === "https:") - return html`${value}`; - } catch (_) { - // Nothing to do here - } - } - return Array.isArray(value) ? value.join(", ") : value; + return formatAttributeValue(this.hass, value); } private expandedChanged(ev) { diff --git a/src/panels/lovelace/cards/hui-entity-card.ts b/src/panels/lovelace/cards/hui-entity-card.ts index fa7d14d970..28c7709926 100644 --- a/src/panels/lovelace/cards/hui-entity-card.ts +++ b/src/panels/lovelace/cards/hui-entity-card.ts @@ -18,6 +18,7 @@ import "../../../components/ha-card"; import "../../../components/ha-icon"; import { UNAVAILABLE_STATES } from "../../../data/entity"; import { HomeAssistant } from "../../../types"; +import { formatAttributeValue } from "../../../util/hass-attributes-util"; import { computeCardSize } from "../common/compute-card-size"; import { findEntities } from "../common/find-entities"; import { hasConfigOrEntityChanged } from "../common/has-changed"; @@ -124,8 +125,11 @@ export class HuiEntityCard extends LitElement implements LovelaceCard {
${"attribute" in this._config - ? stateObj.attributes[this._config.attribute!] ?? - this.hass.localize("state.default.unknown") + ? formatAttributeValue( + this.hass, + stateObj.attributes[this._config.attribute!] ?? + this.hass.localize("state.default.unknown") + ) : stateObj.attributes.unit_of_measurement ? formatNumber(stateObj.state, this.hass.locale) : computeStateDisplay( diff --git a/src/panels/lovelace/special-rows/hui-attribute-row.ts b/src/panels/lovelace/special-rows/hui-attribute-row.ts index 49a5eb3111..77b05f0803 100644 --- a/src/panels/lovelace/special-rows/hui-attribute-row.ts +++ b/src/panels/lovelace/special-rows/hui-attribute-row.ts @@ -10,6 +10,7 @@ import { customElement, property, state } from "lit/decorators"; import checkValidDate from "../../../common/datetime/check_valid_date"; import { formatNumber } from "../../../common/string/format_number"; import { HomeAssistant } from "../../../types"; +import { formatAttributeValue } from "../../../util/hass-attributes-util"; import { hasConfigOrEntityChanged } from "../common/has-changed"; import "../components/hui-generic-entity-row"; import "../components/hui-timestamp-display"; @@ -72,7 +73,9 @@ class HuiAttributeRow extends LitElement implements LovelaceRow { >` : typeof attribute === "number" ? formatNumber(attribute, this.hass.locale) - : attribute ?? "-"} + : attribute !== undefined + ? formatAttributeValue(this.hass, attribute) + : "-"} ${this._config.suffix}
diff --git a/src/util/hass-attributes-util.ts b/src/util/hass-attributes-util.ts index 8a44c00aa3..ff0804b00f 100644 --- a/src/util/hass-attributes-util.ts +++ b/src/util/hass-attributes-util.ts @@ -1,3 +1,14 @@ +import { html, TemplateResult } from "lit"; +import { until } from "lit/directives/until"; +import checkValidDate from "../common/datetime/check_valid_date"; +import { formatDate } from "../common/datetime/format_date"; +import { formatDateTimeWithSeconds } from "../common/datetime/format_date_time"; +import { isDate } from "../common/string/is_date"; +import { isTimestamp } from "../common/string/is_timestamp"; +import { HomeAssistant } from "../types"; + +let jsYamlPromise: Promise; + const hassAttributeUtil = { DOMAIN_DEVICE_CLASS: { binary_sensor: [ @@ -130,3 +141,59 @@ export function formatAttributeName(value: string): string { .replace(/\bgps\b/g, "GPS"); return value.charAt(0).toUpperCase() + value.slice(1); } + +export function formatAttributeValue( + hass: HomeAssistant, + value: any +): string | TemplateResult { + if (value === null) { + return "-"; + } + + // YAML handling + if ( + (Array.isArray(value) && value.some((val) => val instanceof Object)) || + (!Array.isArray(value) && value instanceof Object) + ) { + if (!jsYamlPromise) { + jsYamlPromise = import("js-yaml"); + } + const yaml = jsYamlPromise.then((jsYaml) => jsYaml.safeDump(value)); + return html`
${until(yaml, "")}
`; + } + + if (typeof value === "string") { + // URL handling + if (value.startsWith("http")) { + try { + // If invalid URL, exception will be raised + const url = new URL(value); + if (url.protocol === "http:" || url.protocol === "https:") + return html`${value}`; + } catch (_) { + // Nothing to do here + } + } + + // Date handling + if (isDate(value, true)) { + // Timestamp handling + if (isTimestamp(value)) { + const date = new Date(value); + if (checkValidDate(date)) { + return formatDateTimeWithSeconds(date, hass.locale); + } + } + + // Value was not a timestamp, so only do date formatting + const date = new Date(value); + if (checkValidDate(date)) { + return formatDate(date, hass.locale); + } + } + } + + return Array.isArray(value) ? value.join(", ") : value; +} diff --git a/test-mocha/common/string/is_date.ts b/test-mocha/common/string/is_date.ts new file mode 100644 index 0000000000..58964f766f --- /dev/null +++ b/test-mocha/common/string/is_date.ts @@ -0,0 +1,12 @@ +import { assert } from "chai"; +import { isDate } from "../../../src/common/string/is_date"; + +describe("isDate", () => { + assert.strictEqual(isDate("ABC"), false); + + assert.strictEqual(isDate("2021-02-03", false), true); + assert.strictEqual(isDate("2021-02-03", true), true); + + assert.strictEqual(isDate("2021-05-25T19:23:52+00:00", true), true); + assert.strictEqual(isDate("2021-05-25T19:23:52+00:00", false), false); +}); From 179717d40cfb99aa370a00c4f30d6c00fb717988 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 25 May 2021 23:51:31 +0200 Subject: [PATCH 096/117] Fix rollup build (#9246) --- src/common/translations/localize.ts | 2 +- .../integration-panels/zha/zha-network-visualization-page.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/translations/localize.ts b/src/common/translations/localize.ts index 72042fcd3f..ee9522e141 100644 --- a/src/common/translations/localize.ts +++ b/src/common/translations/localize.ts @@ -1,4 +1,4 @@ -import { shouldPolyfill } from "@formatjs/intl-pluralrules/should-polyfill"; +import { shouldPolyfill } from "@formatjs/intl-pluralrules/lib/should-polyfill"; import IntlMessageFormat from "intl-messageformat"; import { Resources } from "../../types"; diff --git a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts index 1cfab1d687..b42c15fb6b 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts @@ -9,7 +9,7 @@ import { } from "../../../../../data/zha"; import "../../../../../layouts/hass-tabs-subpage"; import type { HomeAssistant, Route } from "../../../../../types"; -import { Network, Edge, Node, EdgeOptions } from "vis-network"; +import { Network, Edge, Node, EdgeOptions } from "vis-network/peer"; import "../../../../../common/search/search-input"; import "../../../../../components/device/ha-device-picker"; import "../../../../../components/ha-button-menu"; From 835a7833ae0f1ddfcae67a8174052fed4980e428 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 25 May 2021 23:53:58 +0200 Subject: [PATCH 097/117] Bump memoize one (#9243) --- package.json | 3 +-- yarn.lock | 13 ++++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index ac3a7acdb8..84bb2ec92d 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "lit-vaadin-helpers": "^0.1.3", "marked": "2.0.0", "mdn-polyfills": "^5.16.0", - "memoize-one": "^5.0.2", + "memoize-one": "^5.2.1", "node-vibrant": "3.2.1-alpha.1", "proxy-polyfill": "^0.3.1", "punycode": "^2.1.1", @@ -172,7 +172,6 @@ "@types/leaflet": "^1.7.0", "@types/leaflet-draw": "^1.0.3", "@types/marked": "^1.2.2", - "@types/memoize-one": "4.1.0", "@types/mocha": "^7.0.2", "@types/resize-observer-browser": "^0.1.3", "@types/sortablejs": "^1.10.6", diff --git a/yarn.lock b/yarn.lock index 96f52c3197..cadbfc3bc3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2839,11 +2839,6 @@ resolved "https://registry.yarnpkg.com/@types/marked/-/marked-1.2.2.tgz#1f858a0e690247ecf3b2eef576f98f86e8d960d4" integrity sha512-wLfw1hnuuDYrFz97IzJja0pdVsC0oedtS4QsKH1/inyW9qkLQbXgMUqEQT0MVtUBx3twjWeInUfjQbhBVLECXw== -"@types/memoize-one@4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@types/memoize-one/-/memoize-one-4.1.0.tgz#62119f26055b3193ae43ca1882c5b29b88b71ece" - integrity sha512-cmSgi6JMX/yBwgpVm4GooNWIH+vEeJoa8FAa6ExOhpJbC0Juq32/uYKiKb3VPSqrEA0aOnjvwZanla3O1WZMbw== - "@types/mime@*": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.3.tgz#c893b73721db73699943bfc3653b1deb7faa4a3a" @@ -9161,10 +9156,10 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= -memoize-one@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.0.2.tgz#6aba5276856d72fb44ead3efab86432f94ba203d" - integrity sha512-o7lldN4fs/axqctc03NF+PMhd2veRrWeJ2n2GjEzUPBD4F9rmNg4A+bQCACIzwjHJEXuYv4aFFMaH35KZfHUrw== +memoize-one@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e" + integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q== memory-fs@^0.2.0: version "0.2.0" From 465a91dbf3c07a59db3338a3c56b647228997323 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 25 May 2021 23:59:24 +0200 Subject: [PATCH 098/117] Fix circulair progress producing scrollbars (#9247) --- src/components/ha-circular-progress.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/ha-circular-progress.ts b/src/components/ha-circular-progress.ts index 0e9e2db188..d493c04c5d 100644 --- a/src/components/ha-circular-progress.ts +++ b/src/components/ha-circular-progress.ts @@ -1,4 +1,5 @@ import { CircularProgress } from "@material/mwc-circular-progress"; +import { CSSResultGroup, css } from "lit"; import { customElement, property } from "lit/decorators"; @customElement("ha-circular-progress") @@ -41,6 +42,17 @@ export class HaCircularProgress extends CircularProgress { public get indeterminate() { return this.active; } + + static get styles(): CSSResultGroup { + return [ + super.styles, + css` + :host { + overflow: hidden; + } + `, + ]; + } } declare global { From f55e911313e7866e26469926e250c84ec5239531 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Wed, 26 May 2021 00:08:41 +0200 Subject: [PATCH 099/117] Prevent formatting for unknown attribute (#9252) --- src/panels/lovelace/cards/hui-entity-card.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/panels/lovelace/cards/hui-entity-card.ts b/src/panels/lovelace/cards/hui-entity-card.ts index 28c7709926..5c46621b55 100644 --- a/src/panels/lovelace/cards/hui-entity-card.ts +++ b/src/panels/lovelace/cards/hui-entity-card.ts @@ -125,11 +125,12 @@ export class HuiEntityCard extends LitElement implements LovelaceCard {
${"attribute" in this._config - ? formatAttributeValue( - this.hass, - stateObj.attributes[this._config.attribute!] ?? - this.hass.localize("state.default.unknown") - ) + ? stateObj.attributes[this._config.attribute!] !== undefined + ? formatAttributeValue( + this.hass, + stateObj.attributes[this._config.attribute!] + ) + : this.hass.localize("state.default.unknown") : stateObj.attributes.unit_of_measurement ? formatNumber(stateObj.state, this.hass.locale) : computeStateDisplay( From de09e318156b6895a884351b1243ac652d49144a Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 26 May 2021 00:11:17 +0200 Subject: [PATCH 100/117] =?UTF-8?q?Fix=20resetting=20theme,=20only=20fallb?= =?UTF-8?q?ack=20to=20light=20when=20theme=20doesnt=20support=E2=80=A6=20(?= =?UTF-8?q?#9253)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/dom/apply_themes_on_element.ts | 2 +- src/state/themes-mixin.ts | 25 ++++++++--------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/common/dom/apply_themes_on_element.ts b/src/common/dom/apply_themes_on_element.ts index c8f1365102..90143f9bcf 100644 --- a/src/common/dom/apply_themes_on_element.ts +++ b/src/common/dom/apply_themes_on_element.ts @@ -39,7 +39,7 @@ export const applyThemesOnElement = ( if (themeSettings) { if (themeSettings.dark) { cacheKey = `${cacheKey}__dark`; - themeRules = darkStyles; + themeRules = { ...darkStyles }; } if (selectedTheme === "default") { diff --git a/src/state/themes-mixin.ts b/src/state/themes-mixin.ts index b2aae4e43b..9ef9778014 100644 --- a/src/state/themes-mixin.ts +++ b/src/state/themes-mixin.ts @@ -67,15 +67,16 @@ export default >(superClass: T) => if (!this.hass) { return; } - const themeName = - this.hass.selectedThemeSettings?.theme || - (darkPreferred && this.hass.themes.default_dark_theme - ? this.hass.themes.default_dark_theme! - : this.hass.themes.default_theme); let themeSettings: Partial = this .hass!.selectedThemeSettings; + const themeName = + themeSettings?.theme || + (darkPreferred && this.hass.themes.default_dark_theme + ? this.hass.themes.default_dark_theme! + : this.hass.themes.default_theme); + let darkMode = themeSettings?.dark === undefined ? darkPreferred : themeSettings?.dark; @@ -84,18 +85,8 @@ export default >(superClass: T) => ? this.hass.themes.themes[themeSettings.theme] : undefined; - if (selectedTheme) { - // Override dark mode selection depending on what the theme actually provides. - // Leave the selection as-is if the theme supports the requested mode. - if (darkMode && !selectedTheme.modes?.dark) { - darkMode = false; - } else if ( - !darkMode && - !selectedTheme.modes?.light && - selectedTheme.modes?.dark - ) { - darkMode = true; - } + if (selectedTheme && darkMode && !selectedTheme.modes) { + darkMode = false; } themeSettings = { ...this.hass.selectedThemeSettings, dark: darkMode }; From fdcbb5b43270ad46edb9ff3bac8b516b5765a118 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 26 May 2021 00:13:58 +0200 Subject: [PATCH 101/117] Bump js-yaml (#9245) --- build-scripts/rollup.js | 6 +----- gallery/src/components/demo-card.js | 4 ++-- .../demos/demo-automation-describe-action.ts | 4 ++-- .../demo-automation-describe-condition.ts | 4 ++-- .../demos/demo-automation-describe-trigger.ts | 4 ++-- hassio/src/system/hassio-host-info.ts | 4 ++-- package.json | 4 ++-- src/components/ha-yaml-editor.ts | 6 +++--- .../ha-automation-trace-blueprint-config.ts | 4 ++-- .../trace/ha-automation-trace-config.ts | 4 ++-- .../trace/ha-automation-trace-path-details.ts | 12 +++++------ .../mqtt/mqtt-discovery-payload.ts | 4 ++-- .../mqtt/mqtt-messages.ts | 4 ++-- .../event/developer-tools-event.js | 4 ++-- .../service/developer-tools-service.ts | 6 +++--- .../state/developer-tools-state.js | 10 +++++----- src/panels/lovelace/cards/hui-error-card.ts | 4 ++-- .../lovelace/editor/hui-element-editor.ts | 6 +++--- src/panels/lovelace/hui-editor.ts | 8 ++++---- src/resources/js-yaml-dump.ts | 1 + src/util/hass-attributes-util.ts | 6 +++--- yarn.lock | 20 +++++++++++++++---- 22 files changed, 68 insertions(+), 61 deletions(-) create mode 100644 src/resources/js-yaml-dump.ts diff --git a/build-scripts/rollup.js b/build-scripts/rollup.js index 7921ccc051..7d9cf93046 100644 --- a/build-scripts/rollup.js +++ b/build-scripts/rollup.js @@ -52,11 +52,7 @@ const createRollupConfig = ({ browser: true, rootDir: paths.polymer_dir, }), - commonjs({ - namedExports: { - "js-yaml": ["safeDump", "safeLoad"], - }, - }), + commonjs(), json(), babel({ ...bundle.babelOptions({ latestBuild }), diff --git a/gallery/src/components/demo-card.js b/gallery/src/components/demo-card.js index c6137fc9ed..4d9ce53899 100644 --- a/gallery/src/components/demo-card.js +++ b/gallery/src/components/demo-card.js @@ -1,7 +1,7 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; -import { safeLoad } from "js-yaml"; +import { load } from "js-yaml"; import { createCardElement } from "../../../src/panels/lovelace/create-element/create-card-element"; class DemoCard extends PolymerElement { @@ -80,7 +80,7 @@ class DemoCard extends PolymerElement { card.removeChild(card.lastChild); } - const el = this._createCardElement(safeLoad(config.config)[0]); + const el = this._createCardElement(load(config.config)[0]); card.appendChild(el); this._getSize(el); } diff --git a/gallery/src/demos/demo-automation-describe-action.ts b/gallery/src/demos/demo-automation-describe-action.ts index fa0f26b547..ea9b13fff5 100644 --- a/gallery/src/demos/demo-automation-describe-action.ts +++ b/gallery/src/demos/demo-automation-describe-action.ts @@ -1,4 +1,4 @@ -import { safeDump } from "js-yaml"; +import { dump } from "js-yaml"; import { html, css, LitElement, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators"; import "../../../src/components/ha-card"; @@ -56,7 +56,7 @@ export class DemoAutomationDescribeAction extends LitElement { (conf) => html`
${describeAction(this.hass, conf as any)} -
${safeDump(conf)}
+
${dump(conf)}
` )} diff --git a/gallery/src/demos/demo-automation-describe-condition.ts b/gallery/src/demos/demo-automation-describe-condition.ts index 2faffde2c0..60f42d78e2 100644 --- a/gallery/src/demos/demo-automation-describe-condition.ts +++ b/gallery/src/demos/demo-automation-describe-condition.ts @@ -1,4 +1,4 @@ -import { safeDump } from "js-yaml"; +import { dump } from "js-yaml"; import { html, css, LitElement, TemplateResult } from "lit"; import { customElement } from "lit/decorators"; import "../../../src/components/ha-card"; @@ -26,7 +26,7 @@ export class DemoAutomationDescribeCondition extends LitElement { (conf) => html`
${describeCondition(conf as any)} -
${safeDump(conf)}
+
${dump(conf)}
` )} diff --git a/gallery/src/demos/demo-automation-describe-trigger.ts b/gallery/src/demos/demo-automation-describe-trigger.ts index c4b306632e..8a409386c0 100644 --- a/gallery/src/demos/demo-automation-describe-trigger.ts +++ b/gallery/src/demos/demo-automation-describe-trigger.ts @@ -1,4 +1,4 @@ -import { safeDump } from "js-yaml"; +import { dump } from "js-yaml"; import { html, css, LitElement, TemplateResult } from "lit"; import { customElement } from "lit/decorators"; import "../../../src/components/ha-card"; @@ -29,7 +29,7 @@ export class DemoAutomationDescribeTrigger extends LitElement { (conf) => html`
${describeTrigger(conf as any)} -
${safeDump(conf)}
+
${dump(conf)}
` )} diff --git a/hassio/src/system/hassio-host-info.ts b/hassio/src/system/hassio-host-info.ts index 2806b46ad1..cde6becf58 100644 --- a/hassio/src/system/hassio-host-info.ts +++ b/hassio/src/system/hassio-host-info.ts @@ -2,7 +2,7 @@ import "@material/mwc-button"; import { ActionDetail } from "@material/mwc-list/mwc-list-foundation"; import "@material/mwc-list/mwc-list-item"; import { mdiDotsVertical } from "@mdi/js"; -import { safeDump } from "js-yaml"; +import { dump } from "js-yaml"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators"; import memoizeOne from "memoize-one"; @@ -233,7 +233,7 @@ class HassioHostInfo extends LitElement { const content = await fetchHassioHardwareInfo(this.hass); showHassioMarkdownDialog(this, { title: this.supervisor.localize("system.host.hardware"), - content: `
${safeDump(content, { indent: 2 })}
`, + content: `
${dump(content, { indent: 2 })}
`, }); } catch (err) { showAlertDialog(this, { diff --git a/package.json b/package.json index 84bb2ec92d..1a5b3a8e44 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "home-assistant-js-websocket": "^5.10.0", "idb-keyval": "^3.2.0", "intl-messageformat": "^9.6.13", - "js-yaml": "^3.13.1", + "js-yaml": "^4.1.0", "leaflet": "^1.7.1", "leaflet-draw": "^1.0.4", "lit": "^2.0.0-rc.2", @@ -168,7 +168,7 @@ "@types/chai": "^4.1.7", "@types/chromecast-caf-receiver": "^5.0.11", "@types/chromecast-caf-sender": "^1.0.3", - "@types/js-yaml": "^3.12.1", + "@types/js-yaml": "^4.0.1", "@types/leaflet": "^1.7.0", "@types/leaflet-draw": "^1.0.3", "@types/marked": "^1.2.2", diff --git a/src/components/ha-yaml-editor.ts b/src/components/ha-yaml-editor.ts index 07a1ac0a04..8d79034c3e 100644 --- a/src/components/ha-yaml-editor.ts +++ b/src/components/ha-yaml-editor.ts @@ -1,4 +1,4 @@ -import { safeDump, safeLoad } from "js-yaml"; +import { dump, load } from "js-yaml"; import { html, LitElement, TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../common/dom/fire_event"; @@ -30,7 +30,7 @@ export class HaYamlEditor extends LitElement { public setValue(value): void { try { - this._yaml = value && !isEmpty(value) ? safeDump(value) : ""; + this._yaml = value && !isEmpty(value) ? dump(value) : ""; } catch (err) { // eslint-disable-next-line no-console console.error(err, value); @@ -67,7 +67,7 @@ export class HaYamlEditor extends LitElement { if (this._yaml) { try { - parsed = safeLoad(this._yaml); + parsed = load(this._yaml); } catch (err) { // Invalid YAML isValid = false; diff --git a/src/panels/config/automation/trace/ha-automation-trace-blueprint-config.ts b/src/panels/config/automation/trace/ha-automation-trace-blueprint-config.ts index ca04091e79..bc3117114b 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-blueprint-config.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-blueprint-config.ts @@ -1,4 +1,4 @@ -import { safeDump } from "js-yaml"; +import { dump } from "js-yaml"; import { html, LitElement, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators"; import "../../../../components/ha-code-editor"; @@ -15,7 +15,7 @@ export class HaAutomationTraceBlueprintConfig extends LitElement { protected render(): TemplateResult { return html` `; diff --git a/src/panels/config/automation/trace/ha-automation-trace-config.ts b/src/panels/config/automation/trace/ha-automation-trace-config.ts index 3928656f82..c97bb47f8b 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-config.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-config.ts @@ -1,4 +1,4 @@ -import { safeDump } from "js-yaml"; +import { dump } from "js-yaml"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators"; import "../../../../components/ha-code-editor"; @@ -15,7 +15,7 @@ export class HaAutomationTraceConfig extends LitElement { protected render(): TemplateResult { return html` `; diff --git a/src/panels/config/automation/trace/ha-automation-trace-path-details.ts b/src/panels/config/automation/trace/ha-automation-trace-path-details.ts index 1dab6866bc..dc0412b149 100644 --- a/src/panels/config/automation/trace/ha-automation-trace-path-details.ts +++ b/src/panels/config/automation/trace/ha-automation-trace-path-details.ts @@ -1,4 +1,4 @@ -import { safeDump } from "js-yaml"; +import { dump } from "js-yaml"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators"; import { classMap } from "lit/directives/class-map"; @@ -132,13 +132,13 @@ export class HaAutomationTracePathDetails extends LitElement { )}
${result ? html`Result: -
${safeDump(result)}
` +
${dump(result)}
` : error ? html`
Error: ${error}
` : ""} ${Object.keys(rest).length === 0 ? "" - : html`
${safeDump(rest)}
`} + : html`
${dump(rest)}
`} `; }) ); @@ -154,7 +154,7 @@ export class HaAutomationTracePathDetails extends LitElement { const config = getDataFromPath(this.trace!.config, this.selected.path); return config ? html`` : "Unable to find config"; @@ -171,9 +171,7 @@ export class HaAutomationTracePathDetails extends LitElement { ${idx > 0 ? html`

Iteration ${idx + 1}

` : ""} ${Object.keys(trace.changed_variables || {}).length === 0 ? "No variables changed" - : html`
-${safeDump(trace.changed_variables).trimRight()}
`} + : html`
${dump(trace.changed_variables).trimRight()}
`} ` )}
diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts index cc80ae4b6d..cb5e8e3b84 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-discovery-payload.ts @@ -1,4 +1,4 @@ -import { safeDump } from "js-yaml"; +import { dump } from "js-yaml"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators"; import { classMap } from "lit/directives/class-map"; @@ -31,7 +31,7 @@ class MQTTDiscoveryPayload extends LitElement { const payload = this.payload; return html` ${this.showAsYaml - ? html`
${safeDump(payload)}
` + ? html`
${dump(payload)}
` : html`
${JSON.stringify(payload, null, 2)}
`} `; } diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts index 734b4ae085..d07f83fb5f 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/mqtt-messages.ts @@ -1,4 +1,4 @@ -import { safeDump } from "js-yaml"; +import { dump } from "js-yaml"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators"; import { classMap } from "lit/directives/class-map"; @@ -92,7 +92,7 @@ class MQTTMessages extends LitElement { return json ? html` ${this.showAsYaml - ? html`
${safeDump(json)}
` + ? html`
${dump(json)}
` : html`
${JSON.stringify(json, null, 2)}
`} ` : html` ${message.payload} `; diff --git a/src/panels/developer-tools/event/developer-tools-event.js b/src/panels/developer-tools/event/developer-tools-event.js index 6c508799cc..962676645f 100644 --- a/src/panels/developer-tools/event/developer-tools-event.js +++ b/src/panels/developer-tools/event/developer-tools-event.js @@ -4,7 +4,7 @@ import "@polymer/paper-input/paper-input"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; -import { safeLoad } from "js-yaml"; +import { load } from "js-yaml"; import "../../../components/ha-code-editor"; import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import { EventsMixin } from "../../../mixins/events-mixin"; @@ -151,7 +151,7 @@ class HaPanelDevEvent extends EventsMixin(LocalizeMixin(PolymerElement)) { _computeParsedEventData(eventData) { try { - return eventData.trim() ? safeLoad(eventData) : {}; + return eventData.trim() ? load(eventData) : {}; } catch (err) { return ERROR_SENTINEL; } diff --git a/src/panels/developer-tools/service/developer-tools-service.ts b/src/panels/developer-tools/service/developer-tools-service.ts index 0cb879496d..8e66d99a87 100644 --- a/src/panels/developer-tools/service/developer-tools-service.ts +++ b/src/panels/developer-tools/service/developer-tools-service.ts @@ -1,6 +1,6 @@ import { mdiHelpCircle } from "@mdi/js"; import { ERR_CONNECTION_LOST } from "home-assistant-js-websocket"; -import { safeLoad } from "js-yaml"; +import { load } from "js-yaml"; import { css, CSSResultGroup, html, LitElement } from "lit"; import { property, query, state } from "lit/decorators"; import memoizeOne from "memoize-one"; @@ -361,9 +361,9 @@ class HaPanelDevService extends LitElement { const example = {}; fields.forEach((field) => { if (field.example) { - let value = ""; + let value: any = ""; try { - value = safeLoad(field.example); + value = load(field.example); } catch (err) { value = field.example; } diff --git a/src/panels/developer-tools/state/developer-tools-state.js b/src/panels/developer-tools/state/developer-tools-state.js index aff517c2ba..d860fa947b 100644 --- a/src/panels/developer-tools/state/developer-tools-state.js +++ b/src/panels/developer-tools/state/developer-tools-state.js @@ -9,7 +9,7 @@ import "@polymer/paper-input/paper-input"; import { html } from "@polymer/polymer/lib/utils/html-tag"; /* eslint-plugin-disable lit */ import { PolymerElement } from "@polymer/polymer/polymer-element"; -import { safeDump, safeLoad } from "js-yaml"; +import { dump, load } from "js-yaml"; import { formatDateTimeWithSeconds } from "../../../common/datetime/format_date_time"; import { computeRTL } from "../../../common/util/compute_rtl"; import { copyToClipboard } from "../../../common/util/copy-clipboard"; @@ -332,7 +332,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { this._entityId = state.entity_id; this._entity = state; this._state = state.state; - this._stateAttributes = safeDump(state.attributes); + this._stateAttributes = dump(state.attributes); ev.preventDefault(); } @@ -349,7 +349,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { } this._entity = state; this._state = state.state; - this._stateAttributes = safeDump(state.attributes); + this._stateAttributes = dump(state.attributes); } entityMoreInfo(ev) { @@ -493,7 +493,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { (Array.isArray(value) && value.some((val) => val instanceof Object)) || (!Array.isArray(value) && value instanceof Object) ) { - return `\n${safeDump(value)}`; + return `\n${dump(value)}`; } return Array.isArray(value) ? value.join(", ") : value; } @@ -508,7 +508,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { _computeParsedStateAttributes(stateAttributes) { try { - return stateAttributes.trim() ? safeLoad(stateAttributes) : {}; + return stateAttributes.trim() ? load(stateAttributes) : {}; } catch (err) { return ERROR_SENTINEL; } diff --git a/src/panels/lovelace/cards/hui-error-card.ts b/src/panels/lovelace/cards/hui-error-card.ts index 747b700166..969ad566c7 100644 --- a/src/panels/lovelace/cards/hui-error-card.ts +++ b/src/panels/lovelace/cards/hui-error-card.ts @@ -1,4 +1,4 @@ -import { safeDump } from "js-yaml"; +import { dump } from "js-yaml"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, state } from "lit/decorators"; import { HomeAssistant } from "../../../types"; @@ -28,7 +28,7 @@ export class HuiErrorCard extends LitElement implements LovelaceCard { if (this._config.origConfig) { try { - dumped = safeDump(this._config.origConfig); + dumped = dump(this._config.origConfig); } catch (err) { dumped = `[Error dumping ${this._config.origConfig}]`; } diff --git a/src/panels/lovelace/editor/hui-element-editor.ts b/src/panels/lovelace/editor/hui-element-editor.ts index 8a595759c6..d0c0904f78 100644 --- a/src/panels/lovelace/editor/hui-element-editor.ts +++ b/src/panels/lovelace/editor/hui-element-editor.ts @@ -1,5 +1,5 @@ import "@material/mwc-button"; -import { safeDump, safeLoad } from "js-yaml"; +import { dump, load } from "js-yaml"; import { css, CSSResultGroup, @@ -77,7 +77,7 @@ export abstract class HuiElementEditor extends LitElement { public get yaml(): string { if (!this._yaml) { - this._yaml = safeDump(this._config); + this._yaml = dump(this._config); } return this._yaml || ""; } @@ -85,7 +85,7 @@ export abstract class HuiElementEditor extends LitElement { public set yaml(_yaml: string) { this._yaml = _yaml; try { - this._config = safeLoad(this.yaml); + this._config = load(this.yaml) as any; this._errors = undefined; } catch (err) { this._errors = [err.message]; diff --git a/src/panels/lovelace/hui-editor.ts b/src/panels/lovelace/hui-editor.ts index 7b86d68e43..f989ba7ac9 100644 --- a/src/panels/lovelace/hui-editor.ts +++ b/src/panels/lovelace/hui-editor.ts @@ -2,7 +2,7 @@ import { undoDepth } from "@codemirror/history"; import "@material/mwc-button"; import "@polymer/app-layout/app-header/app-header"; import "@polymer/app-layout/app-toolbar/app-toolbar"; -import { safeDump, safeLoad } from "js-yaml"; +import { dump, load } from "js-yaml"; import { css, CSSResultGroup, @@ -104,7 +104,7 @@ class LovelaceFullConfigEditor extends LitElement { protected firstUpdated(changedProps: PropertyValues) { super.firstUpdated(changedProps); - this.yamlEditor.value = safeDump(this.lovelace!.rawConfig); + this.yamlEditor.value = dump(this.lovelace!.rawConfig); } protected updated(changedProps: PropertyValues) { @@ -122,7 +122,7 @@ class LovelaceFullConfigEditor extends LitElement { ), action: { action: () => { - this.yamlEditor.value = safeDump(this.lovelace!.rawConfig); + this.yamlEditor.value = dump(this.lovelace!.rawConfig); }, text: this.hass!.localize( "ui.panel.lovelace.editor.raw_editor.reload" @@ -258,7 +258,7 @@ class LovelaceFullConfigEditor extends LitElement { let config: LovelaceConfig; try { - config = safeLoad(value); + config = load(value) as LovelaceConfig; } catch (err) { showAlertDialog(this, { text: this.hass.localize( diff --git a/src/resources/js-yaml-dump.ts b/src/resources/js-yaml-dump.ts new file mode 100644 index 0000000000..dec67712ae --- /dev/null +++ b/src/resources/js-yaml-dump.ts @@ -0,0 +1 @@ +export { dump } from "js-yaml"; diff --git a/src/util/hass-attributes-util.ts b/src/util/hass-attributes-util.ts index ff0804b00f..0e991b0fa5 100644 --- a/src/util/hass-attributes-util.ts +++ b/src/util/hass-attributes-util.ts @@ -7,7 +7,7 @@ import { isDate } from "../common/string/is_date"; import { isTimestamp } from "../common/string/is_timestamp"; import { HomeAssistant } from "../types"; -let jsYamlPromise: Promise; +let jsYamlPromise: Promise; const hassAttributeUtil = { DOMAIN_DEVICE_CLASS: { @@ -156,9 +156,9 @@ export function formatAttributeValue( (!Array.isArray(value) && value instanceof Object) ) { if (!jsYamlPromise) { - jsYamlPromise = import("js-yaml"); + jsYamlPromise = import("../resources/js-yaml-dump"); } - const yaml = jsYamlPromise.then((jsYaml) => jsYaml.safeDump(value)); + const yaml = jsYamlPromise.then((jsYaml) => jsYaml.dump(value)); return html`
${until(yaml, "")}
`; } diff --git a/yarn.lock b/yarn.lock index cadbfc3bc3..6a2a655cf3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2762,10 +2762,10 @@ resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-1.8.0.tgz#682477dbbbd07cd032731cb3b0e7eaee3d026b69" integrity sha512-2aoSC4UUbHDj2uCsCxcG/vRMXey/m17bC7UwitVm5hn22nI8O8Y9iDpA76Orc+DWkQ4zZrOKEshCqR/jSuXAHA== -"@types/js-yaml@^3.12.1": - version "3.12.1" - resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-3.12.1.tgz#5c6f4a1eabca84792fbd916f0cb40847f123c656" - integrity sha512-SGGAhXLHDx+PK4YLNcNGa6goPf9XRWQNAUUbffkwVGGXIxmDKWyGGL4inzq2sPmExu431Ekb9aEMn9BkPqEYFA== +"@types/js-yaml@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.1.tgz#5544730b65a480b18ace6b6ce914e519cec2d43b" + integrity sha512-xdOvNmXmrZqqPy3kuCQ+fz6wA0xU5pji9cd1nDrflWaAWtYLLGk5ykW0H6yg5TVyehHP1pfmuuSaZkhP+kspVA== "@types/json-schema@*": version "7.0.5" @@ -3831,6 +3831,11 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" @@ -8365,6 +8370,13 @@ js-yaml@3.13.1, js-yaml@^3.13.0, js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" From cbd6d4251c1404b8b24c043d3c5a82a103de76d4 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Wed, 26 May 2021 00:24:30 +0200 Subject: [PATCH 102/117] Prevent shrinking of percent value in supervisor metrics (#9033) --- hassio/src/components/supervisor-metric.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/hassio/src/components/supervisor-metric.ts b/hassio/src/components/supervisor-metric.ts index e6dc772517..af31344e44 100644 --- a/hassio/src/components/supervisor-metric.ts +++ b/hassio/src/components/supervisor-metric.ts @@ -64,6 +64,7 @@ class SupervisorMetric extends LitElement { .value { width: 48px; padding-right: 4px; + flex-shrink: 0; } `; } From b6c5223221c2911a187a828bf58bf183d569e200 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 26 May 2021 02:25:19 +0000 Subject: [PATCH 103/117] Translation update --- translations/frontend/bg.json | 1 + translations/frontend/en.json | 12 +++++++++--- translations/frontend/es.json | 14 ++++++++++---- translations/frontend/et.json | 16 +++++++++++----- translations/frontend/nb.json | 4 ++-- translations/frontend/pl.json | 22 ++++++++++++++++++++-- translations/frontend/ru.json | 7 ++++++- translations/frontend/zh-Hans.json | 6 +++--- translations/frontend/zh-Hant.json | 4 ++-- 9 files changed, 64 insertions(+), 22 deletions(-) diff --git a/translations/frontend/bg.json b/translations/frontend/bg.json index f356d57db5..12a6b9be67 100644 --- a/translations/frontend/bg.json +++ b/translations/frontend/bg.json @@ -1598,6 +1598,7 @@ "title": "Alexa" }, "connected": "Свързан", + "connecting": "Свързване...", "connection_status": "Състояние на връзката с облака", "fetching_subscription": "Извличане на абонамент...", "google": { diff --git a/translations/frontend/en.json b/translations/frontend/en.json index 78e1c2e2d8..4c0f063244 100644 --- a/translations/frontend/en.json +++ b/translations/frontend/en.json @@ -396,14 +396,15 @@ }, "folders": "Folders", "full_snapshot": "Full snapshot", - "name": "Name", + "name": "Snapshot name", "no_snapshots": "You don't have any snapshots yet.", "partial_snapshot": "Partial snapshot", - "password": "Password", + "password": "Snapshot password", "password_protected": "password protected", "password_protection": "Password protection", "security": "Security", - "type": "Type", + "select_type": "Select what to restore", + "type": "Snapshot type", "upload_snapshot": "Upload snapshot" }, "store": { @@ -720,6 +721,9 @@ "no_match": "No matching areas found", "show_areas": "Show areas" }, + "attributes": { + "expansion_header": "Attributes" + }, "blueprint-picker": { "add_user": "Add user", "remove_user": "Remove user", @@ -1719,6 +1723,7 @@ "title": "Alexa" }, "connected": "Connected", + "connecting": "Connecting...", "connection_status": "Cloud connection status", "fetching_subscription": "Fetching subscription...", "google": { @@ -2959,6 +2964,7 @@ }, "logs": { "log_level": "Log Level", + "log_level_changed": "Log Level changed to: {level}", "subscribed_to_logs": "Subscribed to Z-Wave JS Log Messages...", "title": "Z-Wave JS Logs" }, diff --git a/translations/frontend/es.json b/translations/frontend/es.json index 26931a3a32..fd6c44b051 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -314,7 +314,7 @@ "addon_new_version": "Nueva versión disponible", "addon_running": "El complemento se está ejecutando", "addon_stopped": "El complemento está detenido", - "addons": "Complementos", + "addons": "Complementos instalados", "no_addons": "Aún no tienes ningún complemento instalado. ¡Dirígete a la tienda de complementos para comenzar!" }, "dialog": { @@ -396,14 +396,15 @@ }, "folders": "Carpetas", "full_snapshot": "Instantánea completa", - "name": "Nombre", + "name": "Nombre de la instantánea", "no_snapshots": "Aún no tienes instantáneas.", "partial_snapshot": "Instantánea parcial", - "password": "Contraseña", + "password": "Contraseña de la instantánea", "password_protected": "protegida por contraseña", "password_protection": "Protección con contraseña", "security": "Seguridad", - "type": "Tipo", + "select_type": "Selecciona qué restaurar", + "type": "Tipo de instantánea", "upload_snapshot": "Subir instantánea" }, "store": { @@ -720,6 +721,9 @@ "no_match": "No se han encontrado áreas coincidentes", "show_areas": "Mostrar áreas" }, + "attributes": { + "expansion_header": "Atributos" + }, "blueprint-picker": { "add_user": "Añadir usuario", "remove_user": "Eliminar usuario", @@ -1719,6 +1723,7 @@ "title": "Alexa" }, "connected": "Conectado", + "connecting": "Conectando...", "connection_status": "Estado de conexión a la nube", "fetching_subscription": "Obteniendo suscripción...", "google": { @@ -2959,6 +2964,7 @@ }, "logs": { "log_level": "Nivel de registro", + "log_level_changed": "Nivel de registro cambiado a: {level}", "subscribed_to_logs": "Suscrito a los mensajes de registro de Z-Wave JS...", "title": "Registros de Z-Wave JS" }, diff --git a/translations/frontend/et.json b/translations/frontend/et.json index d365be1b14..14ceecf2eb 100644 --- a/translations/frontend/et.json +++ b/translations/frontend/et.json @@ -292,7 +292,7 @@ "save": "Salvesta", "show_more": "Kuva selle kohta rohkem teavet", "update": "Uuenda", - "update_available": "{count, plural,\n one {värskendus}\n other {{count] värskendust}\n} on saadaval", + "update_available": "{count, plural,\n one {uuendus}\n other {{count} uuendust}\n} on saadaval", "version": "Versioon", "yes": "Jah" }, @@ -314,7 +314,7 @@ "addon_new_version": "Uus versioon on saadaval", "addon_running": "Lisandmoodul töötab", "addon_stopped": "Lisandmoodul on peatatud", - "addons": "Lisandmoodulid", + "addons": "Paigaldatud lisandmoodulid", "no_addons": "Ühtegi lisandmoodulit pole veel paigaldatud. Alustamiseks mine lisandmoodulite hoidlasse!" }, "dialog": { @@ -396,14 +396,15 @@ }, "folders": "Kaustad", "full_snapshot": "Täielik hetktõmmis", - "name": "Nimi", + "name": "Hetktõmmise nimi", "no_snapshots": "Sul pole veel ühtegi hetktõmmist.", "partial_snapshot": "Osaline hetktõmmis", - "password": "Salasõna", + "password": "Hetktõmmise salasõna", "password_protected": "salasõnaha kaitstud", "password_protection": "Salasõnaga kaitstud", "security": "Turvalisus", - "type": "Tüüp", + "select_type": "Vali mida taastada", + "type": "Hetktõmmise tüüp", "upload_snapshot": "Hetktõmmise üleslaadimine" }, "store": { @@ -720,6 +721,9 @@ "no_match": "Sobivaid alasid ei leitud", "show_areas": "Näita alasid" }, + "attributes": { + "expansion_header": "Atribuudid" + }, "blueprint-picker": { "add_user": "Lisa kasutaja", "remove_user": "Kustuta kasutaja", @@ -1719,6 +1723,7 @@ "title": "Alexa" }, "connected": "Ühendatud", + "connecting": "Ühendun...", "connection_status": "Pilveühenduse olek", "fetching_subscription": "Tellimuse andmete toomine ...", "google": { @@ -2959,6 +2964,7 @@ }, "logs": { "log_level": "Logimise tase", + "log_level_changed": "Silumisteave on muudetud: {level}", "subscribed_to_logs": "Z-Wave JS Logi sõnumite tellimine...", "title": "Z-Wave JS logid" }, diff --git a/translations/frontend/nb.json b/translations/frontend/nb.json index 3a5b61af8a..36c1bc1113 100644 --- a/translations/frontend/nb.json +++ b/translations/frontend/nb.json @@ -292,7 +292,7 @@ "save": "Lagre", "show_more": "Vis mer informasjon om dette", "update": "Oppdater", - "update_available": "{count, plural,\n one {Oppdatering}\n other {{count} Oppdateringer}\n} venter", + "update_available": "{count, plural,\n one {Update}\n other {{count} updates}\n} pending", "version": "Versjon", "yes": "Ja" }, @@ -314,7 +314,7 @@ "addon_new_version": "Ny versjon tilgjengelig", "addon_running": "Tillegget kjører", "addon_stopped": "Tillegget er stoppet", - "addons": "Tillegg", + "addons": "Installerte tillegg", "no_addons": "Du har ikke installert tilleggsprogrammer ennå. Gå over til tilleggsbutikken for å komme i gang!" }, "dialog": { diff --git a/translations/frontend/pl.json b/translations/frontend/pl.json index be5aa52505..cf8b6b580c 100644 --- a/translations/frontend/pl.json +++ b/translations/frontend/pl.json @@ -314,7 +314,7 @@ "addon_new_version": "Nowa wersja dostępna", "addon_running": "Dodatek jest uruchomiony", "addon_stopped": "Dodatek jest zatrzymany", - "addons": "Dodatki", + "addons": "Zainstalowane dodatki", "no_addons": "Nie masz jeszcze zainstalowanych żadnych dodatków. Przejdź do sklepu z dodatkami, aby rozpocząć!" }, "dialog": { @@ -720,6 +720,9 @@ "no_match": "Nie znaleziono pasujących obszarów", "show_areas": "Pokaż obszary" }, + "attributes": { + "expansion_header": "Atrybuty" + }, "blueprint-picker": { "add_user": "Dodaj użytkownika", "remove_user": "Usuń użytkownika", @@ -2588,6 +2591,8 @@ "add_scene": "Dodaj scenę", "delete_confirm": "Czy na pewno chcesz usunąć tę scenę?", "delete_scene": "Usuń scenę", + "duplicate": "Duplikuj", + "duplicate_scene": "Duplikuj scenę", "edit_scene": "Edytuj scenę", "header": "Edytor scen", "headers": { @@ -2915,7 +2920,9 @@ "controller_in_inclusion_mode": "Kontroler Z-Wave jest teraz w trybie dodawania węzła.", "follow_device_instructions": "Postępuj zgodnie ze wskazówkami dołączonymi do urządzenia, aby wywołać dodawanie do sieci.", "inclusion_failed": "Nie można dodać węzła. Sprawdź logi, aby uzyskać więcej informacji.", - "inclusion_finished": "Węzeł został dodany. Trwa kończenie konfiguracji węzła w tle, dodawanie encji urządzenia może zająć kilka minut.", + "inclusion_finished": "Węzeł został dodany.", + "interview_failed": "Odpytywanie urządzenia nie powiodło się. Dodatkowe informacje mogą być dostępne w logach.", + "interview_started": "Urządzenie jest odpytywane. To może zająć trochę czasu.", "introduction": "Ten kreator poprowadzi Cię przez proces dodawania węzła do sieci Z-Wave.", "secure_inclusion_warning": "Bezpieczne węzły wymagają dodatkowej przepustowości; zbyt wiele bezpiecznych węzłów może spowolnić twoją sieć Z-Wave. Zalecamy używanie bezpiecznego dodawania tylko w przypadku urządzeń, które tego wymagają, takich jak zamki lub urządzenia sterujące bramami garażowymi.", "start_inclusion": "Rozpocznij dodawanie węzła", @@ -4004,6 +4011,17 @@ "primary_color": "Kolor podstawowy", "reset": "Zresetuj" }, + "time_format": { + "description": "Wybierz sposób formatowania czasu.", + "dropdown_label": "Format czasu", + "formats": { + "12": "12-godzinny (AM / PM)", + "24": "24-godzinny", + "language": "Auto (użyj ustawień języka)", + "system": "Użyj ustawień regionalnych systemu" + }, + "header": "Format czasu" + }, "vibrate": { "description": "Włącz lub wyłącz wibracje na tym urządzeniu podczas sterowania urządzeniami.", "header": "Wibracja" diff --git a/translations/frontend/ru.json b/translations/frontend/ru.json index 4f1784545c..0900468e88 100644 --- a/translations/frontend/ru.json +++ b/translations/frontend/ru.json @@ -314,7 +314,7 @@ "addon_new_version": "Доступна новая версия", "addon_running": "Дополнение работает", "addon_stopped": "Дополнение остановлено", - "addons": "Дополнения", + "addons": "Установленные дополнения", "no_addons": "Нет установленных дополнений. Вы можете установить их из магазина дополнений." }, "dialog": { @@ -720,6 +720,9 @@ "no_match": "Подходящих помещений не найдено", "show_areas": "Показать помещения" }, + "attributes": { + "expansion_header": "Атрибуты" + }, "blueprint-picker": { "add_user": "Добавить пользователя", "remove_user": "Удалить пользователя", @@ -1719,6 +1722,7 @@ "title": "Alexa" }, "connected": "Подключено", + "connecting": "Подключение...", "connection_status": "Статус подключения к облаку", "fetching_subscription": "Получение информации о подписке…", "google": { @@ -2959,6 +2963,7 @@ }, "logs": { "log_level": "Уровень", + "log_level_changed": "Уровень журнала изменен на: {level}", "subscribed_to_logs": "Подписано на сообщения журнала Z-Wave JS...", "title": "Журналы Z-Wave JS" }, diff --git a/translations/frontend/zh-Hans.json b/translations/frontend/zh-Hans.json index 01eee193b8..96e0edaed3 100644 --- a/translations/frontend/zh-Hans.json +++ b/translations/frontend/zh-Hans.json @@ -3150,8 +3150,8 @@ "attributes": "属性", "copy_id": "将 ID 复制到剪贴板", "current_entities": "现有实体", - "description1": "设置设备在 Home Assistant 中的呈现方式。", - "description2": "这将不影响实际设备。", + "description1": "此处可设置实体在 Home Assistant 中的状态。", + "description2": "此操作只会改变实体在系统中显示的状态,而不会改变实际设备的状态。", "entity": "实体", "filter_attributes": "输入筛选属性", "filter_entities": "输入筛选实体", @@ -3523,7 +3523,7 @@ "duplicate": "复制卡片", "edit": "编辑", "header": "卡片配置", - "move": "移动", + "move": "移动到视图", "move_after": "向后移动卡片", "move_before": "向前移动卡片", "options": "更多选项", diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index 4a3d038d87..70283c36a0 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -292,7 +292,7 @@ "save": "儲存", "show_more": "顯示關於此更詳細資訊", "update": "更新", - "update_available": "{count, plural,\n one {個更新}\n other {{count} 個更新}\n}等候中", + "update_available": "{count, plural,\n one {個更新}\n other {{count}個更新}\n}等候中", "version": "安裝版本", "yes": "是" }, @@ -314,7 +314,7 @@ "addon_new_version": "新版本可供下載", "addon_running": "附加元件執行中", "addon_stopped": "附加元件已停止", - "addons": "附加元件", + "addons": "安裝附加元件", "no_addons": "目前似乎沒有安裝任何附加元件。點選下方附加元件商店以新增!" }, "dialog": { From 3cc4628d03ff478e94dd3c9ac59f14deeda4b1a5 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 26 May 2021 10:02:02 +0200 Subject: [PATCH 104/117] Bump test dependencies (#9244) --- .mocharc.cjs | 4 + package.json | 15 +- .../common/entity/extract_views.spec.ts | 2 +- .../common/entity/get_group_entities.spec.ts | 2 +- .../common/entity/get_view_entities.spec.ts | 2 +- .../common/entity/split_by_groups.spec.ts | 2 +- .../entity/timer_time_remaining_test.ts | 4 +- .../common/util/parse_aspect_ratio_test.ts | 2 +- .../external_app/external_messaging.spec.ts | 2 +- test-mocha/hassio/create_session.spec.ts | 6 +- test-mocha/mocha.opts | 4 - .../lovelace/editor/config-util.spec.ts | 12 +- test-mocha/util/calculate.spec.ts | 22 +- test-mocha/util/generate-brands-url-spec.ts | 2 +- .../util/generate-documentation-url.spec.ts | 2 +- yarn.lock | 592 +++++++++--------- 16 files changed, 334 insertions(+), 341 deletions(-) create mode 100644 .mocharc.cjs delete mode 100644 test-mocha/mocha.opts diff --git a/.mocharc.cjs b/.mocharc.cjs new file mode 100644 index 0000000000..c34a155aba --- /dev/null +++ b/.mocharc.cjs @@ -0,0 +1,4 @@ +module.exports = { + require: "test-mocha/testconf.js", + timeout: 10000, +}; diff --git a/package.json b/package.json index 1a5b3a8e44..269e4e052e 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "lint:lit": "lit-analyzer \"**/src/**/*.ts\" --format markdown --outFile result.md", "lint": "yarn run lint:eslint && yarn run lint:prettier && yarn run lint:types", "format": "yarn run format:eslint && yarn run format:prettier", - "mocha": "node_modules/.bin/ts-mocha -p test-mocha/tsconfig.test.json --opts test-mocha/mocha.opts", + "mocha": "ts-mocha -p test-mocha/tsconfig.test.json \"test-mocha/**/*.ts\"", "test": "yarn run lint && yarn run mocha" }, "author": "Paulus Schoutsen (http://paulusschoutsen.nl)", @@ -165,15 +165,16 @@ "@rollup/plugin-json": "^4.0.3", "@rollup/plugin-node-resolve": "^7.1.3", "@rollup/plugin-replace": "^2.3.2", - "@types/chai": "^4.1.7", + "@types/chai": "^4.2.18", "@types/chromecast-caf-receiver": "^5.0.11", "@types/chromecast-caf-sender": "^1.0.3", "@types/js-yaml": "^4.0.1", "@types/leaflet": "^1.7.0", "@types/leaflet-draw": "^1.0.3", "@types/marked": "^1.2.2", - "@types/mocha": "^7.0.2", + "@types/mocha": "^8.2.2", "@types/resize-observer-browser": "^0.1.3", + "@types/sinon": "^10.0.0", "@types/sortablejs": "^1.10.6", "@types/webspeechapi": "^0.0.29", "@typescript-eslint/eslint-plugin": "^4.22.0", @@ -181,7 +182,7 @@ "@web/dev-server": "^0.0.24", "@web/dev-server-rollup": "^0.2.11", "babel-loader": "^8.1.0", - "chai": "^4.2.0", + "chai": "^4.3.4", "cpx": "^1.5.0", "del": "^4.0.0", "eslint": "^7.25.0", @@ -209,7 +210,7 @@ "magic-string": "^0.25.7", "map-stream": "^0.0.7", "merge-stream": "^1.0.1", - "mocha": "^7.2.0", + "mocha": "^8.4.0", "object-hash": "^2.0.3", "open": "^7.0.4", "prettier": "^2.0.4", @@ -220,12 +221,12 @@ "rollup-plugin-terser": "^5.3.0", "rollup-plugin-visualizer": "^4.0.4", "serve": "^11.3.0", - "sinon": "^7.3.1", + "sinon": "^11.0.0", "source-map-url": "^0.4.0", "systemjs": "^6.3.2", "terser-webpack-plugin": "^5.1.1", "ts-lit-plugin": "^1.2.1", - "ts-mocha": "^7.0.0", + "ts-mocha": "^8.0.0", "typescript": "^4.2.4", "vinyl-buffer": "^1.0.1", "vinyl-source-stream": "^2.0.0", diff --git a/test-mocha/common/entity/extract_views.spec.ts b/test-mocha/common/entity/extract_views.spec.ts index e3cb85c111..245bbefbca 100644 --- a/test-mocha/common/entity/extract_views.spec.ts +++ b/test-mocha/common/entity/extract_views.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import { assert } from "chai"; import { DEFAULT_VIEW_ENTITY_ID } from "../../../src/common/const"; import { extractViews } from "../../../src/common/entity/extract_views"; import { createEntities, createView } from "./test_util"; diff --git a/test-mocha/common/entity/get_group_entities.spec.ts b/test-mocha/common/entity/get_group_entities.spec.ts index 2c22a2913b..4ac01de91c 100644 --- a/test-mocha/common/entity/get_group_entities.spec.ts +++ b/test-mocha/common/entity/get_group_entities.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import { assert } from "chai"; import { getGroupEntities } from "../../../src/common/entity/get_group_entities"; diff --git a/test-mocha/common/entity/get_view_entities.spec.ts b/test-mocha/common/entity/get_view_entities.spec.ts index ae3cd13192..b22365c780 100644 --- a/test-mocha/common/entity/get_view_entities.spec.ts +++ b/test-mocha/common/entity/get_view_entities.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import { assert } from "chai"; import { getViewEntities } from "../../../src/common/entity/get_view_entities"; diff --git a/test-mocha/common/entity/split_by_groups.spec.ts b/test-mocha/common/entity/split_by_groups.spec.ts index 1e4a28140d..514734238e 100644 --- a/test-mocha/common/entity/split_by_groups.spec.ts +++ b/test-mocha/common/entity/split_by_groups.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import { assert } from "chai"; import { splitByGroups } from "../../../src/common/entity/split_by_groups"; diff --git a/test-mocha/common/entity/timer_time_remaining_test.ts b/test-mocha/common/entity/timer_time_remaining_test.ts index 8c1ce07e00..13ba7eb206 100644 --- a/test-mocha/common/entity/timer_time_remaining_test.ts +++ b/test-mocha/common/entity/timer_time_remaining_test.ts @@ -1,5 +1,5 @@ import { assert } from "chai"; -import * as sinon from "sinon"; +import { useFakeTimers } from "sinon"; import { timerTimeRemaining } from "../../../src/data/timer"; @@ -31,7 +31,7 @@ describe("timerTimeRemaining", () => { describe("active timers", () => { let clock; beforeEach(() => { - clock = sinon.useFakeTimers(new Date("2018-01-17T16:15:30Z")); + clock = useFakeTimers(new Date("2018-01-17T16:15:30Z")); }); afterEach(() => { clock.restore(); diff --git a/test-mocha/common/util/parse_aspect_ratio_test.ts b/test-mocha/common/util/parse_aspect_ratio_test.ts index 758010aefa..398361e9e7 100644 --- a/test-mocha/common/util/parse_aspect_ratio_test.ts +++ b/test-mocha/common/util/parse_aspect_ratio_test.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import { assert } from "chai"; import parseAspectRatio from "../../../src/common/util/parse-aspect-ratio"; diff --git a/test-mocha/external_app/external_messaging.spec.ts b/test-mocha/external_app/external_messaging.spec.ts index d13e342d1d..ac1b1b8aa1 100644 --- a/test-mocha/external_app/external_messaging.spec.ts +++ b/test-mocha/external_app/external_messaging.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import { assert } from "chai"; import { ExternalMessaging, diff --git a/test-mocha/hassio/create_session.spec.ts b/test-mocha/hassio/create_session.spec.ts index e308036eef..0367167e48 100644 --- a/test-mocha/hassio/create_session.spec.ts +++ b/test-mocha/hassio/create_session.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import { assert } from "chai"; import { createHassioSession } from "../../src/data/hassio/ingress"; describe("Create hassio session", function () { @@ -44,7 +44,9 @@ describe("Create hassio session", function () { it("Test fail to create", async function () { const createSessionPromise = createHassioSession({ // @ts-ignore - callApi: async function () {}, + callApi: async function () { + // noop + }, }).then( () => true, () => false diff --git a/test-mocha/mocha.opts b/test-mocha/mocha.opts deleted file mode 100644 index 468fd16da1..0000000000 --- a/test-mocha/mocha.opts +++ /dev/null @@ -1,4 +0,0 @@ ---require test-mocha/testconf.js ---recursive ---timeout 10000 -test-mocha/**/*.ts diff --git a/test-mocha/panels/lovelace/editor/config-util.spec.ts b/test-mocha/panels/lovelace/editor/config-util.spec.ts index bfba395379..d30ac84fa3 100644 --- a/test-mocha/panels/lovelace/editor/config-util.spec.ts +++ b/test-mocha/panels/lovelace/editor/config-util.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import { assert } from "chai"; import { swapCard, @@ -43,7 +43,7 @@ describe("swapCard", () => { }; const result = swapCard(config, [0, 0], [1, 1]); - const expected = { + const expected: LovelaceConfig = { views: [ { cards: [{ type: "v2-c2" }, { type: "v1-c2" }], @@ -69,7 +69,7 @@ describe("moveCard", () => { }; const result = moveCard(config, [1, 0], [0]); - const expected = { + const expected: LovelaceConfig = { views: [ { cards: [{ type: "card1" }], @@ -95,7 +95,7 @@ describe("moveCard", () => { }; const result = moveCard(config, [1, 0], [0]); - const expected = { + const expected: LovelaceConfig = { views: [ { cards: [{ type: "v1-c1" }, { type: "v1-c2" }, { type: "v2-c1" }], @@ -147,7 +147,7 @@ describe("swapView", () => { }; const result = swapView(config, 1, 0); - const expected = { + const expected: LovelaceConfig = { views: [ { title: "view2", @@ -177,7 +177,7 @@ describe("swapView", () => { }; const result = swapView(config, 0, 0); - const expected = { + const expected: LovelaceConfig = { views: [ { title: "view1", diff --git a/test-mocha/util/calculate.spec.ts b/test-mocha/util/calculate.spec.ts index 8470e27828..49c8fa5109 100644 --- a/test-mocha/util/calculate.spec.ts +++ b/test-mocha/util/calculate.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import { assert } from "chai"; import { getValueInPercentage, normalize, @@ -7,19 +7,19 @@ import { describe("Calculate tests", function () { it("Test getValueInPercentage", function () { - assert.equal(getValueInPercentage(10, 0, 100), 10); - assert.equal(getValueInPercentage(120, 0, 100), 120); - assert.equal(getValueInPercentage(-10, 0, 100), -10); - assert.equal(getValueInPercentage(10.33333, 0, 100), 10.33333); + assert.strictEqual(getValueInPercentage(10, 0, 100), 10); + assert.strictEqual(getValueInPercentage(120, 0, 100), 120); + assert.strictEqual(getValueInPercentage(-10, 0, 100), -10); + assert.strictEqual(getValueInPercentage(10.33333, 0, 100), 10.33333); }); it("Test normalize", function () { - assert.equal(normalize(10, 0, 100), 10); - assert.equal(normalize(1, 10, 100), 10); - assert.equal(normalize(100, 0, 10), 10); + assert.strictEqual(normalize(10, 0, 100), 10); + assert.strictEqual(normalize(1, 10, 100), 10); + assert.strictEqual(normalize(100, 0, 10), 10); }); it("Test roundWithOneDecimal", function () { - assert.equal(roundWithOneDecimal(10), 10); - assert.equal(roundWithOneDecimal(10.3), 10.3); - assert.equal(roundWithOneDecimal(10.3333), 10.3); + assert.strictEqual(roundWithOneDecimal(10), 10); + assert.strictEqual(roundWithOneDecimal(10.3), 10.3); + assert.strictEqual(roundWithOneDecimal(10.3333), 10.3); }); }); diff --git a/test-mocha/util/generate-brands-url-spec.ts b/test-mocha/util/generate-brands-url-spec.ts index 6d3c48edda..169c0e0ca8 100644 --- a/test-mocha/util/generate-brands-url-spec.ts +++ b/test-mocha/util/generate-brands-url-spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import { assert } from "chai"; import { brandsUrl } from "../../src/util/brands-url"; describe("Generate brands Url", function () { diff --git a/test-mocha/util/generate-documentation-url.spec.ts b/test-mocha/util/generate-documentation-url.spec.ts index 9e34e61448..1eb5ed51f0 100644 --- a/test-mocha/util/generate-documentation-url.spec.ts +++ b/test-mocha/util/generate-documentation-url.spec.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import { assert } from "chai"; import { documentationUrl } from "../../src/util/documentation-url"; describe("Generate documentation URL", function () { diff --git a/yarn.lock b/yarn.lock index 6a2a655cf3..adc60c3e65 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2550,29 +2550,28 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@sinonjs/commons@^1", "@sinonjs/commons@^1.0.2", "@sinonjs/commons@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.4.0.tgz#7b3ec2d96af481d7a0321252e7b1c94724ec5a78" - integrity sha512-9jHK3YF/8HtJ9wCAbG+j8cD0i0+ATS9A7gXFqS36TblLPNy6rEEc+SB0imo91eCboGaBYGV/MT1/br/J+EE7Tw== +"@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.3": + version "1.8.3" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" + integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== dependencies: type-detect "4.0.8" -"@sinonjs/formatio@^3.1.0", "@sinonjs/formatio@^3.2.1": - version "3.2.1" - resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-3.2.1.tgz#52310f2f9bcbc67bdac18c94ad4901b95fde267e" - integrity sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ== +"@sinonjs/fake-timers@^7.0.4", "@sinonjs/fake-timers@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-7.1.0.tgz#8f13af27d842cbf51ad4502e05562fe9391d084e" + integrity sha512-hAEzXi6Wbvlb67NnGMGSNOeAflLVnMa4yliPU/ty1qjgW/vAletH15/v/esJwASSIA0YlIyjnloenFbEZc9q9A== dependencies: - "@sinonjs/commons" "^1" - "@sinonjs/samsam" "^3.1.0" + "@sinonjs/commons" "^1.7.0" -"@sinonjs/samsam@^3.1.0", "@sinonjs/samsam@^3.3.1": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-3.3.1.tgz#e88c53fbd9d91ad9f0f2b0140c16c7c107fe0d07" - integrity sha512-wRSfmyd81swH0hA1bxJZJ57xr22kC07a1N4zuIL47yTS04bDk6AoCkczcqHEjcRPmJ+FruGJ9WBQiJwMtIElFw== +"@sinonjs/samsam@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-6.0.2.tgz#a0117d823260f282c04bff5f8704bdc2ac6910bb" + integrity sha512-jxPRPp9n93ci7b8hMfJOFDPRLFYadN6FSpeROFTR4UNF4i5b+EK6m4QXPO46BDhFgRy1JuS87zAnFOzCUwMJcQ== dependencies: - "@sinonjs/commons" "^1.0.2" - array-from "^2.1.1" - lodash "^4.17.11" + "@sinonjs/commons" "^1.6.0" + lodash.get "^4.4.2" + type-detect "^4.0.8" "@sinonjs/text-encoding@^0.7.1": version "0.7.1" @@ -2609,10 +2608,10 @@ "@types/connect" "*" "@types/node" "*" -"@types/chai@^4.1.7": - version "4.1.7" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.7.tgz#1b8e33b61a8c09cbe1f85133071baa0dbf9fa71a" - integrity sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA== +"@types/chai@^4.2.18": + version "4.2.18" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.18.tgz#0c8e298dbff8205e2266606c1ea5fbdba29b46e4" + integrity sha512-rS27+EkB/RE1Iz3u0XtVL5q36MGDWbgYe7zWiodyKNUnthxY0rukK5V36eiUCtCisB7NN8zKYH6DO2M37qxFEQ== "@types/chrome@*": version "0.0.119" @@ -2849,10 +2848,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/mocha@^7.0.2": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-7.0.2.tgz#b17f16cf933597e10d6d78eae3251e692ce8b0ce" - integrity sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w== +"@types/mocha@^8.2.2": + version "8.2.2" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-8.2.2.tgz#91daa226eb8c2ff261e6a8cbf8c7304641e095e0" + integrity sha512-Lwh0lzzqT5Pqh6z61P3c3P5nm6fzQK/MMHl9UKeneAeInVflBSz1O2EkX6gM6xfJd7FBXBY5purtLx7fUiZ7Hw== "@types/node@*": version "15.0.1" @@ -2911,6 +2910,13 @@ "@types/mime" "*" "@types/node" "*" +"@types/sinon@^10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-10.0.0.tgz#eecc3847af03d45ffe53d55aaaaf6ecb28b5e584" + integrity sha512-jDZ55oCKxqlDmoTBBbBBEx+N8ZraUVhggMZ9T5t+6/Dh8/4NiOjSUfpLrPiEwxQDlAe3wpAkoXhWvE6LibtsMQ== + dependencies: + "@sinonjs/fake-timers" "^7.0.4" + "@types/sortablejs@^1.10.6": version "1.10.6" resolved "https://registry.yarnpkg.com/@types/sortablejs/-/sortablejs-1.10.6.tgz#98725ae08f1dfe28b8da0fdf302c417f5ff043c0" @@ -3003,6 +3009,11 @@ "@typescript-eslint/types" "4.22.0" eslint-visitor-keys "^2.0.0" +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + "@vaadin/vaadin-button@^2.1.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@vaadin/vaadin-button/-/vaadin-button-2.2.1.tgz#129b585d176053289b13451767495727b2201763" @@ -3645,10 +3656,10 @@ ansi-align@^2.0.0: dependencies: string-width "^2.0.0" -ansi-colors@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" - integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== +ansi-colors@4.1.1, ansi-colors@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== ansi-colors@^1.0.1: version "1.1.0" @@ -3662,11 +3673,6 @@ ansi-colors@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - ansi-escapes@^4.2.1: version "4.3.1" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" @@ -3912,11 +3918,6 @@ array-flatten@^2.1.0: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099" integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== -array-from@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/array-from/-/array-from-2.1.1.tgz#cfe9d8c26628b9dc5aecc62a9f5d8f1f352c1195" - integrity sha1-z+nYwmYoudxa7MYqn12PHzUsEZU= - array-includes@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" @@ -4582,7 +4583,7 @@ camelcase@^5.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -camelcase@^6.2.0: +camelcase@^6.0.0, camelcase@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== @@ -4592,16 +4593,16 @@ caniuse-lite@^1.0.30001214: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001219.tgz#5bfa5d0519f41f993618bd318f606a4c4c16156b" integrity sha512-c0yixVG4v9KBc/tQ2rlbB3A/bgBFRvl8h8M4IeUbqCca4gsiCfvtaheUssbnux/Mb66Vjz7x8yYjDgYcNQOhyQ== -chai@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" - integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== +chai@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" + integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== dependencies: assertion-error "^1.1.0" check-error "^1.0.2" deep-eql "^3.0.1" get-func-name "^2.0.0" - pathval "^1.1.0" + pathval "^1.1.1" type-detect "^4.0.5" chalk@2.4.1: @@ -4706,10 +4707,10 @@ check-error@^1.0.2: resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= -chokidar@3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" - integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== +chokidar@3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" + integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== dependencies: anymatch "~3.1.1" braces "~3.0.2" @@ -4717,9 +4718,9 @@ chokidar@3.3.0: is-binary-path "~2.1.0" is-glob "~4.0.1" normalize-path "~3.0.0" - readdirp "~3.2.0" + readdirp "~3.5.0" optionalDependencies: - fsevents "~2.1.1" + fsevents "~2.3.1" chokidar@^1.6.0: version "1.7.0" @@ -4902,6 +4903,15 @@ cliui@^6.0.0: strip-ansi "^6.0.0" wrap-ansi "^6.2.0" +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + clone-buffer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" @@ -5410,7 +5420,14 @@ debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: dependencies: ms "2.0.0" -debug@3.2.6, debug@^3.1.0, debug@^3.1.1: +debug@4.3.1, debug@^4.1.0, debug@^4.2.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + dependencies: + ms "2.1.2" + +debug@^3.1.0, debug@^3.1.1: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== @@ -5431,13 +5448,6 @@ debug@^4.0.1, debug@^4.1.1: dependencies: ms "^2.1.1" -debug@^4.1.0, debug@^4.2.0: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" @@ -5450,6 +5460,11 @@ decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -5640,7 +5655,12 @@ didyoumean2@4.1.0: leven "^3.1.0" lodash.deburr "^4.1.0" -diff@3.5.0, diff@^3.1.0, diff@^3.5.0: +diff@5.0.0, diff@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +diff@^3.1.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== @@ -5844,23 +5864,6 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.0-next.1, es-abstract@^1.17.5: - version "1.17.5" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.5.tgz#d8c9d1d66c8981fb9200e2251d799eee92774ae9" - integrity sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.1.5" - is-regex "^1.0.5" - object-inspect "^1.7.0" - object-keys "^1.1.1" - object.assign "^4.1.0" - string.prototype.trimleft "^2.1.1" - string.prototype.trimright "^2.1.1" - es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2: version "1.18.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" @@ -5953,7 +5956,12 @@ escape-html@^1.0.3, escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -6709,12 +6717,13 @@ find-root@^1.1.0: resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== -find-up@3.0.0, find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== dependencies: - locate-path "^3.0.0" + locate-path "^6.0.0" + path-exists "^4.0.0" find-up@^1.0.0: version "1.1.2" @@ -6731,6 +6740,13 @@ find-up@^2.0.0, find-up@^2.1.0: dependencies: locate-path "^2.0.0" +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" @@ -6792,12 +6808,10 @@ flat-cache@^3.0.4: flatted "^3.1.0" rimraf "^3.0.2" -flat@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2" - integrity sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw== - dependencies: - is-buffer "~2.0.3" +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== flatted@^2.0.0: version "2.0.0" @@ -6913,11 +6927,6 @@ fsevents@^1.0.0, fsevents@^1.2.7: nan "^2.12.1" node-pre-gyp "^0.12.0" -fsevents@~2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - fsevents@~2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.2.tgz#4c0a1fb34bc68e543b4b82a9ec392bfbda840805" @@ -6967,7 +6976,7 @@ get-caller-file@^1.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== -get-caller-file@^2.0.1: +get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -7120,7 +7129,19 @@ glob2base@^0.0.12: dependencies: find-index "^0.1.1" -glob@7.1.3, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: +glob@7.1.6, glob@^7.1.6: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== @@ -7144,18 +7165,6 @@ glob@^7.0.5: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.6: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - global-modules@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" @@ -7919,21 +7928,11 @@ is-buffer@^1.1.5: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" - integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== - is-callable@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== -is-callable@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" - integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== - is-callable@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" @@ -8164,6 +8163,11 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -8198,13 +8202,6 @@ is-reference@^1.1.2: dependencies: "@types/estree" "0.0.39" -is-regex@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" - integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== - dependencies: - has "^1.0.3" - is-regex@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.2.tgz#81c8ebde4db142f2cf1c53fc86d6a45788266251" @@ -8362,7 +8359,14 @@ js-tokens@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@3.13.1, js-yaml@^3.13.0, js-yaml@^3.13.1: +js-yaml@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.0.0.tgz#f426bc0ff4b4051926cd588c71113183409a121f" + integrity sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q== + dependencies: + argparse "^2.0.1" + +js-yaml@^3.13.0, js-yaml@^3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -8825,6 +8829,13 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + lodash._escapehtmlchar@~2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/lodash._escapehtmlchar/-/lodash._escapehtmlchar-2.4.1.tgz#df67c3bb6b7e8e1e831ab48bfa0795b92afe899d" @@ -8919,6 +8930,11 @@ lodash.flatten@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= +lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= + lodash.isobject@~2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/lodash.isobject/-/lodash.isobject-2.4.1.tgz#5a2e47fe69953f1ee631a7eba1fe64d2d06558f5" @@ -8998,12 +9014,12 @@ lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== +log-symbols@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920" + integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA== dependencies: - chalk "^2.4.2" + chalk "^4.0.0" log-symbols@^1.0.0: version "1.0.2" @@ -9035,16 +9051,6 @@ loglevel@^1.6.8: resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.0.tgz#728166855a740d59d38db01cf46f042caa041bb0" integrity sha512-i2sY04nal5jDcagM3FMfG++T69GEEM8CYuOfeOIvmXzOIcwE9a/CJPR0MFM97pYMj/u10lzz7/zd7+qwhrBTqQ== -lolex@^2.3.2: - version "2.7.5" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.7.5.tgz#113001d56bfc7e02d56e36291cc5c413d1aa0733" - integrity sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q== - -lolex@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-3.1.0.tgz#1a7feb2fefd75b3e3a7f79f0e110d9476e294434" - integrity sha512-zFo5MgCJ0rZ7gQg69S4pqBsLURbFw11X68C18OcJjJQbqaXm2NoTrGl1IMM3TIz0/BnN1tIs2tzmmqvCsOMMjw== - loud-rejection@^1.0.0: version "1.6.0" resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" @@ -9413,13 +9419,6 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@0.5.5, mkdirp@^0.5.3, mkdirp@^0.5.5: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -9427,35 +9426,43 @@ mkdirp@^0.5.0, mkdirp@^0.5.1: dependencies: minimist "0.0.8" -mocha@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604" - integrity sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ== +mkdirp@^0.5.3, mkdirp@^0.5.5: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: - ansi-colors "3.2.3" + minimist "^1.2.5" + +mocha@^8.4.0: + version "8.4.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.4.0.tgz#677be88bf15980a3cae03a73e10a0fc3997f0cff" + integrity sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" browser-stdout "1.3.1" - chokidar "3.3.0" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" + chokidar "3.5.1" + debug "4.3.1" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.1.6" growl "1.10.5" he "1.2.0" - js-yaml "3.13.1" - log-symbols "3.0.0" + js-yaml "4.0.0" + log-symbols "4.0.0" minimatch "3.0.4" - mkdirp "0.5.5" - ms "2.1.1" - node-environment-flags "1.0.6" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" + ms "2.1.3" + nanoid "3.1.20" + serialize-javascript "5.0.1" + strip-json-comments "3.1.1" + supports-color "8.1.1" + which "2.0.2" wide-align "1.1.3" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" + workerpool "6.1.0" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" moment@^2.10.2: version "2.24.0" @@ -9477,7 +9484,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.1.1: +ms@2.1.3, ms@^2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -9526,6 +9533,11 @@ nan@^2.12.1: resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" integrity sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw== +nanoid@3.1.20: + version "3.1.20" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788" + integrity sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw== + nanoid@^3.0.1: version "3.1.9" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.9.tgz#1f148669c70bb2072dc5af0666e46edb6cd31fb2" @@ -9587,15 +9599,15 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -nise@^1.4.10: - version "1.4.10" - resolved "https://registry.yarnpkg.com/nise/-/nise-1.4.10.tgz#ae46a09a26436fae91a38a60919356ae6db143b6" - integrity sha512-sa0RRbj53dovjc7wombHmVli9ZihXbXCQ2uH3TNm03DyvOSIQbxg+pbqDKrk2oxMK1rtLGVlKxcB9rrc6X5YjA== +nise@^5.0.4: + version "5.1.0" + resolved "https://registry.yarnpkg.com/nise/-/nise-5.1.0.tgz#713ef3ed138252daef20ec035ab62b7a28be645c" + integrity sha512-W5WlHu+wvo3PaKLsJJkgPup2LrsXCcm7AWwyNZkUnn5rwPkuPBi3Iwk5SQtN0mv+K65k7nKKjwNQ30wg3wLAQQ== dependencies: - "@sinonjs/formatio" "^3.1.0" + "@sinonjs/commons" "^1.7.0" + "@sinonjs/fake-timers" "^7.0.4" "@sinonjs/text-encoding" "^0.7.1" just-extend "^4.0.2" - lolex "^2.3.2" path-to-regexp "^1.7.0" no-case@^2.2.0: @@ -9605,14 +9617,6 @@ no-case@^2.2.0: dependencies: lower-case "^1.1.1" -node-environment-flags@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" - integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - node-forge@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3" @@ -9779,11 +9783,6 @@ object-hash@^2.0.3: resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.0.3.tgz#d12db044e03cd2ca3d77c0570d87225b02e1e6ea" integrity sha512-JPKn0GMu+Fa3zt3Bmr66JhokJU5BaNBIh4ZeTlaCBzrBsOeXzwcKKAK1tbLiPKgvwmPXsDvvLHoWh5Bm7ofIYg== -object-inspect@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" - integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== - object-inspect@^1.9.0: version "1.10.2" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.2.tgz#b6385a3e2b7cae0b5eafcf90cddf85d128767f30" @@ -9801,7 +9800,7 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@4.1.0, object.assign@^4.0.4: +object.assign@^4.0.4: version "4.1.0" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== @@ -9841,14 +9840,6 @@ object.entries@^1.1.2: es-abstract "^1.18.0-next.1" has "^1.0.3" -object.getownpropertydescriptors@^2.0.3: - version "2.1.0" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" - integrity sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - object.map@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" @@ -10060,7 +10051,7 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^3.1.0: +p-limit@^3.0.2, p-limit@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -10088,6 +10079,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.0.0.tgz#be18c5a5adeb8e156460651421aceca56c213a50" @@ -10369,10 +10367,10 @@ pathseg@^1.2.0: resolved "https://registry.yarnpkg.com/pathseg/-/pathseg-1.2.0.tgz#22af051e28037671e7799e296fe96c5dcbe53acd" integrity sha512-+pQS7lTaoVIXhaCW7R3Wd/165APzZHWzYVqe7dxzdupxQwebgpBaCmf0/XZwmoA/rkDq3qvzO0qv4d5oFVrBRw== -pathval@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" - integrity sha1-uULm1L3mUwBe9rcTYd74cn0GReA= +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== pbkdf2@^3.0.3: version "3.1.1" @@ -10857,13 +10855,6 @@ readdirp@^2.0.0, readdirp@^2.2.1: micromatch "^3.1.10" readable-stream "^2.0.2" -readdirp@~3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" - integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== - dependencies: - picomatch "^2.0.4" - readdirp@~3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" @@ -11430,7 +11421,7 @@ semver@7.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@^5.5.0, semver@^5.7.0, semver@^5.7.1: +semver@^5.5.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -11471,6 +11462,13 @@ send@0.17.1: range-parser "~1.2.1" statuses "~1.5.0" +serialize-javascript@5.0.1, serialize-javascript@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4" + integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA== + dependencies: + randombytes "^2.1.0" + serialize-javascript@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" @@ -11483,13 +11481,6 @@ serialize-javascript@^4.0.0: dependencies: randombytes "^2.1.0" -serialize-javascript@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4" - integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA== - dependencies: - randombytes "^2.1.0" - serve-handler@6.1.2: version "6.1.2" resolved "https://registry.yarnpkg.com/serve-handler/-/serve-handler-6.1.2.tgz#f05b0421a313fff2d257838cba00cbcc512cd2b6" @@ -11636,18 +11627,17 @@ signal-exit@^3.0.3: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== -sinon@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-7.3.1.tgz#e8276522104e6c08d1cb52a907270b0e316655c4" - integrity sha512-eQKMaeWovtOtYe2xThEvaHmmxf870Di+bim10c3ZPrL5bZhLGtu8cz+rOBTFz0CwBV4Q/7dYwZiqZbGVLZ+vjQ== +sinon@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/sinon/-/sinon-11.0.0.tgz#e45bae910425d3e52f7eebcb34b47ad42cc7eb57" + integrity sha512-iLdNOhEDVHf1GJwWIqiFQe7QqYsqKDSYUUmmb180WCu3l0Cz+CKBxsiSa8P5fTJvTp1lwE77uK/aHzUuJKr1cA== dependencies: - "@sinonjs/commons" "^1.4.0" - "@sinonjs/formatio" "^3.2.1" - "@sinonjs/samsam" "^3.3.1" - diff "^3.5.0" - lolex "^3.1.0" - nise "^1.4.10" - supports-color "^5.5.0" + "@sinonjs/commons" "^1.8.3" + "@sinonjs/fake-timers" "^7.1.0" + "@sinonjs/samsam" "^6.0.2" + diff "^5.0.0" + nise "^5.0.4" + supports-color "^8.1.1" slash@^2.0.0: version "2.0.0" @@ -11966,14 +11956,6 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string.prototype.trimend@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913" - integrity sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - string.prototype.trimend@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" @@ -11982,32 +11964,6 @@ string.prototype.trimend@^1.0.4: call-bind "^1.0.2" define-properties "^1.1.3" -string.prototype.trimleft@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz#4408aa2e5d6ddd0c9a80739b087fbc067c03b3cc" - integrity sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - string.prototype.trimstart "^1.0.0" - -string.prototype.trimright@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz#c76f1cef30f21bbad8afeb8db1511496cfb0f2a3" - integrity sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - string.prototype.trimend "^1.0.0" - -string.prototype.trimstart@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" - integrity sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" - string.prototype.trimstart@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" @@ -12120,20 +12076,20 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@2.0.1, strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== strip-json-comments@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= style-mod@^4.0.0: version "4.0.0" @@ -12152,12 +12108,12 @@ superstruct@^0.15.2: resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.2.tgz#ab7fb84c455a9d7da84c11cfd82c85a4fee9dfff" integrity sha512-OsJI8lv6/PsInwCf4ultejmsJYseYshKhkcbDendqNwj3MeGXENajl3ujMGMU4FDDSSeJTOwFn9T6pnfsS9DYA== -supports-color@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" - integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== +supports-color@8.1.1, supports-color@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: - has-flag "^3.0.0" + has-flag "^4.0.0" supports-color@^0.2.0: version "0.2.0" @@ -12169,7 +12125,7 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -supports-color@^5.3.0, supports-color@^5.5.0: +supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== @@ -12515,10 +12471,10 @@ ts-lit-plugin@^1.2.1: dependencies: lit-analyzer "1.2.1" -ts-mocha@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-7.0.0.tgz#f1549b48b46f53d7ae1dccbb26313c7879acb190" - integrity sha512-7WfkQw1W6JZXG5m4E1w2e945uWzBoZqmnOHvpMu0v+zvyKLdUQeTtRMfcQsVEKsUnYL6nTyH4okRt2PZucmFXQ== +ts-mocha@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-8.0.0.tgz#962d0fa12eeb6468aa1a6b594bb3bbc818da3ef0" + integrity sha512-Kou1yxTlubLnD5C3unlCVO7nh0HERTezjoVhVw/M5S1SqoUec0WgllQvPk3vzPMc6by8m6xD1uR1yRf8lnVUbA== dependencies: ts-node "7.0.1" optionalDependencies: @@ -12622,7 +12578,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5: +type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== @@ -13321,20 +13277,20 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@1.3.1, which@^1.2.14, which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -which@^2.0.1: +which@2.0.2, which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== dependencies: isexe "^2.0.0" +which@^1.2.14, which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + wicg-inert@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/wicg-inert/-/wicg-inert-3.0.0.tgz#4f5797172fbf7ff01effd3839b52872e35d3cba2" @@ -13527,6 +13483,11 @@ workbox-window@^6.1.5: dependencies: workbox-core "^6.1.5" +workerpool@6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.0.tgz#a8e038b4c94569596852de7a8ea4228eefdeb37b" + integrity sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg== + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -13647,6 +13608,11 @@ y18n@^4.0.0: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -13667,7 +13633,12 @@ yaml@^1.10.0: resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yargs-parser@13.1.2, yargs-parser@^13.1.2: +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^13.1.2: version "13.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== @@ -13683,6 +13654,11 @@ yargs-parser@^18.1.1, yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^20.2.2: + version "20.2.7" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a" + integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw== + yargs-parser@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" @@ -13690,16 +13666,30 @@ yargs-parser@^5.0.0: dependencies: camelcase "^3.0.0" -yargs-unparser@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" - integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== dependencies: - flat "^4.1.0" - lodash "^4.17.15" - yargs "^13.3.0" + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" -yargs@13.3.2, yargs@^13.2.4, yargs@^13.3.0, yargs@^13.3.2: +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yargs@^13.2.4, yargs@^13.3.2: version "13.3.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== From c4a88997803cd6424c997f6d329b96cb00a08c72 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 26 May 2021 10:22:38 +0200 Subject: [PATCH 105/117] Bump idb-keyval (#9248) https://github.com/jakearchibald/idb-keyval#updating-from-3x --- package.json | 2 +- src/data/iconsets.ts | 45 ++++++++++++++++++++++---------------------- yarn.lock | 8 ++++---- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 269e4e052e..2213f328e4 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "google-timezones-json": "^1.0.2", "hls.js": "^1.0.3", "home-assistant-js-websocket": "^5.10.0", - "idb-keyval": "^3.2.0", + "idb-keyval": "^5.0.5", "intl-messageformat": "^9.6.13", "js-yaml": "^4.1.0", "leaflet": "^1.7.1", diff --git a/src/data/iconsets.ts b/src/data/iconsets.ts index 2e6df41914..8b92ddbfa3 100644 --- a/src/data/iconsets.ts +++ b/src/data/iconsets.ts @@ -1,4 +1,4 @@ -import { clear, get, set, Store } from "idb-keyval"; +import { clear, get, set, createStore } from "idb-keyval"; import { iconMetadata } from "../resources/icon-metadata"; import { IconMeta } from "../types"; @@ -10,11 +10,11 @@ export interface Chunks { [key: string]: Promise; } -export const iconStore = new Store("hass-icon-db", "mdi-icon-store"); +export const iconStore = createStore("hass-icon-db", "mdi-icon-store"); export const MDI_PREFIXES = ["mdi", "hass", "hassio", "hademo"]; -let toRead: Array<[string, (string) => void, () => void]> = []; +let toRead: Array<[string, (iconPath: string) => void, () => void]> = []; // Queue up as many icon fetches in 1 transaction export const getIcon = (iconName: string) => @@ -25,15 +25,13 @@ export const getIcon = (iconName: string) => return; } - const results: Array<[(string) => void, IDBRequest]> = []; + const results: Array<[(iconPath: string) => void, IDBRequest]> = []; - iconStore - ._withIDBStore("readonly", (store) => { - for (const [iconName_, resolve_] of toRead) { - results.push([resolve_, store.get(iconName_)]); - } - toRead = []; - }) + iconStore("readonly", (store) => { + for (const [iconName_, resolve_] of toRead) { + results.push([resolve_, store.get(iconName_)]); + } + }) .then(() => { for (const [resolve_, request] of results) { resolve_(request.result); @@ -44,11 +42,13 @@ export const getIcon = (iconName: string) => for (const [, , reject_] of toRead) { reject_(); } + }) + .finally(() => { toRead = []; }); }); -export const findIconChunk = (icon): string => { +export const findIconChunk = (icon: string): string => { let lastChunk: IconMeta; for (const chunk of iconMetadata.parts) { if (chunk.start !== undefined && icon < chunk.start) { @@ -63,7 +63,7 @@ export const writeCache = async (chunks: Chunks) => { const keys = Object.keys(chunks); const iconsSets: Icons[] = await Promise.all(Object.values(chunks)); // We do a batch opening the store just once, for (considerable) performance - iconStore._withIDBStore("readwrite", (store) => { + iconStore("readwrite", (store) => { iconsSets.forEach((icons, idx) => { Object.entries(icons).forEach(([name, path]) => { store.put(path, name); @@ -73,14 +73,13 @@ export const writeCache = async (chunks: Chunks) => { }); }; -export const checkCacheVersion = () => { - get("_version", iconStore).then((version) => { - if (!version) { - set("_version", iconMetadata.version, iconStore); - } else if (version !== iconMetadata.version) { - clear(iconStore).then(() => - set("_version", iconMetadata.version, iconStore) - ); - } - }); +export const checkCacheVersion = async () => { + const version = await get("_version", iconStore); + + if (!version) { + set("_version", iconMetadata.version, iconStore); + } else if (version !== iconMetadata.version) { + await clear(iconStore); + set("_version", iconMetadata.version, iconStore); + } }; diff --git a/yarn.lock b/yarn.lock index adc60c3e65..c0dfa50c46 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7664,10 +7664,10 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: dependencies: safer-buffer ">= 2.1.2 < 3" -idb-keyval@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/idb-keyval/-/idb-keyval-3.2.0.tgz#cbbf354deb5684b6cdc84376294fc05932845bd6" - integrity sha512-slx8Q6oywCCSfKgPgL0sEsXtPVnSbTLWpyiDcu6msHOyKOLari1TD1qocXVCft80umnkk3/Qqh3lwoFt8T/BPQ== +idb-keyval@^5.0.5: + version "5.0.5" + resolved "https://registry.yarnpkg.com/idb-keyval/-/idb-keyval-5.0.5.tgz#1b02984dcf42ad4aa290bf9f10935b485419df34" + integrity sha512-cqi65rrjhgPExI9vmSU7VcYEbHCUfIBY+9YUWxyr0PyGizptFgGFnvZQ0w+tqOXk1lUcGCZGVLfabf7QnR2S0g== ieee754@^1.1.4: version "1.1.13" From fa9c6a765ab879c25e947b01dec8c4352275d134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 26 May 2021 11:10:27 +0200 Subject: [PATCH 106/117] Replace closing with closed in dialogs (#9257) --- hassio/src/dialogs/registries/dialog-hassio-registries.ts | 2 +- .../src/dialogs/repositories/dialog-hassio-repositories.ts | 2 +- hassio/src/dialogs/snapshot/dialog-hassio-create-snapshot.ts | 3 ++- hassio/src/dialogs/snapshot/dialog-hassio-snapshot.ts | 5 +++-- src/dialogs/generic/dialog-box.ts | 2 +- .../mqtt/dialog-mqtt-device-debug-info.ts | 2 +- src/panels/config/helpers/dialog-helper-detail.ts | 2 +- .../integration-panels/ozw/dialog-ozw-refresh-node.ts | 2 +- .../integration-panels/zha/dialog-zha-cluster.ts | 2 +- .../integration-panels/zha/dialog-zha-device-zigbee-info.ts | 2 +- .../lovelace/dashboards/dialog-lovelace-dashboard-detail.ts | 2 +- .../lovelace/resources/dialog-lovelace-resource-detail.ts | 2 +- src/panels/config/users/dialog-add-user.ts | 2 +- src/panels/config/users/dialog-user-detail.ts | 2 +- src/panels/profile/dialog-ha-mfa-module-setup-flow.ts | 2 +- 15 files changed, 18 insertions(+), 16 deletions(-) diff --git a/hassio/src/dialogs/registries/dialog-hassio-registries.ts b/hassio/src/dialogs/registries/dialog-hassio-registries.ts index 80b7e32993..6cd738119a 100644 --- a/hassio/src/dialogs/registries/dialog-hassio-registries.ts +++ b/hassio/src/dialogs/registries/dialog-hassio-registries.ts @@ -45,7 +45,7 @@ class HassioRegistriesDialog extends LitElement { return html` ${this._restoringSnapshot @@ -88,7 +89,7 @@ class HassioSnapshotDialog fixed slot="primaryAction" @action=${this._handleMenuAction} - @closing=${(ev: Event) => ev.stopPropagation()} + @closed=${(ev: Event) => ev.stopPropagation()} > diff --git a/src/dialogs/generic/dialog-box.ts b/src/dialogs/generic/dialog-box.ts index e7e4bee7b2..4fc1c09cde 100644 --- a/src/dialogs/generic/dialog-box.ts +++ b/src/dialogs/generic/dialog-box.ts @@ -49,7 +49,7 @@ class DialogBox extends LitElement { open ?scrimClickAction=${confirmPrompt} ?escapeKeyAction=${confirmPrompt} - @closing=${this._dialogClosed} + @closed=${this._dialogClosed} defaultAction="ignore" .heading=${this._params.title ? this._params.title diff --git a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts index f97427a067..0208bbbd7a 100644 --- a/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts +++ b/src/panels/config/devices/device-detail/integration-elements/mqtt/dialog-mqtt-device-debug-info.ts @@ -49,7 +49,7 @@ class DialogMQTTDeviceDebugInfo extends LitElement { return html`
${this._errorMessage From 3ef2912b60485b0dd1302b8d6a14c573eeda1567 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 26 May 2021 11:19:09 +0200 Subject: [PATCH 107/117] Fix typo in translation key --- src/state/disconnect-toast-mixin.ts | 2 +- src/translations/en.json | 2 +- translations/frontend/bg.json | 2 +- translations/frontend/ca.json | 2 +- translations/frontend/cs.json | 2 +- translations/frontend/da.json | 2 +- translations/frontend/de.json | 2 +- translations/frontend/en.json | 2 +- translations/frontend/es-419.json | 2 +- translations/frontend/es.json | 2 +- translations/frontend/et.json | 2 +- translations/frontend/fr.json | 2 +- translations/frontend/he.json | 2 +- translations/frontend/id.json | 2 +- translations/frontend/it.json | 2 +- translations/frontend/ja.json | 2 +- translations/frontend/ko.json | 2 +- translations/frontend/nb.json | 14 ++++++++++---- translations/frontend/nl.json | 2 +- translations/frontend/pl.json | 2 +- translations/frontend/ru.json | 5 +++-- translations/frontend/zh-Hans.json | 2 +- translations/frontend/zh-Hant.json | 2 +- 23 files changed, 34 insertions(+), 27 deletions(-) diff --git a/src/state/disconnect-toast-mixin.ts b/src/state/disconnect-toast-mixin.ts index 4e09213bc9..a222ae7894 100644 --- a/src/state/disconnect-toast-mixin.ts +++ b/src/state/disconnect-toast-mixin.ts @@ -112,7 +112,7 @@ export default >(superClass: T) => showToast(this, { message: this.hass!.localize( - "ui.notification_toast.intergration_starting", + "ui.notification_toast.integration_starting", "integration", domainToName(this.hass!.localize, integration) ) || diff --git a/src/translations/en.json b/src/translations/en.json index 79f039cfe5..6a700c664a 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -873,7 +873,7 @@ "started": "Home Assistant has started!", "starting": "Home Assistant is starting, not everything will be available until it is finished.", "wrapping_up_startup": "Wrapping up startup, not everything will be available until it is finished.", - "intergration_starting": "Starting {integration}, not everything will be available until it is finished.", + "integration_starting": "Starting {integration}, not everything will be available until it is finished.", "triggered": "Triggered {name}", "dismiss": "Dismiss" }, diff --git a/translations/frontend/bg.json b/translations/frontend/bg.json index 12a6b9be67..dbc8595145 100644 --- a/translations/frontend/bg.json +++ b/translations/frontend/bg.json @@ -1160,7 +1160,7 @@ }, "notification_toast": { "connection_lost": "Връзката е прекъсната. Повторно свързване...", - "intergration_starting": "Стартиране на {integration}, не всичко ще бъде налично, докато процесът не приключи.", + "integration_starting": "Стартиране на {integration}, не всичко ще бъде налично, докато процесът не приключи.", "service_call_failed": "Неуспешно повикване на услуга {service}.", "started": "Home Assistant стартира успешно!", "starting": "Home Assistant стартира, не всичко ще е на разположение, докато не приключи.", diff --git a/translations/frontend/ca.json b/translations/frontend/ca.json index 54f2d6856f..a62762e1bb 100644 --- a/translations/frontend/ca.json +++ b/translations/frontend/ca.json @@ -1261,7 +1261,7 @@ "notification_toast": { "connection_lost": "Connexió perduda. Tornant a connectar...", "dismiss": "Omet", - "intergration_starting": "Iniciant {integration}, no estarà tot disponible fins que acabi.", + "integration_starting": "Iniciant {integration}, no estarà tot disponible fins que acabi.", "service_call_failed": "Ha fallat la crida al servei {service}.", "started": "Home Assistant s'ha iniciat!", "starting": "Home Assistant està iniciant-se, no estarà tot disponible fins que acabi", diff --git a/translations/frontend/cs.json b/translations/frontend/cs.json index 95301fe50d..9278395619 100644 --- a/translations/frontend/cs.json +++ b/translations/frontend/cs.json @@ -1261,7 +1261,7 @@ "notification_toast": { "connection_lost": "Připojení bylo ztraceno. Připojuji se znovu...", "dismiss": "Zavřít", - "intergration_starting": "Integrace {integration} se spouští - dokud nebude spuštění dokončeno, nemusí být vše k dispozici.", + "integration_starting": "Integrace {integration} se spouští - dokud nebude spuštění dokončeno, nemusí být vše k dispozici.", "service_call_failed": "Službu {service} se nepodařilo zavolat.", "started": "Home Assistant je spuštěn!", "starting": "Home Assistant se spouští, ne všechno bude k dispozici, dokud nebude spuštění dokončeno.", diff --git a/translations/frontend/da.json b/translations/frontend/da.json index 0d19e2db93..768c77d9ff 100644 --- a/translations/frontend/da.json +++ b/translations/frontend/da.json @@ -1261,7 +1261,7 @@ "notification_toast": { "connection_lost": "Forbindelse afbrudt. Opretter forbindelse igen...", "dismiss": "Afvis", - "intergration_starting": "Starter {integration}, ikke alt vil være tilgængeligt, før det er færdigt.", + "integration_starting": "Starter {integration}, ikke alt vil være tilgængeligt, før det er færdigt.", "service_call_failed": "Kunne ikke kalde tjenesten {service}.", "started": "Home Assistant er startet!", "starting": "Home Assistant starter. Nogle funktioner er måske ikke tilgængelige før opstarten er færdig.", diff --git a/translations/frontend/de.json b/translations/frontend/de.json index 42ef8f7bc5..32294da3bd 100644 --- a/translations/frontend/de.json +++ b/translations/frontend/de.json @@ -1261,7 +1261,7 @@ "notification_toast": { "connection_lost": "Verbindung getrennt. Verbinde erneut...", "dismiss": "Ausblenden", - "intergration_starting": "Starte {integration}. Währenddessen ist noch nicht alles verfügbar.", + "integration_starting": "Starte {integration}. Währenddessen ist noch nicht alles verfügbar.", "service_call_failed": "Fehler beim Aufrufen des Diensts {service}.", "started": "Home Assistant wurde vollständig gestartet!", "starting": "Home Assistant startet. Währenddessen ist noch nicht alles verfügbar.", diff --git a/translations/frontend/en.json b/translations/frontend/en.json index 4c0f063244..7f87c48dce 100644 --- a/translations/frontend/en.json +++ b/translations/frontend/en.json @@ -1265,7 +1265,7 @@ "notification_toast": { "connection_lost": "Connection lost. Reconnecting...", "dismiss": "Dismiss", - "intergration_starting": "Starting {integration}, not everything will be available until it is finished.", + "integration_starting": "Starting {integration}, not everything will be available until it is finished.", "service_call_failed": "Failed to call service {service}.", "started": "Home Assistant has started!", "starting": "Home Assistant is starting, not everything will be available until it is finished.", diff --git a/translations/frontend/es-419.json b/translations/frontend/es-419.json index 0c22036f4c..7745b01ec5 100644 --- a/translations/frontend/es-419.json +++ b/translations/frontend/es-419.json @@ -1239,7 +1239,7 @@ "notification_toast": { "connection_lost": "Conexión perdida. Reconectando...", "dismiss": "Descartar", - "intergration_starting": "Iniciando {integration}, no todo estará totalmente disponible hasta que finalice.", + "integration_starting": "Iniciando {integration}, no todo estará totalmente disponible hasta que finalice.", "service_call_failed": "Error al llamar al servicio {service} .", "started": "¡Home Assistant ha iniciado!", "starting": "Home Assistant está iniciando, no todo estará disponible hasta que termine.", diff --git a/translations/frontend/es.json b/translations/frontend/es.json index fd6c44b051..fd19086d4f 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -1265,7 +1265,7 @@ "notification_toast": { "connection_lost": "Conexión perdida. Reconectando...", "dismiss": "Descartar", - "intergration_starting": "Iniciando {integration}, no estará todo disponible hasta que finalice.", + "integration_starting": "Iniciando {integration}, no estará todo disponible hasta que finalice.", "service_call_failed": "Error al llamar al servicio {service}.", "started": "¡Home Assistant se ha iniciado!", "starting": "Home Assistant se está iniciando, no estará todo disponible hasta que finalice.", diff --git a/translations/frontend/et.json b/translations/frontend/et.json index 14ceecf2eb..878a37dc10 100644 --- a/translations/frontend/et.json +++ b/translations/frontend/et.json @@ -1265,7 +1265,7 @@ "notification_toast": { "connection_lost": "Ühendus kadunud. Taasühendamine...", "dismiss": "Loobu", - "intergration_starting": "Sidumine {integration} käivitub, kõik elemendid pole veel saadaval.", + "integration_starting": "Sidumine {integration} käivitub, kõik elemendid pole veel saadaval.", "service_call_failed": "Teenuse {service} väljakutsumine ebaõnnestus.", "started": "Home Assistant on käivitunud!", "starting": "Home Assistant käivitub, kõik elemendid ei pruugi veel saadaval olla", diff --git a/translations/frontend/fr.json b/translations/frontend/fr.json index cef4235037..2088f1fe42 100644 --- a/translations/frontend/fr.json +++ b/translations/frontend/fr.json @@ -1261,7 +1261,7 @@ "notification_toast": { "connection_lost": "Connexion perdue. Reconnexion en cours ...", "dismiss": "Ignorer", - "intergration_starting": "Démarrage de {integration}, tout ne sera pas disponible tant qu'il n'aura pas terminé", + "integration_starting": "Démarrage de {integration}, tout ne sera pas disponible tant qu'il n'aura pas terminé", "service_call_failed": "Échec d'appel du service \"{service}\".", "started": "Home Assistant a démarré !", "starting": "Home Assistant est en cours de démarrage, tout ne sera pas disponible tant qu’il n’aura pas terminé.", diff --git a/translations/frontend/he.json b/translations/frontend/he.json index 9ec8d7e9d2..9d635a92e9 100644 --- a/translations/frontend/he.json +++ b/translations/frontend/he.json @@ -898,7 +898,7 @@ "notification_toast": { "connection_lost": "החיבור אבד. מתחבר מחדש...", "dismiss": "בטל", - "intergration_starting": "מפעיל את {integration} , לא הכל יהיה זמין עד לסיום.", + "integration_starting": "מפעיל את {integration} , לא הכל יהיה זמין עד לסיום.", "service_call_failed": "נכשלה הקריאה לשירות {service} .", "started": "Home Assistant עלה!", "starting": "Home Assistant בעלייה, ייתכן שלא הכל יהיה זמין עד שהעליה תסתיים", diff --git a/translations/frontend/id.json b/translations/frontend/id.json index 8a5deab0f0..bb798e8931 100644 --- a/translations/frontend/id.json +++ b/translations/frontend/id.json @@ -1256,7 +1256,7 @@ "notification_toast": { "connection_lost": "Koneksi terputus. Menghubungkan kembali…", "dismiss": "Tutup", - "intergration_starting": "Memulai {integration}, tidak semuanya akan tersedia hingga prosesnya selesai.", + "integration_starting": "Memulai {integration}, tidak semuanya akan tersedia hingga prosesnya selesai.", "service_call_failed": "Gagal memanggil layanan {service}.", "started": "Home Assistant telah dimulai!", "starting": "Home Assistant sedang dimulai, belum semuanya akan tersedia hingga selesai.", diff --git a/translations/frontend/it.json b/translations/frontend/it.json index 27eb316235..d0fcb13914 100644 --- a/translations/frontend/it.json +++ b/translations/frontend/it.json @@ -1261,7 +1261,7 @@ "notification_toast": { "connection_lost": "Connessione persa. Riconnessione…", "dismiss": "Rimuovi", - "intergration_starting": "{integration} si sta avviando, non tutto sarà disponibile fino ad avvio completo.", + "integration_starting": "{integration} si sta avviando, non tutto sarà disponibile fino ad avvio completo.", "service_call_failed": "Fallita chiamata a servizio {service} .", "started": "Home Assistant si è avviato!", "starting": "Home Assistant si sta avviando, non tutto sarà disponibile fino ad avvio completo.", diff --git a/translations/frontend/ja.json b/translations/frontend/ja.json index 7f29e0c996..c096f0fec0 100644 --- a/translations/frontend/ja.json +++ b/translations/frontend/ja.json @@ -1224,7 +1224,7 @@ "notification_toast": { "connection_lost": "接続が切れました。再接続中...", "dismiss": "閉じる", - "intergration_starting": "{integration}を開始すると、完了するまですべてが利用できるわけではありません。", + "integration_starting": "{integration}を開始すると、完了するまですべてが利用できるわけではありません。", "service_call_failed": "サービス{service}の呼び出しに失敗しました。", "started": "ホームアシスタントが開始されました!", "starting": "Home Assistantが起動中です。全て利用可能なるまでもうしばらくお待ち下さい。", diff --git a/translations/frontend/ko.json b/translations/frontend/ko.json index d4dc2576f4..a5e21b946d 100644 --- a/translations/frontend/ko.json +++ b/translations/frontend/ko.json @@ -1261,7 +1261,7 @@ "notification_toast": { "connection_lost": "서버와 연결이 끊어졌습니다. 다시 연결하는 중...", "dismiss": "해제하기", - "intergration_starting": "{integration}을(를) 시작하는 중입니다. 완료될 때까지 일부 기능은 작동하지 않을 수 있습니다.", + "integration_starting": "{integration}을(를) 시작하는 중입니다. 완료될 때까지 일부 기능은 작동하지 않을 수 있습니다.", "service_call_failed": "{service} 서비스를 호출하지 못했습니다.", "started": "Home Assistant가 시작되었습니다!", "starting": "Home Assistant가 시작됩니다. 완료될 때까지 일부 기능은 작동하지 않을 수 있습니다.", diff --git a/translations/frontend/nb.json b/translations/frontend/nb.json index 36c1bc1113..375698e2b9 100644 --- a/translations/frontend/nb.json +++ b/translations/frontend/nb.json @@ -396,14 +396,15 @@ }, "folders": "Mapper", "full_snapshot": "Full sikkerhetskopi", - "name": "Navn", + "name": "Navn på øyeblikksbilde", "no_snapshots": "Du har ingen sikkerhetskopier ennå", "partial_snapshot": "Delvis sikkerhetskopi", - "password": "Passord", + "password": "Passord for øyeblikksbilde", "password_protected": "Passordbeskyttet", "password_protection": "Passordbeskyttelse", "security": "Sikkerhet", - "type": "", + "select_type": "Velg hva du vil gjenopprette", + "type": "Type øyeblikksbilde", "upload_snapshot": "Last opp sikkerhetskopi" }, "store": { @@ -720,6 +721,9 @@ "no_match": "Fant ingen samsvarende områder", "show_areas": "Vis områder" }, + "attributes": { + "expansion_header": "Attributter" + }, "blueprint-picker": { "add_user": "Legg til bruker", "remove_user": "Fjern bruker", @@ -1261,7 +1265,7 @@ "notification_toast": { "connection_lost": "Mistet forbindelsen. Kobler til på nytt...", "dismiss": "Avvis", - "intergration_starting": "Starter {integration}. Ikke alt er tilgjengelig før lasting er ferdig.", + "integration_starting": "Starter {integration}. Ikke alt er tilgjengelig før lasting er ferdig.", "service_call_failed": "Kunne ikke tilkalle tjenesten: {service}", "started": "Home Assistant har startet!", "starting": "Home Assistant starter, alt er ikke tilgjengelig før starten er fullført.", @@ -1719,6 +1723,7 @@ "title": "" }, "connected": "Tilkoblet", + "connecting": "Kobler til...", "connection_status": "Status for skytilkobling", "fetching_subscription": "Henter abonnement...", "google": { @@ -2959,6 +2964,7 @@ }, "logs": { "log_level": "Loggnivå", + "log_level_changed": "Loggnivå endret til: {level}", "subscribed_to_logs": "Abonnerer på Z-Wave JS-loggmeldinger ...", "title": "Z-Wave JS-logger" }, diff --git a/translations/frontend/nl.json b/translations/frontend/nl.json index 7c33368b40..6cf8313968 100644 --- a/translations/frontend/nl.json +++ b/translations/frontend/nl.json @@ -1261,7 +1261,7 @@ "notification_toast": { "connection_lost": "Verbinding verbroken. Opnieuw verbinden...", "dismiss": "Afwijzen", - "intergration_starting": "{integration} starten, niet alles is beschikbaar totdat het voltooid is.", + "integration_starting": "{integration} starten, niet alles is beschikbaar totdat het voltooid is.", "service_call_failed": "Kan service {service} niet aanroepen", "started": "Home Assistant is gestart!", "starting": "Home Assistant is aan het opstarten. Tijdens het opstarten is niet alles beschikbaar.", diff --git a/translations/frontend/pl.json b/translations/frontend/pl.json index cf8b6b580c..13ee90347d 100644 --- a/translations/frontend/pl.json +++ b/translations/frontend/pl.json @@ -1264,7 +1264,7 @@ "notification_toast": { "connection_lost": "Utracono połączenie. Łączę ponownie...", "dismiss": "Ukryj", - "intergration_starting": "{integration} uruchamia się, nie wszystko będzie dostępne, dopóki uruchamianie się nie zakończy.", + "integration_starting": "{integration} uruchamia się, nie wszystko będzie dostępne, dopóki uruchamianie się nie zakończy.", "service_call_failed": "Nie udało się wywołać usługi {service}.", "started": "Home Assistant uruchomił się!", "starting": "Home Assistant uruchamia się, nie wszystko będzie dostępne, dopóki uruchamianie się nie zakończy.", diff --git a/translations/frontend/ru.json b/translations/frontend/ru.json index 0900468e88..bf9577846b 100644 --- a/translations/frontend/ru.json +++ b/translations/frontend/ru.json @@ -403,7 +403,8 @@ "password_protected": "защищено паролем", "password_protection": "Защита паролем", "security": "Безопасность", - "type": "Тип", + "select_type": "Выберите, что нужно восстановить", + "type": "Тип снимка", "upload_snapshot": "Загрузить снимок" }, "store": { @@ -1264,7 +1265,7 @@ "notification_toast": { "connection_lost": "Соединение потеряно. Повторное подключение...", "dismiss": "Закрыть", - "intergration_starting": "{integration} запускается, пока что не всё может быть доступно.", + "integration_starting": "{integration} запускается, пока что не всё может быть доступно.", "service_call_failed": "Не удалось вызвать службу {service}.", "started": "Home Assistant работает!", "starting": "Home Assistant запускается, пока что не всё может быть доступно.", diff --git a/translations/frontend/zh-Hans.json b/translations/frontend/zh-Hans.json index 96e0edaed3..204b0f2bdf 100644 --- a/translations/frontend/zh-Hans.json +++ b/translations/frontend/zh-Hans.json @@ -1261,7 +1261,7 @@ "notification_toast": { "connection_lost": "连接中断。正在重新连接...", "dismiss": "关闭", - "intergration_starting": "正在启动 {integration}。在启动完成前,部分功能暂不可用。", + "integration_starting": "正在启动 {integration}。在启动完成前,部分功能暂不可用。", "service_call_failed": "调用服务 {service} 失败。", "started": "Home Assistant 已启动!", "starting": "Home Assistant 正在启动。在启动完成前,部分功能暂不可用。", diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index 70283c36a0..849d32e790 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -1261,7 +1261,7 @@ "notification_toast": { "connection_lost": "連線中斷。重新連線中...", "dismiss": "關閉", - "intergration_starting": "{integration} 正在啟動,在完成載入前、可能無法顯示所有功能。", + "integration_starting": "{integration} 正在啟動,在完成載入前、可能無法顯示所有功能。", "service_call_failed": "服務 {service} 執行失敗。", "started": "Home Assistant 已啟動!", "starting": "Home Assistant 正在啟動,在完成載入前、可能無法顯示所有功能。", From 5958eb9a5522aeda7baa3b5bb8ecd68b451c8d02 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 26 May 2021 12:04:39 +0200 Subject: [PATCH 108/117] Minor dependency bumps (#9249) --- .eslintrc.json | 4 +- package.json | 39 +- src/common/dom/speech-recognition.ts | 9 +- yarn.lock | 581 +++++++++++++-------------- 4 files changed, 299 insertions(+), 334 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index b1db8a1786..7294a8b0e5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -28,9 +28,7 @@ "__BUILD__": false, "__VERSION__": false, "__STATIC_PATH__": false, - "Polymer": true, - "webkitSpeechRecognition": false, - "ResizeObserver": false + "Polymer": true }, "env": { "browser": true, diff --git a/package.json b/package.json index 2213f328e4..af32469d89 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "author": "Paulus Schoutsen (http://paulusschoutsen.nl)", "license": "Apache-2.0", "dependencies": { - "@braintree/sanitize-url": "^5.0.0", + "@braintree/sanitize-url": "^5.0.1", "@codemirror/commands": "^0.18.0", "@codemirror/gutter": "^0.18.0", "@codemirror/highlight": "^0.18.0", @@ -35,8 +35,8 @@ "@codemirror/text": "^0.18.0", "@codemirror/view": "^0.18.0", "@formatjs/intl-getcanonicallocales": "^1.5.10", - "@formatjs/intl-locale": "^2.4.24", - "@formatjs/intl-pluralrules": "^4.0.18", + "@formatjs/intl-locale": "^2.4.28", + "@formatjs/intl-pluralrules": "^4.0.22", "@fullcalendar/common": "5.1.0", "@fullcalendar/core": "5.1.0", "@fullcalendar/daygrid": "5.1.0", @@ -101,24 +101,24 @@ "@webcomponents/webcomponentsjs": "^2.2.7", "chart.js": "^2.9.4", "chartjs-chart-timeline": "^0.4.0", - "comlink": "^4.3.0", + "comlink": "^4.3.1", "core-js": "^3.6.5", - "cropperjs": "^1.5.7", + "cropperjs": "^1.5.11", "deep-clone-simple": "^1.1.1", "deep-freeze": "^0.0.1", "fecha": "^4.2.0", "fuse.js": "^6.0.0", "google-timezones-json": "^1.0.2", - "hls.js": "^1.0.3", + "hls.js": "^1.0.4", "home-assistant-js-websocket": "^5.10.0", "idb-keyval": "^5.0.5", - "intl-messageformat": "^9.6.13", + "intl-messageformat": "^9.6.16", "js-yaml": "^4.1.0", "leaflet": "^1.7.1", "leaflet-draw": "^1.0.4", "lit": "^2.0.0-rc.2", "lit-vaadin-helpers": "^0.1.3", - "marked": "2.0.0", + "marked": "^2.0.5", "mdn-polyfills": "^5.16.0", "memoize-one": "^5.2.1", "node-vibrant": "3.2.1-alpha.1", @@ -130,12 +130,12 @@ "roboto-fontface": "^0.10.0", "sortablejs": "^1.10.2", "superstruct": "^0.15.2", - "tinykeys": "^1.1.1", + "tinykeys": "^1.1.3", "tsparticles": "^1.19.2", "unfetch": "^4.1.0", - "vis-data": "^7.1.1", + "vis-data": "^7.1.2", "vis-network": "^8.5.4", - "vue": "^2.6.11", + "vue": "^2.6.12", "vue2-daterange-picker": "^0.5.1", "web-animations-js": "^2.3.2", "workbox-cacheable-response": "^6.1.5", @@ -147,7 +147,7 @@ "xss": "^1.0.9" }, "devDependencies": { - "@babel/core": "^7.14.0", + "@babel/core": "^7.14.3", "@babel/plugin-external-helpers": "^7.12.13", "@babel/plugin-proposal-class-properties": "^7.13.0", "@babel/plugin-proposal-decorators": "^7.13.15", @@ -156,7 +156,7 @@ "@babel/plugin-proposal-optional-chaining": "^7.13.12", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-import-meta": "^7.10.4", - "@babel/preset-env": "^7.14.0", + "@babel/preset-env": "^7.14.2", "@babel/preset-typescript": "^7.13.0", "@koa/cors": "^3.1.0", "@open-wc/dev-server-hmr": "^0.0.2", @@ -165,16 +165,13 @@ "@rollup/plugin-json": "^4.0.3", "@rollup/plugin-node-resolve": "^7.1.3", "@rollup/plugin-replace": "^2.3.2", - "@types/chai": "^4.2.18", - "@types/chromecast-caf-receiver": "^5.0.11", + "@types/chromecast-caf-receiver": "5.0.12", "@types/chromecast-caf-sender": "^1.0.3", "@types/js-yaml": "^4.0.1", "@types/leaflet": "^1.7.0", "@types/leaflet-draw": "^1.0.3", - "@types/marked": "^1.2.2", + "@types/marked": "^2.0.3", "@types/mocha": "^8.2.2", - "@types/resize-observer-browser": "^0.1.3", - "@types/sinon": "^10.0.0", "@types/sortablejs": "^1.10.6", "@types/webspeechapi": "^0.0.29", "@typescript-eslint/eslint-plugin": "^4.22.0", @@ -196,7 +193,7 @@ "eslint-plugin-wc": "^1.3.0", "fancy-log": "^1.3.3", "fs-extra": "^7.0.1", - "gulp": "^4.0.0", + "gulp": "^4.0.2", "gulp-foreach": "^0.1.0", "gulp-json-transform": "^0.4.6", "gulp-merge-json": "^1.3.1", @@ -220,11 +217,11 @@ "rollup-plugin-string": "^3.0.0", "rollup-plugin-terser": "^5.3.0", "rollup-plugin-visualizer": "^4.0.4", - "serve": "^11.3.0", + "serve": "^11.3.2", "sinon": "^11.0.0", "source-map-url": "^0.4.0", "systemjs": "^6.3.2", - "terser-webpack-plugin": "^5.1.1", + "terser-webpack-plugin": "^5.1.2", "ts-lit-plugin": "^1.2.1", "ts-mocha": "^8.0.0", "typescript": "^4.2.4", diff --git a/src/common/dom/speech-recognition.ts b/src/common/dom/speech-recognition.ts index a3003974fb..6efec5b8a2 100644 --- a/src/common/dom/speech-recognition.ts +++ b/src/common/dom/speech-recognition.ts @@ -1,14 +1,7 @@ -/* eslint-disable */ -// @ts-ignore export const SpeechRecognition = - // @ts-ignore window.SpeechRecognition || window.webkitSpeechRecognition; -// @ts-ignore export const SpeechGrammarList = - // @ts-ignore window.SpeechGrammarList || window.webkitSpeechGrammarList; -// @ts-ignore export const SpeechRecognitionEvent = - // @ts-ignore + // @ts-expect-error window.SpeechRecognitionEvent || window.webkitSpeechRecognitionEvent; -/* eslint-enable */ diff --git a/yarn.lock b/yarn.lock index c0dfa50c46..0375730fc3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,25 +16,25 @@ dependencies: "@babel/highlight" "^7.12.13" -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.13.15", "@babel/compat-data@^7.13.8", "@babel/compat-data@^7.14.0": +"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.13.15", "@babel/compat-data@^7.14.0": version "7.14.0" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.14.0.tgz#a901128bce2ad02565df95e6ecbf195cf9465919" integrity sha512-vu9V3uMM/1o5Hl5OekMUowo3FqXLJSw+s+66nt0fSWVWTtmosdzn45JHOB3cPtZoe6CTBDzvSw0RdOY85Q37+Q== -"@babel/core@^7.11.1", "@babel/core@^7.12.3", "@babel/core@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.0.tgz#47299ff3ec8d111b493f1a9d04bf88c04e728d88" - integrity sha512-8YqpRig5NmIHlMLw09zMlPTvUVMILjqCOtVgu+TVNWEBvy9b5I3RRyhqnrV4hjgEK7n8P9OqvkWJAFmEL6Wwfw== +"@babel/core@^7.11.1", "@babel/core@^7.12.3", "@babel/core@^7.14.3": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.3.tgz#5395e30405f0776067fbd9cf0884f15bfb770a38" + integrity sha512-jB5AmTKOCSJIZ72sd78ECEhuPiDMKlQdDI/4QRI6lzYATx5SSogS1oQA2AoPecRCknm30gHi2l+QVvNUu3wZAg== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.14.0" + "@babel/generator" "^7.14.3" "@babel/helper-compilation-targets" "^7.13.16" - "@babel/helper-module-transforms" "^7.14.0" + "@babel/helper-module-transforms" "^7.14.2" "@babel/helpers" "^7.14.0" - "@babel/parser" "^7.14.0" + "@babel/parser" "^7.14.3" "@babel/template" "^7.12.13" - "@babel/traverse" "^7.14.0" - "@babel/types" "^7.14.0" + "@babel/traverse" "^7.14.2" + "@babel/types" "^7.14.2" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -42,12 +42,12 @@ semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.0.tgz#0f35d663506c43e4f10898fbda0d752ec75494be" - integrity sha512-C6u00HbmsrNPug6A+CiNl8rEys7TsdcXwg12BHi2ca5rUfAs3+UwZsuDQSXnc+wCElCXMB8gMaJ3YXDdh8fAlg== +"@babel/generator@^7.14.2", "@babel/generator@^7.14.3": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.14.3.tgz#0c2652d91f7bddab7cccc6ba8157e4f40dcedb91" + integrity sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA== dependencies: - "@babel/types" "^7.14.0" + "@babel/types" "^7.14.2" jsesc "^2.5.1" source-map "^0.5.0" @@ -66,7 +66,7 @@ "@babel/helper-explode-assignable-expression" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.16", "@babel/helper-compilation-targets@^7.13.8": +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.16": version "7.13.16" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.16.tgz#6e91dccf15e3f43e5556dffe32d860109887563c" integrity sha512-3gmkYIrpqsLlieFwjkGgLaSHmhnvlAYzZLlYVjlW+QwI+1zE17kGxuJGmIqDQdYp56XdmGeD+Bswx0UTyG18xA== @@ -76,30 +76,30 @@ browserslist "^4.14.5" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.13.0", "@babel/helper-create-class-features-plugin@^7.13.11", "@babel/helper-create-class-features-plugin@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.0.tgz#38367d3dab125b12f94273de418f4df23a11a15e" - integrity sha512-6pXDPguA5zC40Y8oI5mqr+jEUpjMJonKvknvA+vD8CYDz5uuXEwWBK8sRAsE/t3gfb1k15AQb9RhwpscC4nUJQ== +"@babel/helper-create-class-features-plugin@^7.13.0", "@babel/helper-create-class-features-plugin@^7.14.0", "@babel/helper-create-class-features-plugin@^7.14.2", "@babel/helper-create-class-features-plugin@^7.14.3": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.3.tgz#832111bcf4f57ca57a4c5b1a000fc125abc6554a" + integrity sha512-BnEfi5+6J2Lte9LeiL6TxLWdIlEv9Woacc1qXzXBgbikcOzMRM2Oya5XGg/f/ngotv1ej2A/b+3iJH8wbS1+lQ== dependencies: "@babel/helper-annotate-as-pure" "^7.12.13" - "@babel/helper-function-name" "^7.12.13" + "@babel/helper-function-name" "^7.14.2" "@babel/helper-member-expression-to-functions" "^7.13.12" "@babel/helper-optimise-call-expression" "^7.12.13" - "@babel/helper-replace-supers" "^7.13.12" + "@babel/helper-replace-supers" "^7.14.3" "@babel/helper-split-export-declaration" "^7.12.13" "@babel/helper-create-regexp-features-plugin@^7.12.13": - version "7.12.17" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz#a2ac87e9e319269ac655b8d4415e94d38d663cb7" - integrity sha512-p2VGmBu9oefLZ2nQpgnEnG0ZlRPvL8gAGvPUMQwUdaE8k49rOMuZpOwdQoy5qJf6K8jL3bcAMhVUlHAjIgJHUg== + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.3.tgz#149aa6d78c016e318c43e2409a0ae9c136a86688" + integrity sha512-JIB2+XJrb7v3zceV2XzDhGIB902CmKGSpSl4q2C6agU9SNLG/2V1RtFRGPG1Ajh9STj3+q6zJMOC+N/pp2P9DA== dependencies: "@babel/helper-annotate-as-pure" "^7.12.13" regexpu-core "^4.7.1" "@babel/helper-define-polyfill-provider@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.0.tgz#a640051772045fedaaecc6f0c6c69f02bdd34bf1" - integrity sha512-JT8tHuFjKBo8NnaUbblz7mIu1nnvUDiHVjXXkulZULyidvo/7P6TY7+YqpV37IfF+KUFxmlK04elKtGKXaiVgw== + version "0.2.1" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.1.tgz#e6f5f4a6edc3722152c21359190de67fc6cf664d" + integrity sha512-x3AUTVZNPunaw1opRTa5OwVA5N0YxGlIad9xQ5QflK1uIS7PnAGGU5O2Dj/G183fR//N8AzTq+Q8+oiu9m0VFg== dependencies: "@babel/helper-compilation-targets" "^7.13.0" "@babel/helper-module-imports" "^7.12.13" @@ -117,14 +117,14 @@ dependencies: "@babel/types" "^7.13.0" -"@babel/helper-function-name@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" - integrity sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== +"@babel/helper-function-name@^7.12.13", "@babel/helper-function-name@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz#397688b590760b6ef7725b5f0860c82427ebaac2" + integrity sha512-NYZlkZRydxw+YT56IlhIcS8PAhb+FEUiOzuhFTfqDyPmzAhRge6ua0dQYT/Uh0t/EDHq05/i+e5M2d4XvjgarQ== dependencies: "@babel/helper-get-function-arity" "^7.12.13" "@babel/template" "^7.12.13" - "@babel/types" "^7.12.13" + "@babel/types" "^7.14.2" "@babel/helper-get-function-arity@^7.12.13": version "7.12.13" @@ -155,10 +155,10 @@ dependencies: "@babel/types" "^7.13.12" -"@babel/helper-module-transforms@^7.13.0", "@babel/helper-module-transforms@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz#8fcf78be220156f22633ee204ea81f73f826a8ad" - integrity sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw== +"@babel/helper-module-transforms@^7.13.0", "@babel/helper-module-transforms@^7.14.0", "@babel/helper-module-transforms@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.14.2.tgz#ac1cc30ee47b945e3e0c4db12fa0c5389509dfe5" + integrity sha512-OznJUda/soKXv0XhpvzGWDnml4Qnwp16GN+D/kZIdLsWoHj05kyu8Rm5kXmMef+rVJZ0+4pSGLkeixdqNUATDA== dependencies: "@babel/helper-module-imports" "^7.13.12" "@babel/helper-replace-supers" "^7.13.12" @@ -166,8 +166,8 @@ "@babel/helper-split-export-declaration" "^7.12.13" "@babel/helper-validator-identifier" "^7.14.0" "@babel/template" "^7.12.13" - "@babel/traverse" "^7.14.0" - "@babel/types" "^7.14.0" + "@babel/traverse" "^7.14.2" + "@babel/types" "^7.14.2" "@babel/helper-optimise-call-expression@^7.12.13": version "7.12.13" @@ -190,15 +190,15 @@ "@babel/helper-wrap-function" "^7.13.0" "@babel/types" "^7.13.0" -"@babel/helper-replace-supers@^7.12.13", "@babel/helper-replace-supers@^7.13.0", "@babel/helper-replace-supers@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz#6442f4c1ad912502481a564a7386de0c77ff3804" - integrity sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw== +"@babel/helper-replace-supers@^7.12.13", "@babel/helper-replace-supers@^7.13.12", "@babel/helper-replace-supers@^7.14.3": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.14.3.tgz#ca17b318b859d107f0e9b722d58cf12d94436600" + integrity sha512-Rlh8qEWZSTfdz+tgNV/N4gz1a0TMNwCUcENhMjHTHKp3LseYH5Jha0NSlyTQWMnjbYcwFt+bqAMqSLHVXkQ6UA== dependencies: "@babel/helper-member-expression-to-functions" "^7.13.12" "@babel/helper-optimise-call-expression" "^7.12.13" - "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.12" + "@babel/traverse" "^7.14.2" + "@babel/types" "^7.14.2" "@babel/helper-simple-access@^7.13.12": version "7.13.12" @@ -259,10 +259,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.12.13", "@babel/parser@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.0.tgz#2f0ebfed92bcddcc8395b91f1895191ce2760380" - integrity sha512-AHbfoxesfBALg33idaTBVUkLnfXtsgvJREf93p4p0Lwsz4ppfE7g1tpEXVm4vrxUcH4DVhAa9Z1m1zqf9WUC7Q== +"@babel/parser@^7.12.13", "@babel/parser@^7.14.2", "@babel/parser@^7.14.3": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.3.tgz#9b530eecb071fd0c93519df25c5ff9f14759f298" + integrity sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ== "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.13.12": version "7.13.12" @@ -280,10 +280,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-proposal-async-generator-functions@^7.13.15": - version "7.13.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.15.tgz#80e549df273a3b3050431b148c892491df1bcc5b" - integrity sha512-VapibkWzFeoa6ubXy/NgV5U2U4MVnUlvnx6wo1XhlsaTrLYWE0UFpDQsVrmn22q5CzeloqJ8gEMHSKxuee6ZdA== +"@babel/plugin-proposal-async-generator-functions@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.2.tgz#3a2085abbf5d5f962d480dbc81347385ed62eb1e" + integrity sha512-b1AM4F6fwck4N8ItZ/AtC4FP/cqZqmKRQ4FaTDutwSYyjuhtvsGEMLK4N/ztV/ImP40BjIDyMgBQAeAMsQYVFQ== dependencies: "@babel/helper-plugin-utils" "^7.13.0" "@babel/helper-remap-async-to-generator" "^7.13.0" @@ -298,93 +298,94 @@ "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-proposal-class-static-block@^7.13.11": - version "7.13.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.13.11.tgz#6fcbba4a962702c17e5371a0c7b39afde186d703" - integrity sha512-fJTdFI4bfnMjvxJyNuaf8i9mVcZ0UhetaGEUHaHV9KEnibLugJkZAtXikR8KcYj+NYmI4DZMS8yQAyg+hvfSqg== + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.14.3.tgz#5a527e2cae4a4753119c3a3e7f64ecae8ccf1360" + integrity sha512-HEjzp5q+lWSjAgJtSluFDrGGosmwTgKwCXdDQZvhKsRlwv3YdkUEqxNrrjesJd+B9E9zvr1PVPVBvhYZ9msjvQ== dependencies: + "@babel/helper-create-class-features-plugin" "^7.14.3" "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-class-static-block" "^7.12.13" "@babel/plugin-proposal-decorators@^7.13.15": - version "7.13.15" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.13.15.tgz#e91ccfef2dc24dd5bd5dcc9fc9e2557c684ecfb8" - integrity sha512-ibAMAqUm97yzi+LPgdr5Nqb9CMkeieGHvwPg1ywSGjZrZHQEGqE01HmOio8kxRpA/+VtOHouIVy2FMpBbtltjA== + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.14.2.tgz#e68c3c5e4a6a08834456568256fc3e71b93590cf" + integrity sha512-LauAqDd/VjQDtae58QgBcEOE42NNP+jB2OE+XeC3KBI/E+BhhRjtr5viCIrj1hmu1YvrguLipIPRJZmS5yUcFw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.13.11" + "@babel/helper-create-class-features-plugin" "^7.14.2" "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-decorators" "^7.12.13" -"@babel/plugin-proposal-dynamic-import@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz#876a1f6966e1dec332e8c9451afda3bebcdf2e1d" - integrity sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ== +"@babel/plugin-proposal-dynamic-import@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.2.tgz#01ebabd7c381cff231fa43e302939a9de5be9d9f" + integrity sha512-oxVQZIWFh91vuNEMKltqNsKLFWkOIyJc95k2Gv9lWVyDfPUQGSSlbDEgWuJUU1afGE9WwlzpucMZ3yDRHIItkA== dependencies: "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-namespace-from@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz#393be47a4acd03fa2af6e3cde9b06e33de1b446d" - integrity sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw== +"@babel/plugin-proposal-export-namespace-from@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.2.tgz#62542f94aa9ce8f6dba79eec698af22112253791" + integrity sha512-sRxW3z3Zp3pFfLAgVEvzTFutTXax837oOatUIvSG9o5gRj9mKwm3br1Se5f4QalTQs9x4AzlA/HrCWbQIHASUQ== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz#bf1fb362547075afda3634ed31571c5901afef7b" - integrity sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q== +"@babel/plugin-proposal-json-strings@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.2.tgz#830b4e2426a782e8b2878fbfe2cba85b70cbf98c" + integrity sha512-w2DtsfXBBJddJacXMBhElGEYqCZQqN99Se1qeYn8DVLB33owlrlLftIbMzn5nz1OITfDVknXF433tBrLEAOEjA== dependencies: "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz#93fa78d63857c40ce3c8c3315220fd00bfbb4e1a" - integrity sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A== +"@babel/plugin-proposal-logical-assignment-operators@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.2.tgz#222348c080a1678e0e74ea63fe76f275882d1fd7" + integrity sha512-1JAZtUrqYyGsS7IDmFeaem+/LJqujfLZ2weLR9ugB0ufUPjzf8cguyVT1g5im7f7RXxuLq1xUxEzvm68uYRtGg== dependencies: "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz#3730a31dafd3c10d8ccd10648ed80a2ac5472ef3" - integrity sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.13.8", "@babel/plugin-proposal-nullish-coalescing-operator@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.2.tgz#425b11dc62fc26939a2ab42cbba680bdf5734546" + integrity sha512-ebR0zU9OvI2N4qiAC38KIAK75KItpIPTpAtd2r4OZmMFeKbKJpUFLYP2EuDut82+BmYi8sz42B+TfTptJ9iG5Q== dependencies: "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-numeric-separator@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz#bd9da3188e787b5120b4f9d465a8261ce67ed1db" - integrity sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w== +"@babel/plugin-proposal-numeric-separator@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.2.tgz#82b4cc06571143faf50626104b335dd71baa4f9e" + integrity sha512-DcTQY9syxu9BpU3Uo94fjCB3LN9/hgPS8oUL7KrSW3bA2ePrKZZPJcc5y0hoJAM9dft3pGfErtEUvxXQcfLxUg== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz#5d210a4d727d6ce3b18f9de82cc99a3964eed60a" - integrity sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g== +"@babel/plugin-proposal-object-rest-spread@^7.13.8", "@babel/plugin-proposal-object-rest-spread@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.2.tgz#e17d418f81cc103fedd4ce037e181c8056225abc" + integrity sha512-hBIQFxwZi8GIp934+nj5uV31mqclC1aYDhctDu5khTi9PCCUOczyy0b34W0oE9U/eJXiqQaKyVsmjeagOaSlbw== dependencies: - "@babel/compat-data" "^7.13.8" - "@babel/helper-compilation-targets" "^7.13.8" + "@babel/compat-data" "^7.14.0" + "@babel/helper-compilation-targets" "^7.13.16" "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.13.0" + "@babel/plugin-transform-parameters" "^7.14.2" -"@babel/plugin-proposal-optional-catch-binding@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz#3ad6bd5901506ea996fc31bdcf3ccfa2bed71107" - integrity sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA== +"@babel/plugin-proposal-optional-catch-binding@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.2.tgz#150d4e58e525b16a9a1431bd5326c4eed870d717" + integrity sha512-XtkJsmJtBaUbOxZsNk0Fvrv8eiqgneug0A6aqLFZ4TSkar2L5dSXWcnUKHgmjJt49pyB/6ZHvkr3dPgl9MOWRQ== dependencies: "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.13.12": - version "7.13.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz#ba9feb601d422e0adea6760c2bd6bbb7bfec4866" - integrity sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ== +"@babel/plugin-proposal-optional-chaining@^7.13.12", "@babel/plugin-proposal-optional-chaining@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.2.tgz#df8171a8b9c43ebf4c1dabe6311b432d83e1b34e" + integrity sha512-qQByMRPwMZJainfig10BoaDldx/+VDtNcrA7qdNaEOAj6VXud+gfrkA8j4CRAU5HjnWREXqIpSpH30qZX1xivA== dependencies: "@babel/helper-plugin-utils" "^7.13.0" "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" @@ -565,23 +566,23 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-block-scoping@^7.13.16": - version "7.13.16" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.13.16.tgz#a9c0f10794855c63b1d629914c7dcfeddd185892" - integrity sha512-ad3PHUxGnfWF4Efd3qFuznEtZKoBp0spS+DgqzVzRPV7urEBvPLue3y2j80w4Jf2YLzZHj8TOv/Lmvdmh3b2xg== +"@babel/plugin-transform-block-scoping@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.2.tgz#761cb12ab5a88d640ad4af4aa81f820e6b5fdf5c" + integrity sha512-neZZcP19NugZZqNwMTH+KoBjx5WyvESPSIOQb4JHpfd+zPfqcH65RMu5xJju5+6q/Y2VzYrleQTr+b6METyyxg== dependencies: "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-classes@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz#0265155075c42918bf4d3a4053134176ad9b533b" - integrity sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g== +"@babel/plugin-transform-classes@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.2.tgz#3f1196c5709f064c252ad056207d87b7aeb2d03d" + integrity sha512-7oafAVcucHquA/VZCsXv/gmuiHeYd64UJyyTYU+MPfNu0KeNlxw06IeENBO8bJjXVbolu+j1MM5aKQtH1OMCNg== dependencies: "@babel/helper-annotate-as-pure" "^7.12.13" - "@babel/helper-function-name" "^7.12.13" + "@babel/helper-function-name" "^7.14.2" "@babel/helper-optimise-call-expression" "^7.12.13" "@babel/helper-plugin-utils" "^7.13.0" - "@babel/helper-replace-supers" "^7.13.0" + "@babel/helper-replace-supers" "^7.13.12" "@babel/helper-split-export-declaration" "^7.12.13" globals "^11.1.0" @@ -651,12 +652,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-modules-amd@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.0.tgz#589494b5b290ff76cf7f59c798011f6d77026553" - integrity sha512-CF4c5LX4LQ03LebQxJ5JZes2OYjzBuk1TdiF7cG7d5dK4lAdw9NZmaxq5K/mouUdNeqwz3TNjnW6v01UqUNgpQ== +"@babel/plugin-transform-modules-amd@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.2.tgz#6622806fe1a7c07a1388444222ef9535f2ca17b0" + integrity sha512-hPC6XBswt8P3G2D1tSV2HzdKvkqOpmbyoy+g73JG0qlF/qx2y3KaMmXb1fLrpmWGLZYA0ojCvaHdzFWjlmV+Pw== dependencies: - "@babel/helper-module-transforms" "^7.14.0" + "@babel/helper-module-transforms" "^7.14.2" "@babel/helper-plugin-utils" "^7.13.0" babel-plugin-dynamic-import-node "^2.3.3" @@ -711,10 +712,10 @@ "@babel/helper-plugin-utils" "^7.12.13" "@babel/helper-replace-supers" "^7.12.13" -"@babel/plugin-transform-parameters@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz#8fa7603e3097f9c0b7ca1a4821bc2fb52e9e5007" - integrity sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw== +"@babel/plugin-transform-parameters@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.2.tgz#e4290f72e0e9e831000d066427c4667098decc31" + integrity sha512-NxoVmA3APNCC1JdMXkdYXuQS+EMdqy0vIwyDHeKHiJKRxmp1qGSdb0JLEIoPRhkx6H/8Qi3RJ3uqOCYw8giy9A== dependencies: "@babel/helper-plugin-utils" "^7.13.0" @@ -776,11 +777,11 @@ "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-transform-typescript@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.13.0.tgz#4a498e1f3600342d2a9e61f60131018f55774853" - integrity sha512-elQEwluzaU8R8dbVuW2Q2Y8Nznf7hnjM7+DSCd14Lo5fF63C9qNLbwZYbmZrtV9/ySpSUpkRpQXvJb6xyu4hCQ== + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.14.3.tgz#44f67f725a60cccee33d9d6fee5e4f338258f34f" + integrity sha512-G5Bb5pY6tJRTC4ag1visSgiDoGgJ1u1fMUgmc2ijLkcIdzP83Q1qyZX4ggFQ/SkR+PNOatkaYC+nKcTlpsX4ag== dependencies: - "@babel/helper-create-class-features-plugin" "^7.13.0" + "@babel/helper-create-class-features-plugin" "^7.14.3" "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-typescript" "^7.12.13" @@ -799,28 +800,28 @@ "@babel/helper-create-regexp-features-plugin" "^7.12.13" "@babel/helper-plugin-utils" "^7.12.13" -"@babel/preset-env@^7.11.0", "@babel/preset-env@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.14.0.tgz#236f88cd5da625e625dd40500d4824523f50e6c5" - integrity sha512-GWRCdBv2whxqqaSi7bo/BEXf070G/fWFMEdCnmoRg2CZJy4GK06ovFuEjJrZhDRXYgBsYtxVbG8GUHvw+UWBkQ== +"@babel/preset-env@^7.11.0", "@babel/preset-env@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.14.2.tgz#e80612965da73579c84ad2f963c2359c71524ed5" + integrity sha512-7dD7lVT8GMrE73v4lvDEb85cgcQhdES91BSD7jS/xjC6QY8PnRhux35ac+GCpbiRhp8crexBvZZqnaL6VrY8TQ== dependencies: "@babel/compat-data" "^7.14.0" "@babel/helper-compilation-targets" "^7.13.16" "@babel/helper-plugin-utils" "^7.13.0" "@babel/helper-validator-option" "^7.12.17" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.13.12" - "@babel/plugin-proposal-async-generator-functions" "^7.13.15" + "@babel/plugin-proposal-async-generator-functions" "^7.14.2" "@babel/plugin-proposal-class-properties" "^7.13.0" "@babel/plugin-proposal-class-static-block" "^7.13.11" - "@babel/plugin-proposal-dynamic-import" "^7.13.8" - "@babel/plugin-proposal-export-namespace-from" "^7.12.13" - "@babel/plugin-proposal-json-strings" "^7.13.8" - "@babel/plugin-proposal-logical-assignment-operators" "^7.13.8" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.13.8" - "@babel/plugin-proposal-numeric-separator" "^7.12.13" - "@babel/plugin-proposal-object-rest-spread" "^7.13.8" - "@babel/plugin-proposal-optional-catch-binding" "^7.13.8" - "@babel/plugin-proposal-optional-chaining" "^7.13.12" + "@babel/plugin-proposal-dynamic-import" "^7.14.2" + "@babel/plugin-proposal-export-namespace-from" "^7.14.2" + "@babel/plugin-proposal-json-strings" "^7.14.2" + "@babel/plugin-proposal-logical-assignment-operators" "^7.14.2" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.2" + "@babel/plugin-proposal-numeric-separator" "^7.14.2" + "@babel/plugin-proposal-object-rest-spread" "^7.14.2" + "@babel/plugin-proposal-optional-catch-binding" "^7.14.2" + "@babel/plugin-proposal-optional-chaining" "^7.14.2" "@babel/plugin-proposal-private-methods" "^7.13.0" "@babel/plugin-proposal-private-property-in-object" "^7.14.0" "@babel/plugin-proposal-unicode-property-regex" "^7.12.13" @@ -841,8 +842,8 @@ "@babel/plugin-transform-arrow-functions" "^7.13.0" "@babel/plugin-transform-async-to-generator" "^7.13.0" "@babel/plugin-transform-block-scoped-functions" "^7.12.13" - "@babel/plugin-transform-block-scoping" "^7.13.16" - "@babel/plugin-transform-classes" "^7.13.0" + "@babel/plugin-transform-block-scoping" "^7.14.2" + "@babel/plugin-transform-classes" "^7.14.2" "@babel/plugin-transform-computed-properties" "^7.13.0" "@babel/plugin-transform-destructuring" "^7.13.17" "@babel/plugin-transform-dotall-regex" "^7.12.13" @@ -852,14 +853,14 @@ "@babel/plugin-transform-function-name" "^7.12.13" "@babel/plugin-transform-literals" "^7.12.13" "@babel/plugin-transform-member-expression-literals" "^7.12.13" - "@babel/plugin-transform-modules-amd" "^7.14.0" + "@babel/plugin-transform-modules-amd" "^7.14.2" "@babel/plugin-transform-modules-commonjs" "^7.14.0" "@babel/plugin-transform-modules-systemjs" "^7.13.8" "@babel/plugin-transform-modules-umd" "^7.14.0" "@babel/plugin-transform-named-capturing-groups-regex" "^7.12.13" "@babel/plugin-transform-new-target" "^7.12.13" "@babel/plugin-transform-object-super" "^7.12.13" - "@babel/plugin-transform-parameters" "^7.13.0" + "@babel/plugin-transform-parameters" "^7.14.2" "@babel/plugin-transform-property-literals" "^7.12.13" "@babel/plugin-transform-regenerator" "^7.13.15" "@babel/plugin-transform-reserved-words" "^7.12.13" @@ -871,7 +872,7 @@ "@babel/plugin-transform-unicode-escapes" "^7.12.13" "@babel/plugin-transform-unicode-regex" "^7.12.13" "@babel/preset-modules" "^0.1.4" - "@babel/types" "^7.14.0" + "@babel/types" "^7.14.2" babel-plugin-polyfill-corejs2 "^0.2.0" babel-plugin-polyfill-corejs3 "^0.2.0" babel-plugin-polyfill-regenerator "^0.2.0" @@ -914,32 +915,32 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.13.0", "@babel/traverse@^7.13.15", "@babel/traverse@^7.14.0": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.0.tgz#cea0dc8ae7e2b1dec65f512f39f3483e8cc95aef" - integrity sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA== +"@babel/traverse@^7.13.0", "@babel/traverse@^7.13.15", "@babel/traverse@^7.14.0", "@babel/traverse@^7.14.2": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.14.2.tgz#9201a8d912723a831c2679c7ebbf2fe1416d765b" + integrity sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.14.0" - "@babel/helper-function-name" "^7.12.13" + "@babel/generator" "^7.14.2" + "@babel/helper-function-name" "^7.14.2" "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.14.0" - "@babel/types" "^7.14.0" + "@babel/parser" "^7.14.2" + "@babel/types" "^7.14.2" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.16", "@babel/types@^7.14.0", "@babel/types@^7.4.4": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.0.tgz#3fc3fc74e0cdad878182e5f66cc6bcab1915a802" - integrity sha512-O2LVLdcnWplaGxiPBz12d0HcdN8QdxdsWYhz5LSeuukV/5mn2xUUc3gBeU4QBYPJ18g/UToe8F532XJ608prmg== +"@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.16", "@babel/types@^7.14.0", "@babel/types@^7.14.2", "@babel/types@^7.4.4": + version "7.14.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.2.tgz#4208ae003107ef8a057ea8333e56eb64d2f6a2c3" + integrity sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw== dependencies: "@babel/helper-validator-identifier" "^7.14.0" to-fast-properties "^2.0.0" -"@braintree/sanitize-url@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@braintree/sanitize-url/-/sanitize-url-5.0.0.tgz#3ba791f37b90e7f6170d252b63aacfcae943c039" - integrity sha512-WmKrB/575EJCzbeSJR3YQ5sET5FaizeljLRw1382qVUeGqzuWBgIS+AF5a0FO51uQTrDpoRgvuHC2IWVsgwkkA== +"@braintree/sanitize-url@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@braintree/sanitize-url/-/sanitize-url-5.0.1.tgz#3c76855aea4a71904a35c92f433462c775583452" + integrity sha512-KzIC8q/UsT8g6bwRAQ0NbOCNxRoGbPKtqGBUtDaN8WN80xqsbHFs8z+Eq0fR0W1wcrcTB5oKNACsrbkK4X+FWA== "@codemirror/commands@^0.18.0": version "0.18.1" @@ -1101,10 +1102,10 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@formatjs/ecma402-abstract@1.7.1": - version "1.7.1" - resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.7.1.tgz#1459a9dad654d5d5ec34765965b8e4f22ad6ff81" - integrity sha512-FjewVLB2DVEVCvvC7IMffzXVhysvi442i6ed0H7qcrT6xtUpO4vr0oZgpOmsv6D9I4Io0GVebIuySwteS/k3gg== +"@formatjs/ecma402-abstract@1.9.1": + version "1.9.1" + resolved "https://registry.yarnpkg.com/@formatjs/ecma402-abstract/-/ecma402-abstract-1.9.1.tgz#5d15c5a687a215ed9de47a577ac7c720a3fe5e00" + integrity sha512-XAJ1ygWKgGEaFuNg3Cf+maJNYEJjl5LjSVZ1iAnSaOKDg/VXa+dDPWhWQP6jimvWv6h9NyDj6Zgh+2qFBeVABw== dependencies: tslib "^2.1.0" @@ -1113,47 +1114,47 @@ resolved "https://registry.yarnpkg.com/@formatjs/fast-memoize/-/fast-memoize-1.1.1.tgz#3006b58aca1e39a98aca213356b42da5d173f26b" integrity sha512-mIqBr5uigIlx13eZTOPSEh2buDiy3BCdMYUtewICREQjbb4xarDiVWoXSnrERM7NanZ+0TAHNXSqDe6HpEFQUg== -"@formatjs/icu-messageformat-parser@2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.0.1.tgz#a3b542542b92958f1cdd090f1cb475cb7cb4e21a" - integrity sha512-GXHsATo6/9OMgrfAuyX86fYPMLeQXDN93TOKXQeW7A7ULCy9eEOp3beNwhrVFxaGIjVy/haLLqHMT36iyhwvCA== +"@formatjs/icu-messageformat-parser@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.0.4.tgz#b54d2be1bf51892fbadd9f13e857fe4ffaa528bf" + integrity sha512-R6tEOyP+GRFuqLI9NQ4Aw6y5K2m7ASLn6Zu+fCu0HRh9IfHnNrvriHUSntmaXpxwSB3gI8eSawmyemKqdSxgtg== dependencies: - "@formatjs/ecma402-abstract" "1.7.1" - "@formatjs/icu-skeleton-parser" "1.2.2" + "@formatjs/ecma402-abstract" "1.9.1" + "@formatjs/icu-skeleton-parser" "1.2.5" tslib "^2.1.0" -"@formatjs/icu-skeleton-parser@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.2.2.tgz#6e9a6eff16e3c7b69d67d40b292d4b499e37228e" - integrity sha512-peBBPIiNzJdPsvEzFGCicD7ARvlcaUYOVZ5dljvzzcHqc5OHlH58OrUNWwYgxFS6Dnb3Ncy4qFwlTdPGTTvw1g== +"@formatjs/icu-skeleton-parser@1.2.5": + version "1.2.5" + resolved "https://registry.yarnpkg.com/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.2.5.tgz#db611b3c1eed743673c29c01a8248a5ff56105a2" + integrity sha512-Y99K8gEOei8dRRjxdV8PX+BFopGtFnc+MyWByhCmb/UbOpn/XbFxz/iM+DpWRnF1GEs5R3tq9RNpFpD6O/hjGg== dependencies: - "@formatjs/ecma402-abstract" "1.7.1" + "@formatjs/ecma402-abstract" "1.9.1" tslib "^2.1.0" -"@formatjs/intl-getcanonicallocales@1.5.10", "@formatjs/intl-getcanonicallocales@^1.5.10": - version "1.5.10" - resolved "https://registry.yarnpkg.com/@formatjs/intl-getcanonicallocales/-/intl-getcanonicallocales-1.5.10.tgz#f57f12f19fd28a241767986b081331f8b26fb18b" - integrity sha512-tFqGxZ9HkAzphupybyCKdWHzL1ge/sY8TtzEK57Hs3RCxrv/y+VxIPrE+Izw2oCFowQBz76cyi0zT6PjHuWArA== +"@formatjs/intl-getcanonicallocales@1.7.0", "@formatjs/intl-getcanonicallocales@^1.5.10": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@formatjs/intl-getcanonicallocales/-/intl-getcanonicallocales-1.7.0.tgz#f864cc8228976599719d0a8212a1e6d7c846b38d" + integrity sha512-3pQjp+WCHrFfkUeSuw//LIx/orcykopZX4U/2kY1jTYhATVJbKdU8Rl5V2/d+fw1naKjKYoIjIXGn85Ti396+A== dependencies: cldr-core "38" tslib "^2.1.0" -"@formatjs/intl-locale@^2.4.24": - version "2.4.24" - resolved "https://registry.yarnpkg.com/@formatjs/intl-locale/-/intl-locale-2.4.24.tgz#c3f9dba15653b79ac7b377bb048a35aeedfc234d" - integrity sha512-+JOwvBRFS/GFuJlWiWbfAzBng0A+ANoGV1LRseXK+4uzp4Sn35GD8M/dfgU1lp2R2dTWpYie2yyoHe4k4aHF6w== +"@formatjs/intl-locale@^2.4.28": + version "2.4.28" + resolved "https://registry.yarnpkg.com/@formatjs/intl-locale/-/intl-locale-2.4.28.tgz#064bb50764393669803aa777b74a18b81d6566b5" + integrity sha512-z20qVhgtHFTCGLDCl/pWs3cdnxGT4whsbjxwfrhyF2Qf0TNYWrJ/y88f3vINJ19iGVY3GJ6bxaRI5d+uyQ/7ig== dependencies: - "@formatjs/ecma402-abstract" "1.7.1" - "@formatjs/intl-getcanonicallocales" "1.5.10" + "@formatjs/ecma402-abstract" "1.9.1" + "@formatjs/intl-getcanonicallocales" "1.7.0" cldr-core "38" tslib "^2.1.0" -"@formatjs/intl-pluralrules@^4.0.18": - version "4.0.18" - resolved "https://registry.yarnpkg.com/@formatjs/intl-pluralrules/-/intl-pluralrules-4.0.18.tgz#da4bda058cce5217691836c4f46ba3e9f25b0eeb" - integrity sha512-qRFITPsNoeXfsiGc97pp8mVgqcC7aQNuXsiJjY9LpXVTkYNfjUP4ZpbYXflM4xoWCXMJNz3ilsrQhZWXy9td5g== +"@formatjs/intl-pluralrules@^4.0.22": + version "4.0.22" + resolved "https://registry.yarnpkg.com/@formatjs/intl-pluralrules/-/intl-pluralrules-4.0.22.tgz#2a56baef93ef4deac7957ee1d945a6f5332c1261" + integrity sha512-4pSxb31AsjZXUjQHid9eJuUJrXqLOH3tgfiryvBfgNoS76cqk0cFUAuTGdC07YQZlVuJ4c3K4rqBlRpFJwn4Mg== dependencies: - "@formatjs/ecma402-abstract" "1.7.1" + "@formatjs/ecma402-abstract" "1.9.1" tslib "^2.1.0" "@fullcalendar/common@5.1.0", "@fullcalendar/common@~5.1.0": @@ -2608,11 +2609,6 @@ "@types/connect" "*" "@types/node" "*" -"@types/chai@^4.2.18": - version "4.2.18" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.18.tgz#0c8e298dbff8205e2266606c1ea5fbdba29b46e4" - integrity sha512-rS27+EkB/RE1Iz3u0XtVL5q36MGDWbgYe7zWiodyKNUnthxY0rukK5V36eiUCtCisB7NN8zKYH6DO2M37qxFEQ== - "@types/chrome@*": version "0.0.119" resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.119.tgz#12a2af96886d0c7210590928729ebf622eb67a58" @@ -2621,10 +2617,10 @@ "@types/filesystem" "*" "@types/har-format" "*" -"@types/chromecast-caf-receiver@^5.0.11": - version "5.0.11" - resolved "https://registry.yarnpkg.com/@types/chromecast-caf-receiver/-/chromecast-caf-receiver-5.0.11.tgz#072aa84363392d83284d4ce091ea51ed588bbe38" - integrity sha512-c5FMxW5rzSZsqy0BU9yrsvZvkBCRFskE3V3jDPK595v6JKa8b1CoS8okXihHji7T2mrZYRUZeImpKe7kLr75lQ== +"@types/chromecast-caf-receiver@5.0.12": + version "5.0.12" + resolved "https://registry.yarnpkg.com/@types/chromecast-caf-receiver/-/chromecast-caf-receiver-5.0.12.tgz#4967f3dabf69a83acd8101bb54fdd10948c3ace0" + integrity sha512-JAw+Ok0Jvc5QmRHl/B6+MY9qOlhaa/0yhi7eM0+WoPOIgLrWcHXAcR9aYcqq5oeWKU0P4kHOnMxpBWZcbHmbOg== "@types/chromecast-caf-sender@^1.0.3": version "1.0.3" @@ -2833,10 +2829,10 @@ dependencies: "@types/geojson" "*" -"@types/marked@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@types/marked/-/marked-1.2.2.tgz#1f858a0e690247ecf3b2eef576f98f86e8d960d4" - integrity sha512-wLfw1hnuuDYrFz97IzJja0pdVsC0oedtS4QsKH1/inyW9qkLQbXgMUqEQT0MVtUBx3twjWeInUfjQbhBVLECXw== +"@types/marked@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/marked/-/marked-2.0.3.tgz#c8ea93684e530cc3b667d3e7226556dd0844ad1f" + integrity sha512-lbhSN1rht/tQ+dSWxawCzGgTfxe9DB31iLgiT1ZVT5lshpam/nyOA1m3tKHRoNPctB2ukSL22JZI5Fr+WI/zYg== "@types/mime@*": version "2.0.3" @@ -2883,11 +2879,6 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c" integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== -"@types/resize-observer-browser@^0.1.3": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@types/resize-observer-browser/-/resize-observer-browser-0.1.3.tgz#5cca2445e6fc34a380760bd6ef8c492863469c47" - integrity sha512-3tGjLIDH8L57fWOfC7NVn/BbGQD7pXwbkk2+8Z4hK/S7kOIv1MUN4nkKjfx0qg4ctkukjzp3Bgr/Z+Hq5ZQZTQ== - "@types/resolve@0.0.8": version "0.0.8" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" @@ -2910,13 +2901,6 @@ "@types/mime" "*" "@types/node" "*" -"@types/sinon@^10.0.0": - version "10.0.0" - resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-10.0.0.tgz#eecc3847af03d45ffe53d55aaaaf6ecb28b5e584" - integrity sha512-jDZ55oCKxqlDmoTBBbBBEx+N8ZraUVhggMZ9T5t+6/Dh8/4NiOjSUfpLrPiEwxQDlAe3wpAkoXhWvE6LibtsMQ== - dependencies: - "@sinonjs/fake-timers" "^7.0.4" - "@types/sortablejs@^1.10.6": version "1.10.6" resolved "https://registry.yarnpkg.com/@types/sortablejs/-/sortablejs-1.10.6.tgz#98725ae08f1dfe28b8da0fdf302c417f5ff043c0" @@ -5021,10 +5005,10 @@ colorette@^1.2.1, colorette@^1.2.2: resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== -comlink@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/comlink/-/comlink-4.3.0.tgz#80b3366baccd87897dab3638ebfcfae28b2f87c7" - integrity sha512-mu4KKKNuW8TvkfpW/H88HBPeILubBS6T94BdD1VWBXNXfiyqVtwUCVNO1GeNOBTsIswzsMjWlycYr+77F5b84g== +comlink@^4.3.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/comlink/-/comlink-4.3.1.tgz#0c6b9d69bcd293715c907c33fe8fc45aecad13c5" + integrity sha512-+YbhUdNrpBZggBAHWcgQMLPLH1KDF3wJpeqrCKieWQ8RL7atmgsgTQko1XEBK6PsecfopWNntopJ+ByYG1lRaA== command-line-args@^5.1.1: version "5.1.1" @@ -5325,10 +5309,10 @@ crelt@^1.0.5: resolved "https://registry.yarnpkg.com/crelt/-/crelt-1.0.5.tgz#57c0d52af8c859e354bace1883eb2e1eb182bb94" integrity sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA== -cropperjs@^1.5.7: - version "1.5.7" - resolved "https://registry.yarnpkg.com/cropperjs/-/cropperjs-1.5.7.tgz#b65019725bae1c6285e881fb661b2141fa57025b" - integrity sha512-sGj+G/ofKh+f6A4BtXLJwtcKJgMUsXYVUubfTo9grERiDGXncttefmue/fyQFvn8wfdyoD1KhDRYLfjkJFl0yw== +cropperjs@^1.5.11: + version "1.5.11" + resolved "https://registry.yarnpkg.com/cropperjs/-/cropperjs-1.5.11.tgz#502ae6d8ca098b124de6813601cca70015879fc0" + integrity sha512-SJUeBBhtNBnnn+UrLKluhFRIXLJn7XFPv8QN1j49X5t+BIMwkgvDev541f96bmu8Xe0TgCx3gON22KmY/VddaA== cross-spawn@^5.0.1: version "5.1.0" @@ -6583,6 +6567,11 @@ fast-json-stable-stringify@^2.1.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-levenshtein@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9" + integrity sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk= + fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -7110,16 +7099,17 @@ glob-to-regexp@^0.4.1: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob-watcher@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-5.0.3.tgz#88a8abf1c4d131eb93928994bc4a593c2e5dd626" - integrity sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg== +glob-watcher@^5.0.3: + version "5.0.5" + resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-5.0.5.tgz#aa6bce648332924d9a8489be41e3e5c52d4186dc" + integrity sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw== dependencies: anymatch "^2.0.0" async-done "^1.2.0" chokidar "^2.0.0" is-negated-glob "^1.0.0" just-debounce "^1.0.0" + normalize-path "^3.0.0" object.defaults "^1.1.0" glob2base@^0.0.12: @@ -7267,10 +7257,10 @@ growl@1.10.5: resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== -gulp-cli@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.1.0.tgz#2705143ae744c9e10d894ca621ce0a3933aa2e89" - integrity sha512-txzgdFVlEPShBZus6JJyGyKJoBVDq6Do0ZQgIgx5RAsmhNVTDjymmOxpQvo3c20m66FldilS68ZXj2Q9w5dKbA== +gulp-cli@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.3.0.tgz#ec0d380e29e52aa45e47977f0d32e18fd161122f" + integrity sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A== dependencies: ansi-colors "^1.0.1" archy "^1.0.0" @@ -7280,7 +7270,7 @@ gulp-cli@^2.0.0: copy-props "^2.0.1" fancy-log "^1.3.2" gulplog "^1.0.0" - interpret "^1.1.0" + interpret "^1.4.0" isobject "^3.0.1" liftoff "^3.1.0" matchdep "^2.0.0" @@ -7288,7 +7278,7 @@ gulp-cli@^2.0.0: pretty-hrtime "^1.0.0" replace-homedir "^1.0.0" semver-greatest-satisfied-range "^1.1.0" - v8flags "^3.0.1" + v8flags "^3.2.0" yargs "^7.1.0" gulp-foreach@^0.1.0: @@ -7356,14 +7346,14 @@ gulp-zopfli-green@^3.0.1: stream-to-array "^2.0.2" through2 "^3.0.0" -gulp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/gulp/-/gulp-4.0.0.tgz#95766c601dade4a77ed3e7b2b6dc03881b596366" - integrity sha1-lXZsYB2t5Kd+0+eyttwDiBtZY2Y= +gulp@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/gulp/-/gulp-4.0.2.tgz#543651070fd0f6ab0a0650c6a3e6ff5a7cb09caa" + integrity sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA== dependencies: - glob-watcher "^5.0.0" - gulp-cli "^2.0.0" - undertaker "^1.0.0" + glob-watcher "^5.0.3" + gulp-cli "^2.2.0" + undertaker "^1.2.1" vinyl-fs "^3.0.0" gulplog@^1.0.0: @@ -7482,10 +7472,10 @@ he@1.2.0, he@^1.2.0: resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -hls.js@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-1.0.3.tgz#856aef94108f99772632343994725a9165ef66f6" - integrity sha512-9pNhXI6dTO5rLfdcroj+p8kRGjkDeDtVJsVvCuj3KpyROTA2D0h0sFwBbvXC5h5nbXxvjMf+w6jTeBGYyfjcjQ== +hls.js@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/hls.js/-/hls.js-1.0.4.tgz#1b191f0f49c992e5c22d4a648ac73630d13d3c2e" + integrity sha512-sTea9L0ORE9u5dThUjEhDP4t9YzakEYRyMHEYQctaLZf2X9ihjmUbqKneExQWHXZz2cYQs5ihaKUe8QnrQDp7Q== hmac-drbg@^1.0.1: version "1.0.1" @@ -7813,12 +7803,7 @@ internal-ip@^4.3.0: default-gateway "^4.2.0" ipaddr.js "^1.9.0" -interpret@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" - integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== - -interpret@^1.2.0: +interpret@^1.2.0, interpret@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== @@ -7828,13 +7813,13 @@ interpret@^2.2.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== -intl-messageformat@^9.6.13: - version "9.6.13" - resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-9.6.13.tgz#7c4ace385b3b8cc5010bfd774451ed0c50a73a9b" - integrity sha512-F8OHdgdZYdY3O7TSkQtIGY1qBL7ttbbfIb6g9sgjLw1SQ9SlN3rlaUa1tv9RK3sX0qVkqNLqlPVuOfHlhXpm2Q== +intl-messageformat@^9.6.16: + version "9.6.16" + resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-9.6.16.tgz#2e44203f391632468256de873b99945a37417881" + integrity sha512-EdsdT0izNWH2MTTAXzOJHvv6w14Y9hyjWop8V38SukbAWcMz9CATp6qQC3x7n3U5xYUhWWDHFP0SEuz/rp33+w== dependencies: "@formatjs/fast-memoize" "1.1.1" - "@formatjs/icu-messageformat-parser" "2.0.1" + "@formatjs/icu-messageformat-parser" "2.0.4" tslib "^2.1.0" into-stream@^4.0.0: @@ -9135,10 +9120,10 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -marked@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/marked/-/marked-2.0.0.tgz#9662bbcb77ebbded0662a7be66ff929a8611cee5" - integrity sha512-NqRSh2+LlN2NInpqTQnS614Y/3NkVMFFU6sJlRFEpxJ/LHuK/qJECH7/fXZjk4VZstPW/Pevjil/VtSONsLc7Q== +marked@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/marked/-/marked-2.0.5.tgz#2d15c759b9497b0e7b5b57f4c2edabe1002ef9e7" + integrity sha512-yfCEUXmKhBPLOzEC7c+tc4XZdIeTdGoRCZakFMkCxodr7wDXqoapIME4wjcpBPJLNyUnKJ3e8rb8wlAgnLnaDw== matchdep@^2.0.0: version "2.0.0" @@ -11481,10 +11466,10 @@ serialize-javascript@^4.0.0: dependencies: randombytes "^2.1.0" -serve-handler@6.1.2: - version "6.1.2" - resolved "https://registry.yarnpkg.com/serve-handler/-/serve-handler-6.1.2.tgz#f05b0421a313fff2d257838cba00cbcc512cd2b6" - integrity sha512-RFh49wX7zJmmOVDcIjiDSJnMH+ItQEvyuYLYuDBVoA/xmQSCuj+uRmk1cmBB5QQlI3qOiWKp6p4DUGY+Z5AB2A== +serve-handler@6.1.3: + version "6.1.3" + resolved "https://registry.yarnpkg.com/serve-handler/-/serve-handler-6.1.3.tgz#1bf8c5ae138712af55c758477533b9117f6435e8" + integrity sha512-FosMqFBNrLyeiIDvP1zgO6YoTzFYHxLDEIavhlmQ+knB2Z7l1t+kGLHkZIDN7UVWqQAmKI3D20A6F6jo3nDd4w== dependencies: bytes "3.0.0" content-disposition "0.5.2" @@ -11518,10 +11503,10 @@ serve-static@1.14.1: parseurl "~1.3.3" send "0.17.1" -serve@^11.3.0: - version "11.3.0" - resolved "https://registry.yarnpkg.com/serve/-/serve-11.3.0.tgz#1d342e13e310501ecf17b6602f1f35da640d6448" - integrity sha512-AU0g50Q1y5EVFX56bl0YX5OtVjUX1N737/Htj93dQGKuHiuLvVB45PD8Muar70W6Kpdlz8aNJfoUqTyAq9EE/A== +serve@^11.3.2: + version "11.3.2" + resolved "https://registry.yarnpkg.com/serve/-/serve-11.3.2.tgz#b905e980616feecd170e51c8f979a7b2374098f5" + integrity sha512-yKWQfI3xbj/f7X1lTBg91fXBP0FqjJ4TEi+ilES5yzH0iKJpN5LjNb1YzIfQg9Rqn4ECUS2SOf2+Kmepogoa5w== dependencies: "@zeit/schemas" "2.6.0" ajv "6.5.3" @@ -11530,7 +11515,7 @@ serve@^11.3.0: chalk "2.4.1" clipboardy "1.2.3" compression "1.7.3" - serve-handler "6.1.2" + serve-handler "6.1.3" update-check "1.5.2" set-blocking@^2.0.0, set-blocking@~2.0.0: @@ -12242,17 +12227,17 @@ term-size@^1.2.0: dependencies: execa "^0.7.0" -terser-webpack-plugin@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.1.1.tgz#7effadee06f7ecfa093dbbd3e9ab23f5f3ed8673" - integrity sha512-5XNNXZiR8YO6X6KhSGXfY0QrGrCRlSwAEjIIrlRQR4W8nP69TaJUlh3bkuac6zzgspiGPfKEHcY295MMVExl5Q== +terser-webpack-plugin@^5.1.1, terser-webpack-plugin@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.1.2.tgz#51d295eb7cc56785a67a372575fdc46e42d5c20c" + integrity sha512-6QhDaAiVHIQr5Ab3XUWZyDmrIPCHMiqJVljMF91YKyqwKkL5QHnYMkrMBy96v9Z7ev1hGhSEw1HQZc2p/s5Z8Q== dependencies: jest-worker "^26.6.2" p-limit "^3.1.0" schema-utils "^3.0.0" serialize-javascript "^5.0.1" source-map "^0.6.1" - terser "^5.5.1" + terser "^5.7.0" terser@^4.6.2: version "4.8.0" @@ -12263,7 +12248,7 @@ terser@^4.6.2: source-map "~0.6.1" source-map-support "~0.5.12" -terser@^5.0.0: +terser@^5.0.0, terser@^5.7.0: version "5.7.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.7.0.tgz#a761eeec206bc87b605ab13029876ead938ae693" integrity sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g== @@ -12272,15 +12257,6 @@ terser@^5.0.0: source-map "~0.7.2" source-map-support "~0.5.19" -terser@^5.5.1: - version "5.6.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.6.0.tgz#138cdf21c5e3100b1b3ddfddf720962f88badcd2" - integrity sha512-vyqLMoqadC1uR0vywqOZzriDYzgEkNJFK4q9GeyOBHIbiECHiWLKcWfbQWAUaPfxkjDhapSlZB9f7fkMrvkVjA== - dependencies: - commander "^2.20.0" - source-map "~0.7.2" - source-map-support "~0.5.19" - text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -12371,10 +12347,10 @@ tinycolor2@^1.4.1: resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8" integrity sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g= -tinykeys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/tinykeys/-/tinykeys-1.1.1.tgz#2535e8b24c8e2be447dd0ee1cff656ef435cd63d" - integrity sha512-YEA1TGMlkMabXI0NGddRFti+c1eMO2QP7wefwibSz0Pip8sA+d99yX5Pp7pK7wUeTKmrF4ys4XZVz44YydlTYg== +tinykeys@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/tinykeys/-/tinykeys-1.1.3.tgz#5881cb0af2b1426417e43ae932c312d9c7261d15" + integrity sha512-18kivCMdM70c4Zz8FE/BeBS69iJ3xSd3+LJ9kzXhWHZj/gqtMVu+vXaVZG5+3HEnKWk6rdrFgObyNaYUFqIaWA== tmp@^0.0.33: version "0.0.33" @@ -12668,16 +12644,17 @@ undertaker-registry@^1.0.0: resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" integrity sha1-XkvaMI5KiirlhPm5pDWaSZglzFA= -undertaker@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.2.0.tgz#339da4646252d082dc378e708067299750e11b49" - integrity sha1-M52kZGJS0ILcN45wgGcpl1DhG0k= +undertaker@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.3.0.tgz#363a6e541f27954d5791d6fa3c1d321666f86d18" + integrity sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg== dependencies: arr-flatten "^1.0.1" arr-map "^2.0.0" bach "^1.0.0" collection-map "^1.0.0" es6-weak-map "^2.0.1" + fast-levenshtein "^1.0.0" last-run "^1.1.0" object.defaults "^1.0.0" object.reduce "^1.0.0" @@ -12866,10 +12843,10 @@ v8-compile-cache@^2.2.0: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== -v8flags@^3.0.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.2.tgz#fc5cd0c227428181e6c29b2992e4f8f1da5e0c9f" - integrity sha512-MtivA7GF24yMPte9Rp/BWGCYQNaUj86zeYxV/x2RRJMKagImbbv3u8iJC57lNhWLPcGLJmHcHmFWkNsplbbLWw== +v8flags@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.2.0.tgz#b243e3b4dfd731fa774e7492128109a0fe66d656" + integrity sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg== dependencies: homedir-polyfill "^1.0.1" @@ -12971,10 +12948,10 @@ vinyl@^2.0.0, vinyl@^2.1.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" -vis-data@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/vis-data/-/vis-data-7.1.1.tgz#a38b38efcc0b721181ddaa4f4359edfd75623825" - integrity sha512-Z5+caySDqoKL9yxbI3c/CKmUcSvROSZstuvwxbOsUpdxHpxFYEUgxC1EH4lSB1ykEaM54MVMM1UcwB9oNaWFlw== +vis-data@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/vis-data/-/vis-data-7.1.2.tgz#b7d076ac79cb54f7c5e9c80f5b03b93cc8cc1fda" + integrity sha512-RPSegFxEcnp3HUEJSzhS2vBdbJ2PSsrYYuhRlpHp2frO/MfRtTYbIkkLZmPkA/Sg3pPfBlR235gcoKbtdm4mbw== vis-network@^8.5.4: version "8.5.4" @@ -13035,10 +13012,10 @@ vue2-daterange-picker@^0.5.1: dependencies: vue "^2.6.10" -vue@^2.6.10, vue@^2.6.11: - version "2.6.11" - resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.11.tgz#76594d877d4b12234406e84e35275c6d514125c5" - integrity sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ== +vue@^2.6.10, vue@^2.6.12: + version "2.6.12" + resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.12.tgz#f5ebd4fa6bd2869403e29a896aed4904456c9123" + integrity sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg== w3c-keyname@^2.2.4: version "2.2.4" From f7ef8180e413d736dfca151a615e1f26046387f6 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 26 May 2021 12:43:59 +0200 Subject: [PATCH 109/117] Guard for undefined item in quick bar (#9259) --- src/dialogs/quick-bar/ha-quick-bar.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dialogs/quick-bar/ha-quick-bar.ts b/src/dialogs/quick-bar/ha-quick-bar.ts index 1741d63ec8..e00565e59a 100644 --- a/src/dialogs/quick-bar/ha-quick-bar.ts +++ b/src/dialogs/quick-bar/ha-quick-bar.ts @@ -223,6 +223,9 @@ export class QuickBar extends LitElement { } private _renderItem(item: QuickBarItem, index?: number) { + if (!item) { + return undefined; + } return isCommandItem(item) ? this._renderCommandItem(item, index) : this._renderEntityItem(item as EntityItem, index); From 27845a7345b97c457ed62c0857942699e8c00b25 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 26 May 2021 12:44:10 +0200 Subject: [PATCH 110/117] Fix logbook height (#9258) --- src/dialogs/more-info/ha-more-info-logbook.ts | 9 +++------ src/panels/logbook/ha-logbook.ts | 4 ++++ src/panels/lovelace/cards/hui-logbook-card.ts | 1 - 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dialogs/more-info/ha-more-info-logbook.ts b/src/dialogs/more-info/ha-more-info-logbook.ts index 16f6097d8b..3a307e9370 100644 --- a/src/dialogs/more-info/ha-more-info-logbook.ts +++ b/src/dialogs/more-info/ha-more-info-logbook.ts @@ -8,7 +8,7 @@ import "../../components/state-history-charts"; import { getLogbookData, LogbookEntry } from "../../data/logbook"; import { loadTraceContexts, TraceContexts } from "../../data/trace"; import "../../panels/logbook/ha-logbook"; -import { haStyle, haStyleScrollbar } from "../../resources/styles"; +import { haStyle } from "../../resources/styles"; import { HomeAssistant } from "../../types"; import { closeDialog } from "../make-dialog-manager"; @@ -52,7 +52,6 @@ export class MoreInfoLogbook extends LitElement { : this._logbookEntries.length ? html` Date: Wed, 26 May 2021 15:05:01 +0200 Subject: [PATCH 111/117] Fix chartjs deprecation warnings (#9261) --- src/components/state-history-chart-timeline.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/state-history-chart-timeline.js b/src/components/state-history-chart-timeline.js index 12fe3ca416..816425aa25 100644 --- a/src/components/state-history-chart-timeline.js +++ b/src/components/state-history-chart-timeline.js @@ -194,7 +194,10 @@ class StateHistoryChartTimeline extends LocalizeMixin(PolymerElement) { invertOnOff, ]); } - datasets.push({ data: dataRow, entity_id: stateInfo.entity_id }); + datasets.push({ + data: dataRow, + entity_id: stateInfo.entity_id, + }); labels.push(entityDisplay); }); @@ -234,6 +237,9 @@ class StateHistoryChartTimeline extends LocalizeMixin(PolymerElement) { fontStyle: "bold", }, }, + categoryPercentage: undefined, + barPercentage: undefined, + time: { format: undefined }, }, ], yAxes: [ @@ -242,10 +248,17 @@ class StateHistoryChartTimeline extends LocalizeMixin(PolymerElement) { yaxe.maxWidth = yaxe.chart.width * 0.18; }, position: this._computeRTL ? "right" : "left", + categoryPercentage: undefined, + barPercentage: undefined, + time: { format: undefined }, }, ], }, }, + datasets: { + categoryPercentage: 0.8, + barPercentage: 0.9, + }, data: { labels: labels, datasets: datasets, From 5f56040c64ae380b93b7155c0ec4a372a64158d6 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Wed, 26 May 2021 15:29:51 +0200 Subject: [PATCH 112/117] Add friendly_name to dev tools "Entity" column + fuzzy search (#7582) --- src/common/string/filter/filter.ts | 4 +- src/common/string/filter/sequence-matching.ts | 2 +- .../state/developer-tools-state.js | 85 +++++++++++++++---- 3 files changed, 70 insertions(+), 21 deletions(-) diff --git a/src/common/string/filter/filter.ts b/src/common/string/filter/filter.ts index ff42c20393..fc99bc10b8 100644 --- a/src/common/string/filter/filter.ts +++ b/src/common/string/filter/filter.ts @@ -92,7 +92,7 @@ function isUpperCaseAtPos(pos: number, word: string, wordLow: string): boolean { return word[pos] !== wordLow[pos]; } -function isPatternInWord( +export function isPatternInWord( patternLow: string, patternPos: number, patternLen: number, @@ -121,7 +121,7 @@ enum Arrow { } /** - * An array representating a fuzzy match. + * An array representing a fuzzy match. * * 0. the score * 1. the offset at which matching started diff --git a/src/common/string/filter/sequence-matching.ts b/src/common/string/filter/sequence-matching.ts index 77edc39805..d502cec350 100644 --- a/src/common/string/filter/sequence-matching.ts +++ b/src/common/string/filter/sequence-matching.ts @@ -5,7 +5,7 @@ import { fuzzyScore } from "./filter"; * in that order, allowing for skipping. Ex: "chdr" exists in "chandelier") * * @param {string} filter - Sequence of letters to check for - * @param {string} word - Word to check for sequence + * @param {ScorableTextItem} item - Item against whose strings will be checked * * @return {number} Score representing how well the word matches the filter. Return of 0 means no match. */ diff --git a/src/panels/developer-tools/state/developer-tools-state.js b/src/panels/developer-tools/state/developer-tools-state.js index d860fa947b..ee2437bed6 100644 --- a/src/panels/developer-tools/state/developer-tools-state.js +++ b/src/panels/developer-tools/state/developer-tools-state.js @@ -11,6 +11,7 @@ import { html } from "@polymer/polymer/lib/utils/html-tag"; import { PolymerElement } from "@polymer/polymer/polymer-element"; import { dump, load } from "js-yaml"; import { formatDateTimeWithSeconds } from "../../../common/datetime/format_date_time"; +import { isPatternInWord } from "../../../common/string/filter/filter"; import { computeRTL } from "../../../common/util/compute_rtl"; import { copyToClipboard } from "../../../common/util/copy-clipboard"; import "../../../components/entity/ha-entity-picker"; @@ -91,6 +92,12 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { --mdc-icon-size: 20px; padding: 4px; cursor: pointer; + flex-shrink: 0; + margin-right: 8px; + } + .entities td:nth-child(1) { + min-width: 300px; + width: 30%; } .entities td:nth-child(3) { white-space: pre-wrap; @@ -101,6 +108,15 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { color: var(--primary-color); } + .entities .id-name-container { + display: flex; + flex-direction: column; + } + .entities .id-name-row { + display: flex; + align-items: center; + } + :host([narrow]) .state-wrapper { flex-direction: column; } @@ -219,19 +235,30 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {