diff --git a/setup.py b/setup.py index 1d1156fb0a..f4a67a95b2 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20190315.1", + version="20190316.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", diff --git a/src/dialogs/more-info/controls/more-info-camera.ts b/src/dialogs/more-info/controls/more-info-camera.ts index aa2a64688d..3fbc56a727 100644 --- a/src/dialogs/more-info/controls/more-info-camera.ts +++ b/src/dialogs/more-info/controls/more-info-camera.ts @@ -58,15 +58,13 @@ class MoreInfoCamera extends UpdatingElement { videoEl.muted = true; // tslint:disable-next-line - let Hls: HLSModule | undefined; - - let hlsSupported = - videoEl.canPlayType("application/vnd.apple.mpegurl") !== ""; + const Hls = ((await import(/* webpackChunkName: "hls.js" */ "hls.js")) as any) + .default as HLSModule; + let hlsSupported = Hls.isSupported(); if (!hlsSupported) { - Hls = ((await import(/* webpackChunkName: "hls.js" */ "hls.js")) as any) - .default as HLSModule; - hlsSupported = Hls.isSupported(); + hlsSupported = + videoEl.canPlayType("application/vnd.apple.mpegurl") !== ""; } if (hlsSupported) { @@ -76,7 +74,7 @@ class MoreInfoCamera extends UpdatingElement { this.stateObj.entity_id ); - if (Hls) { + if (Hls.isSupported()) { this._renderHLSPolyfill(videoEl, Hls, url); } else { this._renderHLSNative(videoEl, url); diff --git a/src/layouts/ha-init-page.ts b/src/layouts/ha-init-page.ts index 3fe02fa785..bca3480dfc 100644 --- a/src/layouts/ha-init-page.ts +++ b/src/layouts/ha-init-page.ts @@ -8,6 +8,7 @@ import { CSSResult, css, } from "lit-element"; +import { removeInitSkeleton } from "../util/init-skeleton"; class HaInitPage extends LitElement { public error?: boolean; @@ -35,6 +36,10 @@ class HaInitPage extends LitElement { `; } + protected firstUpdated() { + removeInitSkeleton(); + } + private _retry() { location.reload(); } diff --git a/src/layouts/hass-router-page.ts b/src/layouts/hass-router-page.ts index 3d5cab0d09..7806defb6a 100644 --- a/src/layouts/hass-router-page.ts +++ b/src/layouts/hass-router-page.ts @@ -52,7 +52,9 @@ export class HassRouterPage extends UpdatingElement { super.update(changedProps); if (!changedProps.has("route")) { - if (this.lastChild) { + // Do not update if we have a currentLoadProm, because that means + // that there is still an old panel shown and we're moving to a new one. + if (this.lastChild && !this._currentLoadProm) { this.updatePageEl(this.lastChild, changedProps); } return; @@ -214,11 +216,11 @@ export class HassRouterPage extends UpdatingElement { const dividerPos = route.path.indexOf("/", 1); return dividerPos === -1 ? { - prefix: route.path, + prefix: route.prefix + route.path, path: "", } : { - prefix: route.path.substr(0, dividerPos), + prefix: route.prefix + route.path.substr(0, dividerPos), path: route.path.substr(dividerPos), }; } diff --git a/src/layouts/partial-panel-resolver.ts b/src/layouts/partial-panel-resolver.ts index 0693e4b1f7..acb67d1982 100644 --- a/src/layouts/partial-panel-resolver.ts +++ b/src/layouts/partial-panel-resolver.ts @@ -7,6 +7,7 @@ import { RouterOptions, RouteOptions, } from "./hass-router-page"; +import { removeInitSkeleton } from "../util/init-skeleton"; const CACHE_COMPONENTS = ["lovelace", "states"]; const COMPONENTS = { @@ -113,11 +114,7 @@ class PartialPanelResolver extends HassRouterPage { this.routerOptions = getRoutes(this.hass!.panels); await this.rebuild(); await this.pageRendered; - - const initEl = document.getElementById("ha-init-skeleton"); - if (initEl) { - initEl.parentElement!.removeChild(initEl); - } + removeInitSkeleton(); } } diff --git a/src/panels/config/area_registry/dialog-area-registry-detail.ts b/src/panels/config/area_registry/dialog-area-registry-detail.ts index caa1ebad43..3119d74ba7 100644 --- a/src/panels/config/area_registry/dialog-area-registry-detail.ts +++ b/src/panels/config/area_registry/dialog-area-registry-detail.ts @@ -44,6 +44,7 @@ class DialogAreaDetail extends LitElement { if (!this._params) { return html``; } + const entry = this._params.entry; const nameInvalid = this._name.trim() === ""; return html`

