From d08aa51c165c440af7cf8a890448a6b8f2609228 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 16 Nov 2019 12:09:29 +0100 Subject: [PATCH 1/4] Add maskable icon directive to demo manifest --- demo/public/manifest.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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", From 09e7638c89fb5aa12e5e7d44ceccbbe85403d94b Mon Sep 17 00:00:00 2001 From: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com> Date: Mon, 18 Nov 2019 03:00:50 -0500 Subject: [PATCH 2/4] fix evaluating to false and remove ; (#4228) --- .../more-info/controls/more-info-weather.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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 { From 6ecc60423f6bafddef7d6a8d342525c36855d983 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 18 Nov 2019 11:27:44 +0100 Subject: [PATCH 3/4] Fix actions not working on touch devices (#4231) --- .../directives/action-handler-directive.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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; } From 920ee741f327e7d0131f3dafb239a8cb52de69d0 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 18 Nov 2019 12:50:11 +0100 Subject: [PATCH 4/4] Bumped version to 20191118.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",