Merge pull request #3385 from home-assistant/dev

20190718.0
This commit is contained in:
Paulus Schoutsen 2019-07-18 14:07:04 -07:00 committed by GitHub
commit 95d6cbd130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 281 additions and 178 deletions

View File

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

View File

@ -155,6 +155,15 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
domain === "climate" ||
domain === "water_heater"
) {
const isHeating =
domain === "climate"
? (state) => state.attributes.hvac_action === "heating"
: (state) => state.state === "heat";
const isCooling =
domain === "climate"
? (state) => state.attributes.hvac_action === "cooling"
: (state) => state.state === "cool";
// We differentiate between thermostats that have a target temperature
// range versus ones that have just a target temperature
@ -165,8 +174,8 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
state.attributes.target_temp_high !==
state.attributes.target_temp_low
);
const hasHeat = states.states.some((state) => state.state === "heat");
const hasCool = states.states.some((state) => state.state === "cool");
const hasHeat = states.states.some(isHeating);
const hasCool = states.states.some(isCooling);
addColumn(name + " current temperature", true);
if (hasHeat) {
@ -192,10 +201,10 @@ class StateHistoryChartLine extends LocalizeMixin(PolymerElement) {
const curTemp = safeParseFloat(state.attributes.current_temperature);
const series = [curTemp];
if (hasHeat) {
series.push(state.state === "heat" ? curTemp : null);
series.push(isHeating(state) ? curTemp : null);
}
if (hasCool) {
series.push(state.state === "cool" ? curTemp : null);
series.push(isCooling(state) ? curTemp : null);
}
if (hasTargetRange) {
const targetHigh = safeParseFloat(

View File

@ -12,7 +12,7 @@ export type HvacMode =
| "dry"
| "fan_only";
export type HvacAction = "off" | "Heating" | "cooling" | "drying" | "idle";
export type HvacAction = "off" | "heating" | "cooling" | "drying" | "idle";
export type ClimateEntity = HassEntityBase & {
attributes: HassEntityAttributeBase & {

View File

@ -4,6 +4,13 @@ export interface ZWaveNetworkStatus {
state: number;
}
export interface ZWaveValue {
index: number;
instance: number;
label: string;
poll_intensity: number;
}
export const ZWAVE_NETWORK_STATE_STOPPED = 0;
export const ZWAVE_NETWORK_STATE_FAILED = 1;
export const ZWAVE_NETWORK_STATE_STARTED = 5;
@ -16,3 +23,6 @@ export const fetchNetworkStatus = (
hass.callWS({
type: "zwave/network_status",
});
export const fetchValues = (hass: HomeAssistant, nodeId: number) =>
hass.callApi<ZWaveValue[]>("GET", `zwave/values/${nodeId}`);

View File

@ -1,121 +0,0 @@
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-listbox/paper-listbox";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-card";
class ZwaveValues extends PolymerElement {
static get template() {
return html`
<style include="iron-flex ha-style">
.content {
margin-top: 24px;
}
ha-card {
margin: 0 auto;
max-width: 600px;
}
.device-picker {
@apply --layout-horizontal;
@apply --layout-center-center;
padding-left: 24px;
padding-right: 24px;
padding-bottom: 24px;
}
.help-text {
padding-left: 24px;
padding-right: 24px;
}
</style>
<div class="content">
<ha-card header="Node Values">
<div class="device-picker">
<paper-dropdown-menu label="Value" dynamic-align="" class="flex">
<paper-listbox
slot="dropdown-content"
selected="{{_selectedValue}}"
>
<template is="dom-repeat" items="[[values]]" as="item">
<paper-item>[[_computeSelectCaption(item)]]</paper-item>
</template>
</paper-listbox>
</paper-dropdown-menu>
</div>
</ha-card>
</div>
`;
}
static get properties() {
return {
hass: Object,
nodes: Array,
values: Array,
selectedNode: {
type: Number,
observer: "selectedNodeChanged",
},
_selectedValue: {
type: Number,
value: -1,
observer: "_selectedValueChanged",
},
};
}
ready() {
super.ready();
this.addEventListener("hass-service-called", (ev) =>
this.serviceCalled(ev)
);
}
serviceCalled(ev) {
if (ev.detail.success) {
setTimeout(() => {
this._refreshValues(this.selectedNode);
}, 5000);
}
}
_computeSelectCaption(item) {
return `${item.value.label} (Instance: ${item.value.instance}, Index: ${
item.value.index
})`;
}
async _refreshValues(selectedNode) {
const valueData = [];
const values = await this.hass.callApi(
"GET",
`zwave/values/${this.nodes[selectedNode].attributes.node_id}`
);
Object.keys(values).forEach((key) => {
valueData.push({
key,
value: values[key],
});
});
this.setProperties({ values: valueData });
this._selectedValueChanged(this._selectedValue);
}
_selectedValueChanged() {}
selectedNodeChanged(selectedNode) {
if (selectedNode === -1) return;
this.setProperties({ _selectedValue: -1 });
}
}
customElements.define("zwave-values", ZwaveValues);

View File

@ -0,0 +1,119 @@
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-listbox/paper-listbox";
import {
css,
CSSResult,
customElement,
html,
LitElement,
property,
TemplateResult,
} from "lit-element";
import { haStyle } from "../../../resources/styles";
import { HomeAssistant } from "../../../types";
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-card";
import { ZWaveValue } from "../../../data/zwave";
@customElement("zwave-values")
export class ZwaveValues extends LitElement {
@property() public hass!: HomeAssistant;
@property() private _values: ZWaveValue[] = [];
@property() private _selectedValue: number = -1;
protected render(): TemplateResult | void {
return html`
<div class="content">
<ha-card
.header=${this.hass.localize("ui.panel.config.zwave.values.header")}
>
<div class="device-picker">
<paper-dropdown-menu
label=${this.hass.localize("ui.panel.config.zwave.common.value")}
dynamic-align
class="flex"
>
<paper-listbox
slot="dropdown-content"
.selected=${this._selectedValue}
>
${this._values.map(
(item) => html`
<paper-item
>${item.label}
(${this.hass.localize(
"ui.panel.config.zwave.common.instance"
)}:
${item.instance},
${this.hass.localize(
"ui.panel.config.zwave.common.index"
)}:
${item.index})</paper-item
>
`
)}
</paper-listbox>
</paper-dropdown-menu>
</div>
</ha-card>
</div>
`;
}
static get styles(): CSSResult[] {
return [
haStyle,
css`
.content {
margin-top: 24px;
}
ha-card {
margin: 0 auto;
max-width: 600px;
}
.device-picker {
@apply --layout-horizontal;
@apply --layout-center-center;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-direction: row;
-webkit-flex-direction: row;
flex-direction: row;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
padding-left: 24px;
padding-right: 24px;
padding-bottom: 24px;
}
.flex {
-ms-flex: 1 1 0.000000001px;
-webkit-flex: 1;
flex: 1;
-webkit-flex-basis: 0.000000001px;
flex-basis: 0.000000001px;
}
.help-text {
padding-left: 24px;
padding-right: 24px;
}
`,
];
}
}
declare global {
interface HTMLElementTagNameMap {
"zwave-values": ZwaveValues;
}
}

View File

@ -116,7 +116,8 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
[mode]: true,
large: this._broadCard!,
small: !this._broadCard,
})}">
})}"
>
<div id="root">
<paper-icon-button
icon="hass:dots-vertical"
@ -125,28 +126,26 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
></paper-icon-button>
<div id="thermostat"></div>
<div id="tooltip">
<div class="title">${this._config.name ||
computeStateName(stateObj)}</div>
<div class="title">
${this._config.name || computeStateName(stateObj)}
</div>
<div class="current-temperature">
<span class="current-temperature-text">
${stateObj.attributes.current_temperature}
${
stateObj.attributes.current_temperature
? html`
<span class="uom"
>${this.hass.config.unit_system.temperature}</span
>
`
: ""
}
${stateObj.attributes.current_temperature
? html`
<span class="uom"
>${this.hass.config.unit_system.temperature}</span
>
`
: ""}
</span>
</div>
<div class="climate-info">
<div id="set-temperature"></div>
<div class="current-mode">
${this.hass!.localize(`state.climate.${stateObj.state}`)}
${
stateObj.attributes.preset_mode
<div id="set-temperature"></div>
<div class="current-mode">
${this.hass!.localize(`state.climate.${stateObj.state}`)}
${stateObj.attributes.preset_mode
? html`
-
${this.hass!.localize(
@ -155,13 +154,13 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
}`
) || stateObj.attributes.preset_mode}
`
: ""
}
</div>
<div class="modes">
${stateObj.attributes.hvac_modes.map((modeItem) =>
this._renderIcon(modeItem, mode)
)}
: ""}
</div>
<div class="modes">
${stateObj.attributes.hvac_modes.map((modeItem) =>
this._renderIcon(modeItem, mode)
)}
</div>
</div>
</div>
</div>

View File

@ -915,6 +915,11 @@
"zwave": {
"caption": "Z-Wave",
"description": "Manage your Z-Wave network",
"common": {
"value": "Value",
"instance": "Instance",
"index": "Index"
},
"network_management": {
"header": "Z-Wave Network Management",
"introduction": "Run commands that affect the Z-Wave network. You won't get feedback on whether most commands succeeded, but you can check the OZW Log to try to find out."
@ -927,6 +932,9 @@
"network_started_note_some_queried": "Awake nodes have been queried. Sleeping nodes will be queried when they wake.",
"network_started_note_all_queried": "All nodes have been queried."
},
"values": {
"header": "Node Values"
},
"services": {
"start_network": "Start Network",
"stop_network": "Stop Network",

View File

@ -141,7 +141,8 @@
"high_demand": "Alta potència",
"heat_pump": "Bomba de calor",
"gas": "Gas",
"manual": "Manual"
"manual": "Manual",
"heat_cool": "Escalfar\/Refredar"
},
"configurator": {
"configure": "Configurar",
@ -397,7 +398,7 @@
"description": "Personalitza les entitats",
"picker": {
"header": "Personalització",
"introduction": "Modificació dels atributs d'entitat. Les personalitzacions afegides\/modificades apareixeran immediatament. Les personalitzacions eliminades tindran efecte quan l'entitat s'actualitzi."
"introduction": "Personalitza els atributs de les entitats al teu gust. Les personalitzacions afegides\/modificades apareixeran immediatament, les que s'hagin eliminat tindran efecte quan l'entitat s'actualitzi."
}
},
"automation": {

View File

@ -319,7 +319,7 @@
"title": "Begivenheder"
},
"templates": {
"title": "Skabeloner"
"title": "Skabelon"
},
"mqtt": {
"title": "MQTT"

View File

@ -141,7 +141,8 @@
"high_demand": "Hoher Verbrauch",
"heat_pump": "Wärmepumpe",
"gas": "Gas",
"manual": "Manuell"
"manual": "Manuell",
"heat_cool": "Heizen\/Kühlen"
},
"configurator": {
"configure": "Konfigurieren",

View File

@ -141,7 +141,8 @@
"high_demand": "Forte demande",
"heat_pump": "Pompe à chaleur",
"gas": "Gaz",
"manual": "Manuel"
"manual": "Manuel",
"heat_cool": "Chaud\/Froid"
},
"configurator": {
"configure": "Configurer",
@ -323,6 +324,9 @@
},
"mqtt": {
"title": "MQTT"
},
"info": {
"title": "Info"
}
}
},
@ -586,7 +590,10 @@
},
"zwave": {
"caption": "Z-Wave",
"description": "Gérez votre réseau Z-Wave"
"description": "Gérez votre réseau Z-Wave",
"services": {
"save_config": "Enregistrer la configuration"
}
},
"users": {
"caption": "Utilisateurs",
@ -779,7 +786,8 @@
"step_done": "Configuration terminée pour {step}",
"close": "Fermer",
"submit": "Envoyer"
}
},
"logout": "Déconnexion"
},
"page-authorize": {
"initializing": "Initialisation",

View File

@ -118,13 +118,15 @@
"eco": "Sparnaður",
"heat_pump": "Hitadæla",
"gas": "Gas",
"manual": "Handvirkt"
"manual": "Handvirkt",
"heat_cool": "Hita\/Kæla"
},
"cover": {
"open": "Opin",
"opening": "Opna",
"closed": "Lokað",
"closing": "Loka"
"closing": "Loka",
"stopped": "Stöðvuð"
},
"device_tracker": {
"home": "Heima",
@ -222,11 +224,14 @@
"windy-variant": "Vindasamt"
},
"vacuum": {
"cleaning": "Að ryksuga",
"docked": "í tengikví",
"error": "Villa",
"idle": "Aðgerðalaus",
"off": "Slökkt",
"on": "Í gangi",
"paused": "Í bið"
"paused": "Í bið",
"returning": "Á leið tilbaka í tengikví"
},
"timer": {
"active": "virkur",
@ -244,6 +249,9 @@
"error": "Villa",
"entity_not_found": "Eining fannst ekki"
},
"alarm_control_panel": {
"triggered": "Kveik"
},
"device_tracker": {
"home": "Heima",
"not_home": "Fjarverandi"
@ -369,10 +377,14 @@
"unsaved_confirm": "Þú ert með óvistaðar breytingar. Ertu viss um að þú viljir fara?",
"alias": "Nafn",
"triggers": {
"header": "Kveikjur",
"introduction": "Kveikjur sjá um að ræsa sjálfvirkni reglur. Það er mögulegt að tilgreina margar kveikjur fyrir sömu regluna. Þegar kveikja er ræst þá mun Home Assistant sannreyna skilyrðin ef einhver og kalla á aðgerðina.",
"add": "Bæta við kveikju",
"duplicate": "Fjölfalda",
"delete": "Eyða",
"delete_confirm": "Ert þú viss um að þú viljir eyða?",
"unsupported_platform": "Vettvangur ekki studdur: {platform}",
"type_select": "Gerð kveikju",
"type": {
"event": {
"label": "Viðburður",
@ -396,7 +408,8 @@
},
"numeric_state": {
"above": "Yfir",
"below": "Undir"
"below": "Undir",
"value_template": "Gildissniðmát (valfrjálst)"
},
"sun": {
"label": "Sól",
@ -404,6 +417,10 @@
"sunrise": "Sólarupprás",
"sunset": "Sólsetur"
},
"template": {
"label": "Sniðmát",
"value_template": "Gildissniðmát"
},
"time": {
"label": "Tími",
"at": "Þann"
@ -434,7 +451,8 @@
"enter": "Koma",
"leave": "Brottför"
}
}
},
"learn_more": "Læra meira um gikki"
},
"conditions": {
"header": "Skilyrði",
@ -451,7 +469,8 @@
},
"numeric_state": {
"above": "Yfir",
"below": "Undir"
"below": "Undir",
"value_template": "Gildissniðmát (valfrjálst)"
},
"sun": {
"label": "Sól",
@ -460,6 +479,10 @@
"sunrise": "Sólarupprás",
"sunset": "Sólsetur"
},
"template": {
"label": "Sniðmát",
"value_template": "Gildissniðmát"
},
"time": {
"label": "Tími",
"after": "Eftir",
@ -493,13 +516,15 @@
},
"wait_template": {
"label": "Bið",
"wait_template": "Bið skapalón",
"wait_template": "Bið sniðmát",
"timeout": "Tímamörk (valfrjálst)"
},
"condition": {
"label": "Skilyrði"
},
"event": {
"label": "Skjóta viðburði",
"event": "Viðburður:",
"service_data": "Þjónustu gögn"
}
},
@ -522,11 +547,15 @@
"network_status": {
"network_stopped": "Z-Wave net stöðvað",
"network_starting": "Ræsi Z-Wave net...",
"network_starting_note": "Þetta gæti tekið smá stund, veltur á stærð netsins.",
"network_started": "Z-Wave net ræst"
},
"services": {
"start_network": "Ræsa net",
"stop_network": "Söðva net",
"stop_network": "Stöðva net",
"heal_network": "Lækna net",
"test_network": "Prófa net",
"soft_reset": "Mjúk endurstilling",
"save_config": "Vista stillingar",
"cancel_command": "Hætta við skipun"
}
@ -832,6 +861,7 @@
},
"core-config": {
"intro": "Hæ {name}, velkomin(n) í Home Assistant. Hvað á heimilið þitt að heita?",
"intro_location": "Okkur langar að vita hvar þú býrð. Þessar upplýsingar munu hjálpa varðandi upplýsingar og uppsetningu á sólar-tengdri sjálfvirkni. Þessum upplýsingum er aldrei deilt út fyrir þitt net.",
"location_name_default": "Heima",
"button_detect": "Uppgötva",
"finish": "Næsta"
@ -923,8 +953,12 @@
"config": {
"arsaboo": {
"names": {
"upstairs": "Uppi",
"family_room": "Fjölskyldurými",
"kitchen": "Eldhús",
"patio": "Verönd",
"hallway": "Gangur",
"master_bedroom": "Hjónaherbergi",
"left": "Vinstri",
"right": "Hægri",
"mirror": "Spegill"
@ -932,6 +966,8 @@
"labels": {
"lights": "Ljós",
"information": "Upplýsingar",
"morning_commute": "Morgunferðalag",
"commute_home": "Á leiðinni heim",
"entertainment": "Skemmtun",
"activity": "Virkni",
"hdmi_input": "HDMI inntak",
@ -1014,6 +1050,10 @@
"code": "Kóði",
"clear_code": "Hreinsa"
},
"automation": {
"last_triggered": "Síðast kveikt",
"trigger": "Kveikja"
},
"cover": {
"position": "Staðsetning"
},
@ -1035,9 +1075,13 @@
"climate": {
"currently": "Er núna",
"on_off": "Kveikt \/ slökkt",
"target_temperature": "Viðmiðunar hitastig",
"target_humidity": "Viðmiðunar rakastig",
"operation": "Aðgerð",
"fan_mode": "Viftuhamur",
"swing_mode": "Sveifluhamur"
"swing_mode": "Sveifluhamur",
"away_mode": "Fjarverandi hamur",
"preset_mode": "Forstilling"
},
"lock": {
"code": "Kóði",
@ -1057,7 +1101,8 @@
"currently": "Er núna",
"on_off": "Kveikt \/ slökkt",
"target_temperature": "Viðmiðunarhitastig",
"operation": "Aðgerð"
"operation": "Aðgerð",
"away_mode": "Fjarverandi hamur"
}
},
"components": {
@ -1178,6 +1223,14 @@
"off": "Slökkt",
"on": "Kveikt",
"auto": "Sjálfvirkt"
},
"preset_mode": {
"none": "Ekkert",
"eco": "Sparnaður",
"away": "Fjarverandi",
"comfort": "Þægindi",
"home": "Heima",
"sleep": "Svefn"
}
}
},

View File

@ -141,7 +141,8 @@
"high_demand": "고성능",
"heat_pump": "순환펌프",
"gas": "가스",
"manual": "수동"
"manual": "수동",
"heat_cool": "냉난방"
},
"configurator": {
"configure": "설정",

View File

@ -141,7 +141,8 @@
"high_demand": "Héich Ufro",
"heat_pump": "Heizung",
"gas": "Gas",
"manual": "Manuell"
"manual": "Manuell",
"heat_cool": "Hëtzen\/Ofkillen"
},
"configurator": {
"configure": "Astellen",
@ -591,13 +592,15 @@
"caption": "Z-Wave",
"description": "Verwalt är Z-Wave Netzwierk",
"network_management": {
"header": "Z-Wave Netzwierk Verwaltung"
"header": "Z-Wave Netzwierk Verwaltung",
"introduction": "Féiert Commande aus am Z-Wave Netzwierk. Di kritt kee Feedback op déi meeschte Commande erfollegräich ausgeféiert goufen, mee dir kënnt de OZW Log ënnersiche fir weider Detailer"
},
"network_status": {
"network_stopped": "Z-Wave Netzwierk gestoppt",
"network_starting": "Z-Wave Netzwierk start",
"network_starting_note": "Dës kann eng Weil dauere jee no gréisst vum Netzwierk.",
"network_started": "Z-Wave Netzwierk gestart",
"network_started_note_some_queried": "Aktiv Apparater sinn ofgefrot. Inaktiv Apparater ginn ofgefrot soubal sie aktiv sinn.",
"network_started_note_all_queried": "All Apparater sinn ofgefrot"
},
"services": {

View File

@ -141,7 +141,8 @@
"high_demand": "Høy etterspørsel",
"heat_pump": "Varmepumpe",
"gas": "Gass",
"manual": "Manuell"
"manual": "Manuell",
"heat_cool": "Varme\/kjøling"
},
"configurator": {
"configure": "Konfigurer",
@ -323,6 +324,9 @@
},
"mqtt": {
"title": "MQTT"
},
"info": {
"title": "Info"
}
}
},
@ -803,7 +807,8 @@
"step_done": "Oppsett fullført for {step}",
"close": "Lukk",
"submit": "Send inn"
}
},
"logout": "Logg ut"
},
"page-authorize": {
"initializing": "Initialiserer",

View File

@ -141,7 +141,8 @@
"high_demand": "Hoge vraag",
"heat_pump": "Warmtepomp",
"gas": "Gas",
"manual": "Handmatig"
"manual": "Handmatig",
"heat_cool": "Verwarmen\/Koelen"
},
"configurator": {
"configure": "Configureer",
@ -323,6 +324,9 @@
},
"mqtt": {
"title": "MQTT"
},
"info": {
"title": "Info"
}
}
},
@ -803,7 +807,8 @@
"step_done": "Instellen voltooid voor {step}",
"close": "Sluiten",
"submit": "Verzenden"
}
},
"logout": "Uitloggen"
},
"page-authorize": {
"initializing": "Initialiseren",

View File

@ -141,7 +141,8 @@
"high_demand": "duży rozbiór",
"heat_pump": "pompa ciepła",
"gas": "gaz",
"manual": "manualnie"
"manual": "manualnie",
"heat_cool": "grzanie\/chłodzenie"
},
"configurator": {
"configure": "Skonfiguruj",

View File

@ -8,7 +8,7 @@
"mailbox": "Почта",
"shopping_list": "Список покупок",
"dev-info": "Информация",
"developer_tools": "Инструменты разработчика",
"developer_tools": "Панель разработчика",
"calendar": "Календарь",
"profile": "Профиль"
},
@ -141,7 +141,8 @@
"high_demand": "Большая нагрузка",
"heat_pump": "Тепловой насос",
"gas": "Газовый",
"manual": "Ручной режим"
"manual": "Ручной режим",
"heat_cool": "Нагрев \/ Охлаждение"
},
"configurator": {
"configure": "Настроить",