Merge pull request #4233 from home-assistant/dev

20191118.0
This commit is contained in:
Bram Kragten 2019-11-18 13:08:58 +01:00 committed by GitHub
commit 0056237d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 21 deletions

View File

@ -7,22 +7,26 @@
{ {
"src": "/static/icons/favicon-192x192.png", "src": "/static/icons/favicon-192x192.png",
"sizes": "192x192", "sizes": "192x192",
"type": "image/png" "type": "image/png",
"purpose": "maskable any"
}, },
{ {
"src": "/static/icons/favicon-384x384.png", "src": "/static/icons/favicon-384x384.png",
"sizes": "384x384", "sizes": "384x384",
"type": "image/png" "type": "image/png",
"purpose": "maskable any"
}, },
{ {
"src": "/static/icons/favicon-512x512.png", "src": "/static/icons/favicon-512x512.png",
"sizes": "512x512", "sizes": "512x512",
"type": "image/png" "type": "image/png",
"purpose": "maskable any"
}, },
{ {
"src": "/static/icons/favicon-1024x1024.png", "src": "/static/icons/favicon-1024x1024.png",
"sizes": "1024x1024", "sizes": "1024x1024",
"type": "image/png" "type": "image/png",
"purpose": "maskable any"
} }
], ],
"lang": "en-US", "lang": "en-US",

View File

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

View File

@ -87,7 +87,7 @@ class MoreInfoWeather extends LitElement {
${this.stateObj.attributes.temperature} ${this.getUnit("temperature")} ${this.stateObj.attributes.temperature} ${this.getUnit("temperature")}
</div> </div>
</div> </div>
${this.stateObj.attributes.pressure ${this._showValue(this.stateObj.attributes.pressure)
? html` ? html`
<div class="flex"> <div class="flex">
<iron-icon icon="hass:gauge"></iron-icon> <iron-icon icon="hass:gauge"></iron-icon>
@ -101,7 +101,7 @@ class MoreInfoWeather extends LitElement {
</div> </div>
` `
: ""} : ""}
${this.stateObj.attributes.humidity ${this._showValue(this.stateObj.attributes.humidity)
? html` ? html`
<div class="flex"> <div class="flex">
<iron-icon icon="hass:water-percent"></iron-icon> <iron-icon icon="hass:water-percent"></iron-icon>
@ -112,7 +112,7 @@ class MoreInfoWeather extends LitElement {
</div> </div>
` `
: ""} : ""}
${this.stateObj.attributes.wind_speed ${this._showValue(this.stateObj.attributes.wind_speed)
? html` ? html`
<div class="flex"> <div class="flex">
<iron-icon icon="hass:weather-windy"></iron-icon> <iron-icon icon="hass:weather-windy"></iron-icon>
@ -128,7 +128,7 @@ class MoreInfoWeather extends LitElement {
</div> </div>
` `
: ""} : ""}
${this.stateObj.attributes.visibility ${this._showValue(this.stateObj.attributes.visibility)
? html` ? html`
<div class="flex"> <div class="flex">
<iron-icon icon="hass:eye"></iron-icon> <iron-icon icon="hass:eye"></iron-icon>
@ -156,14 +156,14 @@ class MoreInfoWeather extends LitElement {
></iron-icon> ></iron-icon>
` `
: ""} : ""}
${!item.templow ${!this._showValue(item.templow)
? html` ? html`
<div class="main"> <div class="main">
${this.computeDateTime(item.datetime)} ${this.computeDateTime(item.datetime)}
</div> </div>
` `
: ""} : ""}
${item.templow ${this._showValue(item.templow)
? html` ? html`
<div class="main"> <div class="main">
${this.computeDate(item.datetime)} ${this.computeDate(item.datetime)}
@ -172,7 +172,7 @@ class MoreInfoWeather extends LitElement {
${item.templow} ${this.getUnit("temperature")} ${item.templow} ${this.getUnit("temperature")}
</div> </div>
` `
: ""}; : ""}
<div class="temp"> <div class="temp">
${item.temperature} ${this.getUnit("temperature")} ${item.temperature} ${this.getUnit("temperature")}
</div> </div>
@ -279,6 +279,10 @@ class MoreInfoWeather extends LitElement {
} }
return `${speed} ${this.getUnit("length")}/h`; return `${speed} ${this.getUnit("length")}/h`;
} }
private _showValue(item: string): boolean {
return typeof item !== "undefined" && item !== null;
}
} }
declare global { declare global {

View File

@ -111,12 +111,10 @@ class ActionHandler extends HTMLElement implements ActionHandler {
y = (ev as MouseEvent).pageY; y = (ev as MouseEvent).pageY;
} }
if (options.hasHold) { this.timer = window.setTimeout(() => {
this.timer = window.setTimeout(() => { this.startAnimation(x, y);
this.startAnimation(x, y); this.held = true;
this.held = true; }, this.holdTime);
}, this.holdTime);
}
this.cooldownStart = true; this.cooldownStart = true;
window.setTimeout(() => (this.cooldownStart = false), 100); window.setTimeout(() => (this.cooldownStart = false), 100);
@ -166,7 +164,7 @@ class ActionHandler extends HTMLElement implements ActionHandler {
// That might be a bug, but until it's fixed, this should make action-handler work. // That might be a bug, but until it's fixed, this should make action-handler work.
// If it's not a bug that is fixed, this might need updating with the next iOS version. // If it's not a bug that is fixed, this might need updating with the next iOS version.
// Note that all events (both touch and mouse) must be listened for in order to work on computers with both mouse and touchscreen. // Note that all events (both touch and mouse) must be listened for in order to work on computers with both mouse and touchscreen.
const isIOS13 = window.navigator.userAgent.match(/iPhone OS 13_/); const isIOS13 = /iPhone OS 13_/.test(window.navigator.userAgent);
if (!isIOS13) { if (!isIOS13) {
element.addEventListener("mousedown", clickStart, { passive: true }); element.addEventListener("mousedown", clickStart, { passive: true });
element.addEventListener("click", clickEnd); element.addEventListener("click", clickEnd);
@ -193,7 +191,7 @@ class ActionHandler extends HTMLElement implements ActionHandler {
customElements.define("action-handler", ActionHandler); customElements.define("action-handler", ActionHandler);
const geActionHandler = (): ActionHandler => { const getActionHandler = (): ActionHandler => {
const body = document.body; const body = document.body;
if (body.querySelector("action-handler")) { if (body.querySelector("action-handler")) {
return body.querySelector("action-handler") as ActionHandler; return body.querySelector("action-handler") as ActionHandler;
@ -209,7 +207,7 @@ export const actionHandlerBind = (
element: ActionHandlerElement, element: ActionHandlerElement,
options: ActionHandlerOptions options: ActionHandlerOptions
) => { ) => {
const actionhandler: ActionHandler = geActionHandler(); const actionhandler: ActionHandler = getActionHandler();
if (!actionhandler) { if (!actionhandler) {
return; return;
} }