diff --git a/hassio/src/addon-store/hassio-repositories-editor.js b/hassio/src/addon-store/hassio-repositories-editor.js index cf20c85e2d..93455375d8 100644 --- a/hassio/src/addon-store/hassio-repositories-editor.js +++ b/hassio/src/addon-store/hassio-repositories-editor.js @@ -106,12 +106,12 @@ class HassioRepositoriesEditor extends PolymerElement { computeRemoveRepoData(repoList, url) { const list = repoList .filter((repo) => repo.url !== url) - .map((repo) => repo.url); + .map((repo) => repo.source); return { addons_repositories: list }; } computeAddRepoData(repoList, url) { - const list = repoList ? repoList.map((repo) => repo.url) : []; + const list = repoList ? repoList.map((repo) => repo.source) : []; list.push(url); return { addons_repositories: list }; } diff --git a/hassio/src/hassio-app.js b/hassio/src/hassio-app.js deleted file mode 100644 index a39072e583..0000000000 --- a/hassio/src/hassio-app.js +++ /dev/null @@ -1,41 +0,0 @@ -import { html } from "@polymer/polymer/lib/utils/html-tag"; -import { PolymerElement } from "@polymer/polymer/polymer-element"; - -import "./hassio-main"; -import "./resources/hassio-icons"; - -class HassioApp extends PolymerElement { - static get template() { - return html` - - `; - } - - static get properties() { - return { - hass: Object, - route: Object, - hassioPanel: { - type: Object, - value: window.parent.hassioPanel, - }, - }; - } - - ready() { - super.ready(); - window.setProperties = this.setProperties.bind(this); - this.addEventListener("location-changed", () => this._locationChanged()); - this.addEventListener("hass-toggle-menu", (ev) => - this.hassioPanel.fire("hass-toggle-menu", ev.detail) - ); - } - - _locationChanged() { - this.hassioPanel.navigate(window.location.pathname); - } -} - -customElements.define("hassio-app", HassioApp); diff --git a/hassio/src/hassio-main.js b/hassio/src/hassio-main.js index 8b207f9a00..84fbbc5383 100644 --- a/hassio/src/hassio-main.js +++ b/hassio/src/hassio-main.js @@ -79,6 +79,17 @@ class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) { super.ready(); applyThemesOnElement(this, this.hass.themes, this.hass.selectedTheme, true); this.addEventListener("hass-api-called", (ev) => this.apiCalled(ev)); + // Paulus - March 17, 2019 + // We went to a single hass-toggle-menu event in HA 0.90. However, the + // supervisor UI can also run under older versions of Home Assistant. + // So here we are going to translate toggle events into the appropriate + // open and close events. These events are a no-op in newer versions of + // Home Assistant. + this.addEventListener("hass-toggle-menu", () => { + window.parent.customPanel.fire( + this.hass.dockedSidebar ? "hass-close-menu" : "hass-open-menu" + ); + }); } connectedCallback() { diff --git a/hassio/webpack.config.js b/hassio/webpack.config.js index 48f9809307..022bbb563c 100644 --- a/hassio/webpack.config.js +++ b/hassio/webpack.config.js @@ -1,4 +1,7 @@ +const webpack = require("webpack"); const CompressionPlugin = require("compression-webpack-plugin"); +const zopfli = require("@gfx/zopfli"); + const config = require("./config.js"); const { babelLoaderConfig } = require("../config/babel.js"); const webpackBase = require("../config/webpack.js"); @@ -30,11 +33,22 @@ module.exports = { }, optimization: webpackBase.optimization(latestBuild), plugins: [ + new webpack.DefinePlugin({ + __DEV__: JSON.stringify(!isProdBuild), + __DEMO__: false, + __BUILD__: JSON.stringify(latestBuild ? "latest" : "es5"), + "process.env.NODE_ENV": JSON.stringify( + isProdBuild ? "production" : "development" + ), + }), isProdBuild && !isCI && new CompressionPlugin({ cache: true, exclude: [/\.js\.map$/, /\.LICENSE$/, /\.py$/, /\.txt$/], + algorithm(input, compressionOptions, callback) { + return zopfli.gzip(input, compressionOptions, callback); + }, }), ].filter(Boolean), resolve: { diff --git a/setup.py b/setup.py index f4a67a95b2..7ed2c47f71 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20190316.0", + version="20190318.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", diff --git a/src/components/ha-sidebar.ts b/src/components/ha-sidebar.ts index e51371dc51..48ebff59e5 100644 --- a/src/components/ha-sidebar.ts +++ b/src/components/ha-sidebar.ts @@ -22,8 +22,11 @@ import { DEFAULT_PANEL } from "../common/const"; const computeUrl = (urlPath) => `/${urlPath}`; const computePanels = (hass: HomeAssistant) => { - const isAdmin = hass.user.is_admin; const panels = hass.panels; + if (!panels) { + return []; + } + const isAdmin = hass.user.is_admin; const sortValue = { map: 1, logbook: 2, diff --git a/src/entrypoints/custom-panel.js b/src/entrypoints/custom-panel.js index 4ce6e012b4..ea3c84b481 100644 --- a/src/entrypoints/custom-panel.js +++ b/src/entrypoints/custom-panel.js @@ -56,7 +56,7 @@ function initialize(panel, properties) { const forwardEvent = (ev) => window.parent.customPanel.fire(ev.type, ev.detail); root.addEventListener("hass-toggle-menu", forwardEvent); - root.addEventListener("location-changed", () => + window.addEventListener("location-changed", () => window.parent.customPanel.navigate(window.location.pathname) ); setProperties(Object.assign({ panel }, properties)); diff --git a/src/layouts/partial-panel-resolver.ts b/src/layouts/partial-panel-resolver.ts index acb67d1982..efacfd474b 100644 --- a/src/layouts/partial-panel-resolver.ts +++ b/src/layouts/partial-panel-resolver.ts @@ -80,7 +80,10 @@ class PartialPanelResolver extends HassRouterPage { const oldHass = changedProps.get("hass") as this["hass"]; - if (!oldHass || oldHass.panels !== this.hass!.panels) { + if ( + this.hass!.panels && + (!oldHass || oldHass.panels !== this.hass!.panels) + ) { this._updateRoutes(); } } diff --git a/src/panels/config/area_registry/ha-config-area-registry.ts b/src/panels/config/area_registry/ha-config-area-registry.ts index cabec75c65..e34c92272c 100644 --- a/src/panels/config/area_registry/ha-config-area-registry.ts +++ b/src/panels/config/area_registry/ha-config-area-registry.ts @@ -66,7 +66,7 @@ class HaConfigAreaRegistry extends LitElement { "ui.panel.config.area_registry.picker.introduction2" )}

- + ${this.hass.localize( "ui.panel.config.area_registry.picker.integrations_page" )} diff --git a/translations/es-419.json b/translations/es-419.json index 4565206460..600d3b461f 100644 --- a/translations/es-419.json +++ b/translations/es-419.json @@ -81,8 +81,8 @@ "on": "Inseguro" }, "presence": { - "off": "Fuera de Casa", - "on": "Casa" + "off": "Fuera de casa", + "on": "En casa" }, "battery": { "off": "Normal", @@ -169,7 +169,7 @@ "group": { "off": "Apagado", "on": "Encendido", - "home": "En Casa", + "home": "En casa", "not_home": "Fuera de Casa", "open": "Abierto", "opening": "Abriendo", @@ -272,8 +272,8 @@ "paused": "pausado" }, "person": { - "home": "En Casa", - "not_home": "Fuera de Casa" + "home": "En casa", + "not_home": "Fuera de casa" } }, "state_badge": { @@ -284,9 +284,9 @@ "alarm_control_panel": { "armed": "Activado", "disarmed": "Desactivado", - "armed_home": "Activado", - "armed_away": "Activado", - "armed_night": "Activado", + "armed_home": "Activada", + "armed_away": "Activada", + "armed_night": "Activada", "pending": "Pendiente", "arming": "Activando", "disarming": "Desarmar", @@ -294,8 +294,8 @@ "armed_custom_bypass": "Protegido" }, "device_tracker": { - "home": "En Casa", - "not_home": "Fuera de Casa" + "home": "En casa", + "not_home": "Fuera de casa" }, "person": { "home": "En casa", @@ -369,7 +369,7 @@ "caption": "Automatización", "description": "Crear y editar automatizaciones", "picker": { - "header": "Editor de automatización", + "header": "Editor de automatizaciones", "introduction": "El editor de automatización le permite crear y editar automatizaciones. Siga el enlace a continuación para leer las instrucciones y asegurarse de que haya configurado Home Assistant correctamente.", "pick_automation": "Elija la automatización a editar", "no_automations": "No pudimos encontrar ninguna automatización editable", @@ -606,7 +606,8 @@ "caption": "ZHA", "description": "Gestión de red de Zigbee Home Automation", "services": { - "reconfigure": "Reconfigure el dispositivo ZHA (dispositivo de curación). Use esto si tiene problemas con el dispositivo. Si el dispositivo en cuestión es un dispositivo alimentado por batería, asegúrese de que esté activado y acepte los comandos cuando utilice este servicio." + "reconfigure": "Reconfigure el dispositivo ZHA (dispositivo de curación). Use esto si tiene problemas con el dispositivo. Si el dispositivo en cuestión es un dispositivo alimentado por batería, asegúrese de que esté activado y acepte los comandos cuando utilice este servicio.", + "updateDeviceName": "Establecer un nombre personalizado para este dispositivo en el registro de dispositivos." } }, "area_registry": { @@ -616,7 +617,9 @@ "header": "Registro de áreas", "introduction": "Las áreas se utilizan para organizar donde están los dispositivos. Esta información se utilizará en todo Home Assistant para ayudarlo a organizar su interfaz, permisos e integraciones con otros sistemas.", "introduction2": "Para colocar dispositivos en un área, use el enlace a continuación para navegar a la página de integraciones y luego haga clic en una integración configurada para acceder a las tarjetas del dispositivo.", - "integrations_page": "Página de integraciones" + "integrations_page": "Página de integraciones", + "no_areas": "¡Parece que aún no tienes áreas!", + "create_area": "CREAR AREA" }, "no_areas": "¡Parece que aún no tienes áreas!", "create_area": "CREAR AREA", @@ -830,11 +833,13 @@ "data": { "name": "Nombre", "username": "Nombre de usuario", - "password": "Contraseña" + "password": "Contraseña", + "password_confirm": "Confirmar contraseña" }, "create_account": "Crear una cuenta", "error": { - "required_fields": "Completar todos los campos requeridos" + "required_fields": "Completar todos los campos requeridos", + "password_not_match": "Las contraseñas no coinciden" } } }, @@ -1156,5 +1161,10 @@ "auto": "Auto" } } + }, + "groups": { + "system-admin": "Administradores", + "system-users": "Usuarios", + "system-read-only": "Usuarios de solo lectura" } } \ No newline at end of file diff --git a/translations/lb.json b/translations/lb.json index c6c584c730..99cf7c0526 100644 --- a/translations/lb.json +++ b/translations/lb.json @@ -438,7 +438,7 @@ "zone": { "label": "Zone", "entity": "Entitéit mam Standuert", - "zone": "Strefa", + "zone": "Zon", "event": "Evenement:", "enter": "Eran", "leave": "Verloossen" @@ -479,7 +479,7 @@ "state": "Zoustand" }, "numeric_state": { - "label": "Stan (numeryczny)", + "label": "Numereschen Zoustand", "above": "Iwwert", "below": "Ënnert", "value_template": "Wäerte Modell (optional)" @@ -503,9 +503,9 @@ "before": "Virdrun" }, "zone": { - "label": "Strefa", + "label": "Zon", "entity": "Entitéit mam Standuert", - "zone": "Strefa" + "zone": "Zon" } }, "learn_more": "Méi iwwert Konditioune liesen" @@ -526,7 +526,7 @@ }, "delay": { "label": "Delai", - "delay": "Opóźnienie" + "delay": "Délai" }, "wait_template": { "label": "Waart",