- ${this._params.entry - ? this._params.entry.name + ${entry + ? entry.name : this.hass.localize( "ui.panel.config.area_registry.editor.default_name" )} @@ -65,17 +66,23 @@ class DialogAreaDetail extends LitElement { ` : ""}
+ ${entry + ? html` +
Area ID: ${entry.area_id}
+ ` + : ""} +
- ${this._params.entry + ${entry ? html` - ${this._params.entry + ${entry ? this.hass.localize( "ui.panel.config.area_registry.editor.update" ) diff --git a/src/panels/config/automation/ha-config-automation.js b/src/panels/config/automation/ha-config-automation.js index 679820e697..f0f4defdeb 100644 --- a/src/panels/config/automation/ha-config-automation.js +++ b/src/panels/config/automation/ha-config-automation.js @@ -18,13 +18,13 @@ class HaConfigAutomation extends PolymerElement { diff --git a/src/panels/config/cloud/ha-config-cloud.js b/src/panels/config/cloud/ha-config-cloud.js index 91de367e5a..e85d7c030b 100644 --- a/src/panels/config/cloud/ha-config-cloud.js +++ b/src/panels/config/cloud/ha-config-cloud.js @@ -11,12 +11,8 @@ import "./ha-config-cloud-login"; import "./ha-config-cloud-register"; import NavigateMixin from "../../../mixins/navigate-mixin"; -const LOGGED_IN_URLS = ["/cloud/account"]; -const NOT_LOGGED_IN_URLS = [ - "/cloud/login", - "/cloud/register", - "/cloud/forgot-password", -]; +const LOGGED_IN_URLS = ["/account"]; +const NOT_LOGGED_IN_URLS = ["/login", "/register", "/forgot-password"]; /* * @appliesMixin NavigateMixin @@ -26,7 +22,7 @@ class HaConfigCloud extends NavigateMixin(PolymerElement) { return html` @@ -121,8 +117,6 @@ class HaConfigCloud extends NavigateMixin(PolymerElement) { } _checkRoute(route) { - if (!route || route.path.substr(0, 6) !== "/cloud") return; - this._debouncer = Debouncer.debounce( this._debouncer, timeOut.after(0), diff --git a/src/panels/config/ha-panel-config.ts b/src/panels/config/ha-panel-config.ts index 8fbb0629b3..0d78f87168 100644 --- a/src/panels/config/ha-panel-config.ts +++ b/src/panels/config/ha-panel-config.ts @@ -121,7 +121,7 @@ class HaPanelConfig extends HassRouterPage { } protected updatePageEl(el) { - el.route = this.route; + el.route = this.routeTail; el.hass = this.hass; el.isWide = this.hass.dockedSidebar ? this._wideSidebar : this._wide; el.cloudStatus = this._cloudStatus; diff --git a/src/panels/config/integrations/ha-config-integrations.js b/src/panels/config/integrations/ha-config-integrations.js index 035ff0dbca..b24a600bb0 100644 --- a/src/panels/config/integrations/ha-config-integrations.js +++ b/src/panels/config/integrations/ha-config-integrations.js @@ -15,7 +15,7 @@ class HaConfigIntegrations extends NavigateMixin(PolymerElement) { return html` @@ -90,12 +90,12 @@ class HaConfigIntegrations extends NavigateMixin(PolymerElement) { ready() { super.ready(); - this._loadData(); this.addEventListener("hass-reload-entries", () => this._loadData()); } connectedCallback() { super.connectedCallback(); + this._loadData(); this.hass.connection .subscribeEvents(() => { diff --git a/src/panels/config/script/ha-config-script.js b/src/panels/config/script/ha-config-script.js index ee6f591825..88a1f0f1af 100644 --- a/src/panels/config/script/ha-config-script.js +++ b/src/panels/config/script/ha-config-script.js @@ -19,13 +19,13 @@ class HaConfigScript extends PolymerElement { diff --git a/src/panels/config/users/ha-config-users.js b/src/panels/config/users/ha-config-users.js index 6778f282cb..53e38bc746 100644 --- a/src/panels/config/users/ha-config-users.js +++ b/src/panels/config/users/ha-config-users.js @@ -19,7 +19,7 @@ class HaConfigUsers extends NavigateMixin(PolymerElement) { return html` @@ -72,8 +72,6 @@ class HaConfigUsers extends NavigateMixin(PolymerElement) { } _checkRoute(route) { - if (!route || route.path.substr(0, 6) !== "/users") return; - // prevent list getting under toolbar fireEvent(this, "iron-resize"); @@ -81,8 +79,8 @@ class HaConfigUsers extends NavigateMixin(PolymerElement) { this._debouncer, timeOut.after(0), () => { - if (route.path === "/users") { - this.navigate("/config/users/picker", true); + if (route.path === "") { + this.navigate(`${route.prefix}/picker`, true); } } ); diff --git a/src/panels/custom/ha-panel-custom.js b/src/panels/custom/ha-panel-custom.js index ad0c59dfc0..563f9d47f1 100644 --- a/src/panels/custom/ha-panel-custom.js +++ b/src/panels/custom/ha-panel-custom.js @@ -38,7 +38,7 @@ class HaPanelCustom extends NavigateMixin(EventsMixin(PolymerElement)) { delete window.customPanel; this._setProperties = null; while (this.lastChild) { - this.remove(this.lastChild); + this.removeChild(this.lastChild); } const config = panel.config._panel_custom; @@ -95,7 +95,7 @@ It will have access to all data in Home Assistant. } - `; + `.trim(); const iframeDoc = this.querySelector("iframe").contentWindow.document; iframeDoc.open(); iframeDoc.write(``); diff --git a/src/util/init-skeleton.ts b/src/util/init-skeleton.ts new file mode 100644 index 0000000000..f5912e70a0 --- /dev/null +++ b/src/util/init-skeleton.ts @@ -0,0 +1,6 @@ +export const removeInitSkeleton = () => { + const initEl = document.getElementById("ha-init-skeleton"); + if (initEl) { + initEl.parentElement!.removeChild(initEl); + } +}; diff --git a/translations/bg.json b/translations/bg.json index e013bf43b2..b5ffc0e321 100644 --- a/translations/bg.json +++ b/translations/bg.json @@ -1084,7 +1084,7 @@ "sun": { "elevation": "Височина", "rising": "Изгрев", - "setting": "Настройка" + "setting": "Залез" }, "updater": { "title": "Инструкции за актуализиране" diff --git a/translations/uk.json b/translations/uk.json index acab731eed..29377d81fc 100644 --- a/translations/uk.json +++ b/translations/uk.json @@ -384,7 +384,7 @@ "alias": "Назва", "triggers": { "header": "Тригери", - "introduction": "Тригери - це те, що починає обробляти правило автоматизації. Можна вказати декілька тригерів для одного і того ж правила. Після запуску тригера, Home Assistant перевірить умови, якщо такі є, і викликає дію. \n\n [Докладніше про тригери.] (Https:\/\/home-assistant.io\/docs\/automation\/trigger\/)", + "introduction": "Тригери - це те, що починає обробляти правило автоматизації. Можна вказати декілька тригерів для одного і того ж правила. Після запуску тригера, Home Assistant перевірить умови, якщо такі є, і викликає дію. \n\n [Докладніше про тригери.] (https:\/\/home-assistant.io\/docs\/automation\/trigger\/)", "add": "Додати тригер", "duplicate": "Дублювати", "delete": "Видалити", @@ -466,7 +466,7 @@ }, "conditions": { "header": "Умови", - "introduction": "Умови є необов'язковою частиною правила автоматизації і можуть використовуватися для запобігання дії, що відбувається під час запуску. Умови виглядають дуже схоже на тригери, але вони різні. Тригер буде дивитися на події, що відбуваються в системі, в той час як умова тільки дивиться на те, як система виглядає зараз. Тригер може спостерігати, що перемикач включений. Умова може бачити тільки, якщо перемикач ввімкнено або вимкнено. \n\n [Докладніше про умови.] (Https:\/\/home-assistant.io\/docs\/scripts\/conditions\/)", + "introduction": "Умови є необов'язковою частиною правила автоматизації і можуть використовуватися для запобігання дії, що відбувається під час запуску. Умови виглядають дуже схоже на тригери, але вони різні. Тригер буде дивитися на події, що відбуваються в системі, в той час як умова тільки дивиться на те, як система виглядає зараз. Тригер може спостерігати, що перемикач включений. Умова може бачити тільки, якщо перемикач ввімкнено або вимкнено. \n\n [Докладніше про умови.] (https:\/\/home-assistant.io\/docs\/scripts\/conditions\/)", "add": "Додати умову", "duplicate": "Дублювати", "delete": "Видалити", @@ -504,7 +504,7 @@ }, "actions": { "header": "Дії", - "introduction": "Що Home Assistant буде робити, коли автоматизація спрацьовує. \n\n [Докладніше про дії.] (Https:\/\/home-assistant.io\/docs\/automation\/action\/)", + "introduction": "Що Home Assistant буде робити, коли автоматизація спрацьовує. \n\n [Докладніше про дії.] (https:\/\/home-assistant.io\/docs\/automation\/action\/)", "add": "Додати дію", "duplicate": "Дублювати", "delete": "Видалити", @@ -513,7 +513,7 @@ "type_select": "Тип дії", "type": { "service": { - "label": "Викликати послугу", + "label": "Викликати сервіс", "service_data": "Дані послуги " }, "delay": { @@ -807,7 +807,8 @@ }, "create_account": "Створити обліковий запис", "error": { - "required_fields": "Заповніть усі необхідні поля" + "required_fields": "Заповніть усі необхідні поля", + "password_not_match": "Паролі не збігаються" } } }, @@ -1129,5 +1130,9 @@ "auto": "Авто" } } + }, + "groups": { + "system-admin": "Адміністратори", + "system-users": "Користувачі" } } \ No newline at end of file