mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
commit
42117fcba0
@ -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 };
|
||||
}
|
||||
|
@ -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`
|
||||
<template is="dom-if" if="[[hass]]">
|
||||
<hassio-main hass="[[hass]]" route="[[route]]"></hassio-main>
|
||||
</template>
|
||||
`;
|
||||
}
|
||||
|
||||
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);
|
@ -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() {
|
||||
|
@ -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: {
|
||||
|
2
setup.py
2
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",
|
||||
|
@ -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,
|
||||
|
@ -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));
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ class HaConfigAreaRegistry extends LitElement {
|
||||
"ui.panel.config.area_registry.picker.introduction2"
|
||||
)}
|
||||
</p>
|
||||
<a href="/config/integrations">
|
||||
<a href="/config/integrations/dashboard">
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.area_registry.picker.integrations_page"
|
||||
)}
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user