Merge pull request #3231 from home-assistant/dev

20190530.0
This commit is contained in:
Paulus Schoutsen 2019-05-30 09:32:06 -07:00 committed by GitHub
commit d376457cec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 76 additions and 30 deletions

View File

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name="home-assistant-frontend",
version="20190529.0",
version="20190530.0",
description="The Home Assistant frontend",
url="https://github.com/home-assistant/home-assistant-polymer",
author="The Home Assistant Authors",

View File

@ -1,14 +1,25 @@
import { createCollection, Connection } from "home-assistant-js-websocket";
import { Panels } from "../types";
const fetchPanels = (conn) =>
conn.sendMessagePromise({
type: "get_panels",
});
const subscribeUpdates = (conn, store) =>
conn.subscribeEvents(
() => fetchPanels(conn).then((panels) => store.setState(panels, true)),
"panels_updated"
);
export const subscribePanels = (
conn: Connection,
onChange: (panels: Panels) => void
) =>
createCollection<Panels>(
"_pnl",
() => conn.sendMessagePromise({ type: "get_panels" }),
undefined,
fetchPanels,
subscribeUpdates,
conn,
onChange
);

View File

@ -60,7 +60,7 @@ class CloudGoogleAssistant extends LitElement {
<hass-loading-screen></hass-loading-screen>
`;
}
const emptyFilter = true || isEmptyFilter(this.cloudStatus.google_entities);
const emptyFilter = isEmptyFilter(this.cloudStatus.google_entities);
const filterFunc = this._getEntityFilterFunc(
this.cloudStatus.google_entities
);

View File

@ -169,13 +169,16 @@ class HaDeviceCard extends EventsMixin(LocalizeMixin(PolymerElement)) {
connectedCallback() {
super.connectedCallback();
this._unsubAreas = subscribeAreaRegistry(this.hass, (areas) => {
this._unsubAreas = subscribeAreaRegistry(this.hass.connection, (areas) => {
this._areas = areas;
});
this._unsubDevices = subscribeDeviceRegistry(this.hass, (devices) => {
this.devices = devices;
this.device = devices.find((device) => device.id === this.device.id);
});
this._unsubDevices = subscribeDeviceRegistry(
this.hass.connection,
(devices) => {
this.devices = devices;
this.device = devices.find((device) => device.id === this.device.id);
}
);
}
disconnectedCallback() {

View File

@ -42,6 +42,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
@property() public hass?: HomeAssistant;
@property() private _baseUnit = "50px";
@property() private _config?: GaugeCardConfig;
private _updated?: boolean;
@ -99,16 +100,21 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
}
return html`
<ha-card @click="${this._handleClick}">
<ha-card
@click="${this._handleClick}"
style=${styleMap({
"--base-unit": this._baseUnit,
})}
>
<div class="container">
<div class="gauge-a"></div>
<div class="gauge-b"></div>
<div
class="gauge-c"
style="${styleMap({
style=${styleMap({
transform: `rotate(${this._translateTurn(state)}turn)`,
"background-color": this._computeSeverity(state),
})}"
})}
></div>
<div class="gauge-data">
<div id="percent">
@ -154,12 +160,9 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
return;
}
const baseUnit = this._computeBaseUnit();
if (baseUnit === "0px") {
return;
if (baseUnit !== "0px") {
this._baseUnit = baseUnit;
}
(this.shadowRoot!.querySelector(
"ha-card"
)! as HTMLElement).style.setProperty("--base-unit", baseUnit);
}
private _computeSeverity(numberValue: number): string {
@ -211,7 +214,6 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
static get styles(): CSSResult {
return css`
ha-card {
--base-unit: 50px;
height: calc(var(--base-unit) * 3);
position: relative;
cursor: pointer;

View File

@ -345,10 +345,10 @@
"reloading": {
"heading": "Recàrrega de la configuració",
"introduction": "Algunes parts de la configuració de Home Assistant es poden recarregar sense necessitat de reiniciar-les. Les opcions de sota esborraran la configuració antiga i carregaran la nova.",
"core": "Recarregar el nucli",
"group": "Recarregar grups",
"automation": "Recarregar automatismes",
"script": "Recarregar programes"
"core": "Recarrega el nucli",
"group": "Recarrega grups",
"automation": "Recarrega automatismes",
"script": "Recarrega programes"
},
"server_management": {
"heading": "Gestió del servidor",
@ -964,7 +964,12 @@
"warning": {
"entity_not_found": "Entitat no disponible: {entity}",
"entity_non_numeric": "Entitat no numèrica: {entity}"
}
},
"changed_toast": {
"message": "S'ha actualitzat la configuració de Lovelace, vols refrescar-ho?",
"refresh": "Actualitza"
},
"reload_lovelace": "Recarrega Lovelace"
}
},
"sidebar": {

View File

@ -964,7 +964,12 @@
"warning": {
"entity_not_found": "Entity not available: {entity}",
"entity_non_numeric": "Entity is non-numeric: {entity}"
}
},
"changed_toast": {
"message": "The Lovelace config was updated, would you like to refresh?",
"refresh": "Refresh"
},
"reload_lovelace": "Reload Lovelace"
}
},
"sidebar": {

View File

@ -964,7 +964,12 @@
"warning": {
"entity_not_found": "Entitás nem elérhető: {entity}",
"entity_non_numeric": "Entitás nem numerikus: {entity}"
}
},
"changed_toast": {
"message": "A Lovelace config módosult, szeretnéd frissíteni?",
"refresh": "Frissítés"
},
"reload_lovelace": "Lovelace Újratöltése"
}
},
"sidebar": {

View File

@ -358,7 +358,7 @@
},
"core_config": {
"edit_requires_storage": "구성내용이 configuration.yaml 에 저장되어있기 때문에 편집기가 비활성화 되었습니다.",
"location_name": "Home Assistant 설치 이름",
"location_name": "Home Assistant 설치 위치명",
"latitude": "위도",
"longitude": "경도",
"elevation": "고도",
@ -964,7 +964,12 @@
"warning": {
"entity_not_found": "구성요소를 사용할 수 없습니다: {entity}",
"entity_non_numeric": "구성요소가 숫자형식이 아닙니다: {entity}"
}
},
"changed_toast": {
"message": "Lovelace 구성이 업데이트되었습니다. 새로고침 하시겠습니까?",
"refresh": "새로고침"
},
"reload_lovelace": "Lovelace 새로고침"
}
},
"sidebar": {

View File

@ -964,7 +964,12 @@
"warning": {
"entity_not_found": "Enhet ikke tilgjengelig: {entity}",
"entity_non_numeric": "Enheten er ikke-numerisk: {entity}"
}
},
"changed_toast": {
"message": "Lovelace-konfigurasjonen ble oppdatert, ønsker du å oppdatere?",
"refresh": "Oppdatere"
},
"reload_lovelace": "Laste Lovelace på nytt"
}
},
"sidebar": {

View File

@ -617,7 +617,7 @@
}
},
"area_registry": {
"caption": "Oppføringsregister",
"caption": "Områderegister",
"description": "Oversikt over områda i heimen din.",
"picker": {
"header": "Områderegister",

View File

@ -964,7 +964,12 @@
"warning": {
"entity_not_found": "Объект недоступен: {entity}",
"entity_non_numeric": "Объект не является числом: {entity}"
}
},
"changed_toast": {
"message": "Конфигурация Lovelace была изменена, обновить эту страницу?",
"refresh": "Обновить"
},
"reload_lovelace": "Перезагрузить Lovelace"
}
},
"sidebar": {