From 55038534457ad2de80e4b5d8399f4be61595189d Mon Sep 17 00:00:00 2001 From: HomeAssistant Azure Date: Fri, 15 May 2020 00:32:48 +0000 Subject: [PATCH 1/8] [ci skip] Translation update --- translations/frontend/ca.json | 3 ++- translations/frontend/en.json | 6 +++--- translations/frontend/es.json | 3 ++- translations/frontend/fr.json | 3 ++- translations/frontend/ja.json | 7 +++++-- translations/frontend/ko.json | 3 ++- translations/frontend/lb.json | 2 +- translations/frontend/nb.json | 3 ++- translations/frontend/pl.json | 9 +++++---- translations/frontend/pt.json | 16 +++++++++++++--- translations/frontend/ro.json | 16 ++++++++++++++-- translations/frontend/ru.json | 3 ++- translations/frontend/zh-Hant.json | 3 ++- 13 files changed, 55 insertions(+), 22 deletions(-) diff --git a/translations/frontend/ca.json b/translations/frontend/ca.json index e28a75773e..b80dd442ed 100644 --- a/translations/frontend/ca.json +++ b/translations/frontend/ca.json @@ -1374,7 +1374,8 @@ "restart_confirm": "Reinicia el Home Assistant per acabar d'eliminar aquesta integració", "settings_button": "Edita la configuració de {integration}", "system_options": "Opcions de sistema", - "system_options_button": "Opcions de sistema de {integration}" + "system_options_button": "Opcions de sistema de {integration}", + "unnamed_entry": "Entrada sense nom" }, "config_flow": { "aborted": "Avortat", diff --git a/translations/frontend/en.json b/translations/frontend/en.json index d835b0012a..bb4a5a937b 100644 --- a/translations/frontend/en.json +++ b/translations/frontend/en.json @@ -617,7 +617,7 @@ "pattern": "Regex pattern for client-side validation", "text": "Text" }, - "platform_not_loaded": "The {platform} integration is not loaded. Please add it your configuration either by adding 'default_config:' or '{platform}:'.", + "platform_not_loaded": "The {platform} integration is not loaded. Please add it your configuration either by adding 'default_config:' or ''{platform}:''.", "required_error_msg": "This field is required", "yaml_not_editable": "The settings of this entity cannot be edited from the UI. Only entities set up from the UI are configurable from the UI." }, @@ -2285,8 +2285,8 @@ "views": { "confirm_delete": "Delete view?", "confirm_delete_existing_cards": "Deleting this view will also remove the cards", - "confirm_delete_existing_cards_text": "Are you sure you want to delete your '{name}' view? The view contains {number} cards that will be deleted. This action cannot be undone.", - "confirm_delete_text": "Are you sure you want to delete your '{name}' view?" + "confirm_delete_existing_cards_text": "Are you sure you want to delete your ''{name}'' view? The view contains {number} cards that will be deleted. This action cannot be undone.", + "confirm_delete_text": "Are you sure you want to delete your ''{name}'' view?" }, "warning": { "attribute_not_found": "Attribute {attribute} not available in: {entity}", diff --git a/translations/frontend/es.json b/translations/frontend/es.json index 4582efcb6c..31558a169c 100644 --- a/translations/frontend/es.json +++ b/translations/frontend/es.json @@ -1374,7 +1374,8 @@ "restart_confirm": "Reinicia Home Assistant para terminar de eliminar esta integración.", "settings_button": "Editar configuración para {integration}", "system_options": "Opciones del sistema", - "system_options_button": "Opciones del sistema para {integration}" + "system_options_button": "Opciones del sistema para {integration}", + "unnamed_entry": "Entrada sin nombre" }, "config_flow": { "aborted": "Abortado", diff --git a/translations/frontend/fr.json b/translations/frontend/fr.json index c7d7b5f742..35712a95b6 100644 --- a/translations/frontend/fr.json +++ b/translations/frontend/fr.json @@ -1374,7 +1374,8 @@ "restart_confirm": "Redémarrer Home Assistant pour terminer la suppression de cette intégration", "settings_button": "Modifier les paramètres pour {integration}", "system_options": "Options système", - "system_options_button": "Options système pour {integration}" + "system_options_button": "Options système pour {integration}", + "unnamed_entry": "Entrée sans nom" }, "config_flow": { "aborted": "Abandonné", diff --git a/translations/frontend/ja.json b/translations/frontend/ja.json index 7034f12c0b..681f56b25a 100644 --- a/translations/frontend/ja.json +++ b/translations/frontend/ja.json @@ -862,7 +862,8 @@ "rename": "名前を変更", "settings_button": "{integration} の設定を編集", "system_options": "システムオプション", - "system_options_button": "{integration} のシステムオプション" + "system_options_button": "{integration} のシステムオプション", + "unnamed_entry": "名前のないエントリ" }, "config_flow": { "aborted": "中止", @@ -1058,7 +1059,8 @@ }, "validation": { "check_config": "設定を確認", - "heading": "設定の検証" + "heading": "設定の検証", + "valid": "設定は有効です!" } } }, @@ -1157,6 +1159,7 @@ }, "info": { "frontend_version": "フロントエンドバージョン: {version} - {type}", + "issues": "問題", "path_configuration": "ディスク上に configuration.yaml へのパス: {path}", "server": "サーバー", "system_health_error": "「システムの正常性」コンポーネントが有効されていません、configuration.yaml に 'system_health:' を追加してください。", diff --git a/translations/frontend/ko.json b/translations/frontend/ko.json index 69367ae601..18fa92de81 100644 --- a/translations/frontend/ko.json +++ b/translations/frontend/ko.json @@ -1374,7 +1374,8 @@ "restart_confirm": "통합 구성요소 제거 완료를 위해 Home Assistant 웹 페이지를 다시 불러옵니다", "settings_button": "{integration} 설정 편집", "system_options": "시스템 옵션", - "system_options_button": "{integration} 시스템 옵션" + "system_options_button": "{integration} 시스템 옵션", + "unnamed_entry": "이름이 없는 항목" }, "config_flow": { "aborted": "취소됨", diff --git a/translations/frontend/lb.json b/translations/frontend/lb.json index 8953e56672..318036fe13 100644 --- a/translations/frontend/lb.json +++ b/translations/frontend/lb.json @@ -1411,7 +1411,7 @@ "integration": "Integratioun", "integration_not_found": "Integratioun net fonnt.", "new": "Eng nei Integratioun ariichten", - "no_integrations": "Et gesäit suu ass wéi wann nach keng Integratioun ageriicht ass. Klick de Knäppchen hei ënnen fir déi éischt Integratioun anzeriichten.", + "no_integrations": "Et gesäit sou ass wéi wann nach keng Integratioun ageriicht ass. Klick de Knäppchen hei ënnen fir déi éischt Integratioun anzeriichten.", "none": "Nach näischt konfiguréiert", "none_found": "Keng Integratioune fonnt", "none_found_detail": "Siich Kriterien upassen.", diff --git a/translations/frontend/nb.json b/translations/frontend/nb.json index a4e5afd612..de3a92c307 100644 --- a/translations/frontend/nb.json +++ b/translations/frontend/nb.json @@ -1374,7 +1374,8 @@ "restart_confirm": "Start Home Assistant på nytt for å fullføre fjerningen av denne integrasjonen", "settings_button": "Rediger innstillinger for {integration}", "system_options": "Systemalternativer", - "system_options_button": "Systemalternativer for {integration}" + "system_options_button": "Systemalternativer for {integration}", + "unnamed_entry": "Ikke navngitt oppføring" }, "config_flow": { "aborted": "Avbrutt", diff --git a/translations/frontend/pl.json b/translations/frontend/pl.json index c34204bb0f..d917d6fe3c 100644 --- a/translations/frontend/pl.json +++ b/translations/frontend/pl.json @@ -420,7 +420,7 @@ "actions": { "cancel": "anuluj", "finish": "koniec", - "pause": "pauza", + "pause": "wstrzymaj", "start": "start" } }, @@ -652,10 +652,10 @@ "commands": "Polecenia odkurzacza:", "fan_speed": "Prędkość wentylatora", "locate": "Zlokalizuj", - "pause": "Pauza", + "pause": "Wstrzymaj", "return_home": "Powrót do domu", "start": "Start", - "start_pause": "Start/Pauza", + "start_pause": "Start/Wstrzymaj", "status": "Status", "stop": "Zatrzymaj" } @@ -1374,7 +1374,8 @@ "restart_confirm": "Zrestartuj Home Assistant'a, aby zakończyć usuwanie tej integracji", "settings_button": "Edytuj ustawienia dla {integration}", "system_options": "Opcje systemowe", - "system_options_button": "Opcje systemowe dla {integration}" + "system_options_button": "Opcje systemowe dla {integration}", + "unnamed_entry": "Nienazwany wpis" }, "config_flow": { "aborted": "Przerwano", diff --git a/translations/frontend/pt.json b/translations/frontend/pt.json index 3f9b22b81a..39dfc7b25f 100644 --- a/translations/frontend/pt.json +++ b/translations/frontend/pt.json @@ -652,6 +652,7 @@ "fan_speed": "Velocidade do ventilador", "locate": "Localizar", "pause": "Pausa", + "return_home": "Regresso à base", "start": "Iniciar", "start_pause": "Iniciar / Pausar", "status": "Estado", @@ -1366,7 +1367,8 @@ "restart_confirm": "Reinicie o Home Assistant para concluir a remoção desta integração", "settings_button": "Editar configurações para {integration}", "system_options": "Opções do sistema", - "system_options_button": "Opções do sistema para {integration}" + "system_options_button": "Opções do sistema para {integration}", + "unnamed_entry": "Entrada sem nome" }, "config_flow": { "aborted": "Abortado", @@ -1706,6 +1708,11 @@ "group_binding": { "bind_button_help": "Vincule o grupo selecionado aos clusters de dispositivos selecionados.", "bind_button_label": "Vincular grupo", + "cluster_selection_help": "Selecione clusters para vincular ao grupo selecionado.", + "group_picker_help": "Selecione um grupo para emitir um comando de vinculação.", + "group_picker_label": "Grupos vinculáveis", + "header": "Vinculação de Grupos", + "introduction": "Vincule e desvincule grupos.", "unbind_button_help": "Desvincular o grupo selecionado dos clusters de dispositivos selecionados.", "unbind_button_label": "Desvincular grupo" }, @@ -1776,6 +1783,7 @@ "edit_home_zone": "O raio da zona casa ainda não pode ser editado a partir do frontend. Arraste o marcador no mapa para mover a zona inicial.", "edit_home_zone_narrow": "O raio da zona casa ainda não pode ser editado a partir do frontend. A localização pode ser modificada a partir da configuração geral.", "go_to_core_config": "Ir para a configuração geral?", + "home_zone_core_config": "A localização da sua zona \"casa\" é editável na página de configuração geral. O raio dessa zona ainda não pode ser editado a partir do frontend. Deseja ir para a configuração geral?", "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ção.", "no_zones_created_yet": "Parece que você ainda não criou nenhuma zona." }, @@ -1954,6 +1962,7 @@ }, "lovelace": { "add_entities": { + "generated_unsupported": "Você só pode usar esta função quando tiver assumido o controlo do IU Lovelace.", "saving_failed": "Falha ao salvar a configuração da interface Lovelace.", "yaml_unsupported": "Você não pode usar esta função ao usar o Lovelace IU no modo YAML." }, @@ -2203,6 +2212,7 @@ }, "raw_editor": { "confirm_remove_config_text": "Iremos gerar automaticamente as suas vistas do Lovelace UI com as suas áreas e dispositivos se você remover a sua configuração do Lovelace UI.", + "confirm_remove_config_title": "Tem a certeza que deseja remover a configuração do interface de utilizador do Lovelace? Iremos gerar automaticamente as suas vistas do IU Lovelace com as suas áreas e dispositivos.", "confirm_unsaved_changes": "Existem alterações não guardadas. De certeza de que quer sair?", "confirm_unsaved_comments": "A sua configuração contém comentário(s), eles não serão salvos. Deseja continuar?", "error_invalid_config": "A sua configuração não é válida: {error}", @@ -2220,7 +2230,7 @@ "close": "Fechar", "empty_config": "Começar com um painel de instrumentos vazio", "header": "Assumir controle sobre a interface do Lovelace", - "para": "Por omissão o Home Assistant irá manter a sua interface de utilizador, atualizando-a sempre que uma nova entidade ou novos componentes Lovelace fiquem disponíveis. Se assumir o controlo, não faremos mais alterações automáticas por si.", + "para": "Por omissão o Home Assistant irá manter a sua interface de utilizador, atualizando-a sempre que uma nova entidade ou novos componentes IU Lovelace fiquem disponíveis. Se assumir o controlo, não faremos mais alterações automáticas por si. Poderá sempre criar um novo dashboard na configuração para fazer testes.", "para_sure": "Tem certeza que deseja assumir o controlo sobre a interface de utilizador?", "save": "Assumir o controlo", "yaml_config": "Para o ajudar a começar, aqui está a actual configuração deste dashboard:", @@ -2346,7 +2356,7 @@ "data": { "password": "Palavra-passe para API" }, - "description": "Por favor, insira a palavra-passe da API na sua configuração http:" + "description": "Por favor, insira a palavra-passe da API na sua configuração HTTP:" }, "mfa": { "data": { diff --git a/translations/frontend/ro.json b/translations/frontend/ro.json index f570ef5f49..9e44c709e8 100644 --- a/translations/frontend/ro.json +++ b/translations/frontend/ro.json @@ -992,7 +992,9 @@ "edit_requires_storage": "Editorul a fost dezactivat deoarece configurația a fost stocata în configuration.yaml.", "elevation": "Altitudine", "elevation_meters": "metri", + "external_url": "URL extern", "imperial_example": "Fahrenheit, livre", + "internal_url": "URL intern", "latitude": "Latitudine", "location_name": "Numele instalarii Home Assistant", "longitude": "Longitudine", @@ -1058,6 +1060,7 @@ }, "delete": "Șterge", "description": "Gestionați dispozitivele conectate", + "device_info": "Informații despre dispozitiv", "device_not_found": "Dispozitivul nu a fost găsit.", "entities": { "add_entities_lovelace": "Adăugați la Lovelace", @@ -1170,7 +1173,8 @@ "options": "Opțiuni", "rename": "Redenumire", "restart_confirm": "Reporniți Home Assistant pentru a termina eliminarea acestei integrări", - "system_options": "Opțiuni de sistem" + "system_options": "Opțiuni de sistem", + "unnamed_entry": "Intrare anonimă" }, "config_flow": { "aborted": "Anulat", @@ -1574,6 +1578,7 @@ "events": { "alert_event_type": "Tipul de eveniment este un câmp obligatoriu", "available_events": "Evenimente disponibile", + "documentation": "Documentarea evenimentelor.", "fire_event": "Declansare eveniment", "listening_to": "Ascultand", "start_listening": "Incepe sa asculti", @@ -1583,14 +1588,19 @@ }, "info": { "built_using": "Construit folosind", + "documentation": "Documentație", "frontend": "front-end-ui", "icons_by": "Icoane ca", + "integrations": "Integrări", + "issues": "Probleme", "license": "Publicat sub licenta Apache 2.0", "server": "Server", "source": "Sursă:", "title": "Info" }, "logs": { + "clear": "Şterge", + "refresh": "Reîmprospătare", "title": "Jurnale" }, "mqtt": { @@ -1726,6 +1736,7 @@ "manual": "Manual", "manual_description": "Trebuie să adăugați un card personalizat sau doriți doar să scrieți manual yaml?", "no_theme": "Nicio temă", + "secondary_info_attribute": "Atribut informații secundare", "state": "Stare" }, "glance": { @@ -1760,7 +1771,8 @@ "description": "Cardul Vertical Stack vă permite să grupați mai multe carduri, astfel încât acestea să stea întotdeauna în aceeași coloană." }, "weather-forecast": { - "description": "Cardul Prognoza meteo afișează vremea. Foarte util pentru a include pe interfețele pe care oamenii le afișează pe perete." + "description": "Cardul Prognoza meteo afișează vremea. Foarte util pentru a include pe interfețele pe care oamenii le afișează pe perete.", + "show_forecast": "Afișați prognoza" } }, "cardpicker": { diff --git a/translations/frontend/ru.json b/translations/frontend/ru.json index 557ec2adc2..e19372d34d 100644 --- a/translations/frontend/ru.json +++ b/translations/frontend/ru.json @@ -1374,7 +1374,8 @@ "restart_confirm": "Перезапустите Home Assistant, чтобы завершить удаление этой интеграции", "settings_button": "Настройки интеграции {integration}", "system_options": "Настройки интеграции", - "system_options_button": "Системные параметры интеграции {integration}" + "system_options_button": "Системные параметры интеграции {integration}", + "unnamed_entry": "Без названия" }, "config_flow": { "aborted": "Отменено", diff --git a/translations/frontend/zh-Hant.json b/translations/frontend/zh-Hant.json index 8268a82d55..6add0ed670 100644 --- a/translations/frontend/zh-Hant.json +++ b/translations/frontend/zh-Hant.json @@ -1374,7 +1374,8 @@ "restart_confirm": "重啟 Home Assistant 以完成此整合移動", "settings_button": "編輯 {integration} 設定", "system_options": "系統選項", - "system_options_button": "{integration} 系統選項" + "system_options_button": "{integration} 系統選項", + "unnamed_entry": "未命名物件" }, "config_flow": { "aborted": "已中止", From b61cf60faf6a170a5f4271f4ab8940416f9d649b Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 15 May 2020 09:19:24 +0200 Subject: [PATCH 2/8] Migrate card preview to UpdatingElement (#5884) --- .../lovelace/cards/hui-thermostat-card.ts | 24 +--- .../editor/card-editor/hui-card-preview.ts | 107 +++++++++--------- .../card-editor/hui-dialog-edit-card.ts | 1 + 3 files changed, 61 insertions(+), 71 deletions(-) diff --git a/src/panels/lovelace/cards/hui-thermostat-card.ts b/src/panels/lovelace/cards/hui-thermostat-card.ts index b9ae0b4503..b92c0eca22 100644 --- a/src/panels/lovelace/cards/hui-thermostat-card.ts +++ b/src/panels/lovelace/cards/hui-thermostat-card.ts @@ -248,19 +248,12 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { } protected shouldUpdate(changedProps: PropertyValues): boolean { - if (changedProps.has("_setTemp")) { - return true; - } return hasConfigOrEntityChanged(this, changedProps); } protected updated(changedProps: PropertyValues): void { super.updated(changedProps); - if (changedProps.has("_setTemp")) { - this.rescale_svg(); - } - if ( !this._config || !this.hass || @@ -283,23 +276,18 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard { applyThemesOnElement(this, this.hass.themes, this._config.theme); } - const stateObj = this.hass!.states[this._config!.entity]; + const stateObj = this.hass.states[this._config.entity]; if (!stateObj) { return; } - const newTemp = this._getSetTemp(stateObj); - if ( - Array.isArray(this._setTemp) && - Array.isArray(newTemp) && - (this._setTemp[0] !== newTemp[0] || this._setTemp[1] !== newTemp[1]) - ) { - this._setTemp = newTemp; - } else if (this._setTemp !== newTemp) { - this._setTemp = newTemp; + + if (!oldHass || oldHass.states[this._config.entity] !== stateObj) { + this._setTemp = this._getSetTemp(stateObj); + this._rescale_svg(); } } - private rescale_svg() { + private _rescale_svg() { // Set the viewbox of the SVG containing the set temperature to perfectly // fit the text // That way it will auto-scale correctly 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 7066b4f2c6..82599dd271 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-preview.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-preview.ts @@ -4,16 +4,16 @@ import { LovelaceCardConfig } from "../../../../data/lovelace"; import { HomeAssistant } from "../../../../types"; import { createCardElement } from "../../create-element/create-card-element"; import { LovelaceCard } from "../../types"; -import { ConfigError } from "../types"; import { createErrorCardConfig } from "../../create-element/create-element-base"; +import { property, PropertyValues, UpdatingElement } from "lit-element"; -export class HuiCardPreview extends HTMLElement { - private _hass?: HomeAssistant; +export class HuiCardPreview extends UpdatingElement { + @property() public hass?: HomeAssistant; + + @property() public config?: LovelaceCardConfig; private _element?: LovelaceCard; - private _config?: LovelaceCardConfig; - private get _error() { return this._element?.tagName === "HUI-ERROR-CARD"; } @@ -22,59 +22,60 @@ export class HuiCardPreview extends HTMLElement { super(); this.addEventListener("ll-rebuild", () => { this._cleanup(); - if (this._config) { - this.config = this._config; + if (this.config) { + this._createCard(this.config); } }); } - set hass(hass: HomeAssistant) { - if (!this._hass || this._hass.language !== hass.language) { - this.style.direction = computeRTL(hass) ? "rtl" : "ltr"; - } + protected update(changedProperties: PropertyValues) { + super.update(changedProperties); - this._hass = hass; - if (this._element) { - this._element.hass = hass; - } - } + if (changedProperties.has("config")) { + const oldConfig = changedProperties.get("config") as + | undefined + | LovelaceCardConfig; - set error(error: ConfigError) { - this._createCard( - createErrorCardConfig(`${error.type}: ${error.message}`, undefined) - ); - } - - set config(configValue: LovelaceCardConfig) { - const curConfig = this._config; - this._config = configValue; - - if (!configValue) { - this._cleanup(); - return; - } - - if (!configValue.type) { - this._createCard( - createErrorCardConfig("No card type found", configValue) - ); - return; - } - - if (!this._element) { - this._createCard(configValue); - return; - } - - // in case the element was an error element we always want to recreate it - if (!this._error && curConfig && configValue.type === curConfig.type) { - try { - this._element.setConfig(configValue); - } catch (err) { - this._createCard(createErrorCardConfig(err.message, configValue)); + if (!this.config) { + this._cleanup(); + return; + } + + if (!this.config.type) { + this._createCard( + createErrorCardConfig("No card type found", this.config) + ); + return; + } + + if (!this._element) { + this._createCard(this.config); + return; + } + + // in case the element was an error element we always want to recreate it + if (!this._error && oldConfig && this.config.type === oldConfig.type) { + try { + this._element.setConfig(this.config); + } catch (err) { + this._createCard(createErrorCardConfig(err.message, this.config)); + } + } else { + this._createCard(this.config); + } + } + + if (changedProperties.has("hass")) { + const oldHass = changedProperties.get("hass") as + | HomeAssistant + | undefined; + if (!oldHass || oldHass.language !== this.hass!.language) { + this.style.direction = computeRTL(this.hass!) ? "rtl" : "ltr"; + } + + if (this._element) { + this._element.hass = this.hass; } - } else { - this._createCard(configValue); } } @@ -82,8 +83,8 @@ export class HuiCardPreview extends HTMLElement { this._cleanup(); this._element = createCardElement(configValue); - if (this._hass) { - this._element!.hass = this._hass; + if (this.hass) { + this._element!.hass = this.hass; } this.appendChild(this._element!); 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 1fe8f5194b..1a7434bcd3 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 @@ -25,6 +25,7 @@ import type { ConfigChangedEvent, HuiCardEditor } from "./hui-card-editor"; import "./hui-card-picker"; import "./hui-card-preview"; import type { EditCardDialogParams } from "./show-edit-card-dialog"; +import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable"; declare global { // for fire event From 67e17d40164258d8d7bd094d715cedfff9a6efd7 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 15 May 2020 14:54:23 +0200 Subject: [PATCH 3/8] Fix conditional and custom panel updated > update (#5891) --- src/panels/custom/ha-panel-custom.ts | 3 ++- src/panels/lovelace/components/hui-conditional-base.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/panels/custom/ha-panel-custom.ts b/src/panels/custom/ha-panel-custom.ts index 6de6709a60..b7b2a10c3c 100644 --- a/src/panels/custom/ha-panel-custom.ts +++ b/src/panels/custom/ha-panel-custom.ts @@ -43,7 +43,8 @@ export class HaPanelCustom extends UpdatingElement { this._cleanupPanel(); } - protected updated(changedProps: PropertyValues) { + protected update(changedProps: PropertyValues) { + super.update(changedProps); if (changedProps.has("panel")) { // Clean up old things if we had a panel if (changedProps.get("panel")) { diff --git a/src/panels/lovelace/components/hui-conditional-base.ts b/src/panels/lovelace/components/hui-conditional-base.ts index befba3bab0..b877b3adfb 100644 --- a/src/panels/lovelace/components/hui-conditional-base.ts +++ b/src/panels/lovelace/components/hui-conditional-base.ts @@ -1,4 +1,9 @@ -import { customElement, property, UpdatingElement } from "lit-element"; +import { + customElement, + property, + UpdatingElement, + PropertyValues, +} from "lit-element"; import { HomeAssistant } from "../../../types"; import { ConditionalCardConfig } from "../cards/types"; import { @@ -40,7 +45,8 @@ export class HuiConditionalBase extends UpdatingElement { this._config = config; } - protected update(): void { + protected update(changed: PropertyValues): void { + super.update(changed); if (!this._element || !this.hass || !this._config) { return; } From c88439ba2f7e806b310b3df3ddff2ba3b2aff6f0 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 15 May 2020 14:54:42 +0200 Subject: [PATCH 4/8] Polyfill Intl.PluralRules (#5893) --- package.json | 1 + src/common/translations/localize.ts | 4 ++++ yarn.lock | 12 ++++++++++++ 3 files changed, 17 insertions(+) diff --git a/package.json b/package.json index daa5071e84..de6b2e6d4d 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "author": "Paulus Schoutsen (http://paulusschoutsen.nl)", "license": "Apache-2.0", "dependencies": { + "@formatjs/intl-pluralrules": "^1.5.8", "@fullcalendar/core": "^5.0.0-beta.2", "@fullcalendar/daygrid": "^5.0.0-beta.2", "@material/chips": "7.0.0-canary.d92d8c93e.0", diff --git a/src/common/translations/localize.ts b/src/common/translations/localize.ts index bd864b0448..696a765872 100644 --- a/src/common/translations/localize.ts +++ b/src/common/translations/localize.ts @@ -12,6 +12,10 @@ export interface FormatsType { time: FormatType; } +if (!Intl.PluralRules) { + import("@formatjs/intl-pluralrules/polyfill-locales"); +} + /** * Adapted from Polymer app-localize-behavior. * diff --git a/yarn.lock b/yarn.lock index 9370c1b50b..2f05c6bbd9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1602,6 +1602,13 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@formatjs/intl-pluralrules@^1.5.8": + version "1.5.8" + resolved "https://registry.yarnpkg.com/@formatjs/intl-pluralrules/-/intl-pluralrules-1.5.8.tgz#ad8dd9ec669b8dac0e284d51772a65d92efa4ef9" + integrity sha512-OtL/rgKSSGljpxk2lRUC92ZqmzZjabwXO5zbBh2Bj8OM+z4U3H1Q5iK+ZY4k7a6EAoY7hWCr3F4k7EL8tcnQow== + dependencies: + "@formatjs/intl-utils" "^2.2.5" + "@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" @@ -1614,6 +1621,11 @@ resolved "https://registry.yarnpkg.com/@formatjs/intl-utils/-/intl-utils-2.2.4.tgz#fe62a96799d1f7dbe621fd38a4bd2e5a6a16cb0e" integrity sha512-83fsJywew0o9wQsW3VuEp33HRiFd0qbQDyFFnwZCwk59eLZ33CtKyJ5ofKMrU2KK6hk1zaIdzisrZeoNfmI3Tw== +"@formatjs/intl-utils@^2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@formatjs/intl-utils/-/intl-utils-2.2.5.tgz#eaafd94df3d102ee13e54e80f992a33868a6b1e8" + integrity sha512-p7gcmazKROteL4IECCp03Qrs790fZ8tbemUAjQu0+K0AaAlK49rI1SIFFq3LzDUAqXIshV95JJhRe/yXxkal5g== + "@fullcalendar/core@^5.0.0-beta.2": version "5.0.0-beta.2" resolved "https://registry.yarnpkg.com/@fullcalendar/core/-/core-5.0.0-beta.2.tgz#30a9cbbbf2d6476568f53cfa1c0746d06daa9660" From 67a3f5d87b78a4753ae9eb7afa4cf19a3098e43d Mon Sep 17 00:00:00 2001 From: Zack Arnett Date: Fri, 15 May 2020 11:21:53 -0400 Subject: [PATCH 5/8] Gauge Card: Fix if value is greater than max (#5887) --- src/panels/lovelace/cards/hui-gauge-card.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/cards/hui-gauge-card.ts b/src/panels/lovelace/cards/hui-gauge-card.ts index 9378f4da0f..3297515f53 100644 --- a/src/panels/lovelace/cards/hui-gauge-card.ts +++ b/src/panels/lovelace/cards/hui-gauge-card.ts @@ -131,6 +131,14 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { const sliderBarColor = this._computeSeverity(state); + let value: number | undefined; + + if (this._config.max === null || isNaN(this._config.max!)) { + value = undefined; + } else { + value = Math.min(this._config.max!, state); + } + return html` @@ -243,6 +251,10 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { } private _measureCard() { + if (!this.isConnected) { + return; + } + if (this.offsetWidth < 200) { this.setAttribute("narrow", ""); } else { @@ -257,6 +269,10 @@ class HuiGaugeCard extends LitElement implements LovelaceCard { static get styles(): CSSResult { return css` + :host { + display: block; + } + ha-card { cursor: pointer; height: 100%; From 18a3f212f3807a3d2a4db50daffc2d22c02c975b Mon Sep 17 00:00:00 2001 From: Zack Arnett Date: Fri, 15 May 2020 11:22:38 -0400 Subject: [PATCH 6/8] Calendar Panel: Popup Style (#5895) --- src/panels/calendar/ha-full-calendar.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/panels/calendar/ha-full-calendar.ts b/src/panels/calendar/ha-full-calendar.ts index 0b3bd99871..50c9da53a4 100644 --- a/src/panels/calendar/ha-full-calendar.ts +++ b/src/panels/calendar/ha-full-calendar.ts @@ -323,6 +323,14 @@ class HAFullCalendar extends LitElement { font-family: var(--material-font-family); content: "X"; } + + .fc-popover { + background-color: var(--primary-background-color) !important; + } + + .fc-popover-header { + background-color: var(--secondary-background-color) !important; + } `, ]; } From 5f46679d948f870624454291af8d19d34cd6f9f2 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 15 May 2020 17:56:47 +0200 Subject: [PATCH 7/8] Fix mdc checkbox styling (#5897) --- src/components/ha-checkbox.ts | 15 +-------------- src/resources/styles.ts | 2 ++ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/components/ha-checkbox.ts b/src/components/ha-checkbox.ts index 4c233f061b..713d62d1d9 100644 --- a/src/components/ha-checkbox.ts +++ b/src/components/ha-checkbox.ts @@ -1,7 +1,6 @@ import "@material/mwc-checkbox"; import type { Checkbox } from "@material/mwc-checkbox"; -import { style } from "@material/mwc-checkbox/mwc-checkbox-css"; -import { css, CSSResult, customElement } from "lit-element"; +import { customElement } from "lit-element"; import type { Constructor } from "../types"; const MwcCheckbox = customElements.get("mwc-checkbox") as Constructor; @@ -12,18 +11,6 @@ export class HaCheckbox extends MwcCheckbox { super.firstUpdated(); this.style.setProperty("--mdc-theme-secondary", "var(--primary-color)"); } - - protected static get styles(): CSSResult[] { - return [ - style, - css` - .mdc-checkbox__native-control:enabled:not(:checked):not(:indeterminate) - ~ .mdc-checkbox__background { - border-color: rgba(var(--rgb-primary-text-color), 0.54); - } - `, - ]; - } } declare global { diff --git a/src/resources/styles.ts b/src/resources/styles.ts index 7df001137f..0cfac4ef64 100644 --- a/src/resources/styles.ts +++ b/src/resources/styles.ts @@ -48,6 +48,8 @@ export const derivedStyles = { "material-body-text-color": "var(--primary-text-color)", "material-background-color": "var(--card-background-color)", "material-secondary-background-color": "var(--secondary-background-color)", + "mdc-checkbox-unchecked-color": "rgba(var(--rgb-primary-text-color), 0.54)", + "mdc-checkbox-disabled-color": "var(--disabled-text-color)", }; export const haStyle = css` From 6fe8a87ccadc5c1ece07fe8854a1214a9ee9be12 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 15 May 2020 21:45:59 +0200 Subject: [PATCH 8/8] Bumped version to 20200515.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 60f36c11b0..d4289a61a5 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20200514.1", + version="20200515.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors",