diff --git a/demo/public/manifest.json b/demo/public/manifest.json
index ce52141bda..f364cab750 100644
--- a/demo/public/manifest.json
+++ b/demo/public/manifest.json
@@ -7,22 +7,26 @@
{
"src": "/static/icons/favicon-192x192.png",
"sizes": "192x192",
- "type": "image/png"
+ "type": "image/png",
+ "purpose": "maskable any"
},
{
"src": "/static/icons/favicon-384x384.png",
"sizes": "384x384",
- "type": "image/png"
+ "type": "image/png",
+ "purpose": "maskable any"
},
{
"src": "/static/icons/favicon-512x512.png",
"sizes": "512x512",
- "type": "image/png"
+ "type": "image/png",
+ "purpose": "maskable any"
},
{
"src": "/static/icons/favicon-1024x1024.png",
"sizes": "1024x1024",
- "type": "image/png"
+ "type": "image/png",
+ "purpose": "maskable any"
}
],
"lang": "en-US",
diff --git a/setup.py b/setup.py
index bb768a18f7..20c88fb0e1 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name="home-assistant-frontend",
- version="20191115.0",
+ version="20191118.0",
description="The Home Assistant frontend",
url="https://github.com/home-assistant/home-assistant-polymer",
author="The Home Assistant Authors",
diff --git a/src/dialogs/more-info/controls/more-info-weather.ts b/src/dialogs/more-info/controls/more-info-weather.ts
index 8d14f80cac..8307ae37fd 100644
--- a/src/dialogs/more-info/controls/more-info-weather.ts
+++ b/src/dialogs/more-info/controls/more-info-weather.ts
@@ -87,7 +87,7 @@ class MoreInfoWeather extends LitElement {
${this.stateObj.attributes.temperature} ${this.getUnit("temperature")}
- ${this.stateObj.attributes.pressure
+ ${this._showValue(this.stateObj.attributes.pressure)
? html`
@@ -101,7 +101,7 @@ class MoreInfoWeather extends LitElement {
`
: ""}
- ${this.stateObj.attributes.humidity
+ ${this._showValue(this.stateObj.attributes.humidity)
? html`
@@ -112,7 +112,7 @@ class MoreInfoWeather extends LitElement {
`
: ""}
- ${this.stateObj.attributes.wind_speed
+ ${this._showValue(this.stateObj.attributes.wind_speed)
? html`
@@ -128,7 +128,7 @@ class MoreInfoWeather extends LitElement {
`
: ""}
- ${this.stateObj.attributes.visibility
+ ${this._showValue(this.stateObj.attributes.visibility)
? html`
@@ -156,14 +156,14 @@ class MoreInfoWeather extends LitElement {
>
`
: ""}
- ${!item.templow
+ ${!this._showValue(item.templow)
? html`
${this.computeDateTime(item.datetime)}
`
: ""}
- ${item.templow
+ ${this._showValue(item.templow)
? html`
${this.computeDate(item.datetime)}
@@ -172,7 +172,7 @@ class MoreInfoWeather extends LitElement {
${item.templow} ${this.getUnit("temperature")}
`
- : ""};
+ : ""}
${item.temperature} ${this.getUnit("temperature")}
@@ -279,6 +279,10 @@ class MoreInfoWeather extends LitElement {
}
return `${speed} ${this.getUnit("length")}/h`;
}
+
+ private _showValue(item: string): boolean {
+ return typeof item !== "undefined" && item !== null;
+ }
}
declare global {
diff --git a/src/panels/lovelace/common/directives/action-handler-directive.ts b/src/panels/lovelace/common/directives/action-handler-directive.ts
index 54fdf11055..e9f9597b9e 100644
--- a/src/panels/lovelace/common/directives/action-handler-directive.ts
+++ b/src/panels/lovelace/common/directives/action-handler-directive.ts
@@ -111,12 +111,10 @@ class ActionHandler extends HTMLElement implements ActionHandler {
y = (ev as MouseEvent).pageY;
}
- if (options.hasHold) {
- this.timer = window.setTimeout(() => {
- this.startAnimation(x, y);
- this.held = true;
- }, this.holdTime);
- }
+ this.timer = window.setTimeout(() => {
+ this.startAnimation(x, y);
+ this.held = true;
+ }, this.holdTime);
this.cooldownStart = true;
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.
// 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.
- const isIOS13 = window.navigator.userAgent.match(/iPhone OS 13_/);
+ const isIOS13 = /iPhone OS 13_/.test(window.navigator.userAgent);
if (!isIOS13) {
element.addEventListener("mousedown", clickStart, { passive: true });
element.addEventListener("click", clickEnd);
@@ -193,7 +191,7 @@ class ActionHandler extends HTMLElement implements ActionHandler {
customElements.define("action-handler", ActionHandler);
-const geActionHandler = (): ActionHandler => {
+const getActionHandler = (): ActionHandler => {
const body = document.body;
if (body.querySelector("action-handler")) {
return body.querySelector("action-handler") as ActionHandler;
@@ -209,7 +207,7 @@ export const actionHandlerBind = (
element: ActionHandlerElement,
options: ActionHandlerOptions
) => {
- const actionhandler: ActionHandler = geActionHandler();
+ const actionhandler: ActionHandler = getActionHandler();
if (!actionhandler) {
return;
}