From 986f9d7633ff4390a12fe5ce634345b9c8c0c8ea Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 5 Jun 2020 06:51:31 +0200 Subject: [PATCH 1/7] Fix for config undefined (#6102) --- src/state/disconnect-toast-mixin.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/state/disconnect-toast-mixin.ts b/src/state/disconnect-toast-mixin.ts index 69d076ecc4..a6a8dfa540 100644 --- a/src/state/disconnect-toast-mixin.ts +++ b/src/state/disconnect-toast-mixin.ts @@ -22,6 +22,7 @@ export default >(superClass: T) => const oldHass = changedProperties.get("hass"); if ( !changedProperties.has("hass") || + !this.hass!.config || oldHass?.config?.state === this.hass!.config.state ) { return; From 06207defe70b56a670c91e05cf7b9a81bb2a0679 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 5 Jun 2020 22:14:39 +0200 Subject: [PATCH 2/7] Correct glance card size (#6109) --- src/panels/lovelace/cards/hui-glance-card.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/panels/lovelace/cards/hui-glance-card.ts b/src/panels/lovelace/cards/hui-glance-card.ts index f377866025..59e31cb15f 100644 --- a/src/panels/lovelace/cards/hui-glance-card.ts +++ b/src/panels/lovelace/cards/hui-glance-card.ts @@ -69,14 +69,24 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard { return ( (this._config!.title ? 1 : 0) + Math.max( - Math.ceil(this._configEntities!.length / (this._config!.columns || 5)), + ((this._config!.show_icon ? 1 : 0) + + (this._config!.show_name && this._config!.show_state ? 1 : 0)) * + Math.ceil( + this._configEntities!.length / (this._config!.columns || 5) + ), 1 ) ); } public setConfig(config: GlanceCardConfig): void { - this._config = { state_color: true, ...config }; + this._config = { + show_name: true, + show_state: true, + show_icon: true, + state_color: true, + ...config, + }; const entities = processConfigEntities(config.entities); for (const entity of entities) { @@ -234,7 +244,7 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard { hasAction(entityConf.tap_action) ? "0" : undefined )} > - ${this._config!.show_name !== false + ${this._config!.show_name ? html`
${"name" in entityConf @@ -243,7 +253,7 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard {
` : ""} - ${this._config!.show_icon !== false + ${this._config!.show_icon ? html` ` : ""} - ${this._config!.show_state !== false && entityConf.show_state !== false + ${this._config!.show_state && entityConf.show_state !== false ? html`
${computeDomain(entityConf.entity) === "sensor" && From f558f7fb8c0c2bd61e20271f2b40fae822b8dbf0 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 5 Jun 2020 22:15:06 +0200 Subject: [PATCH 3/7] Set min width to dev states columns (#6108) --- src/panels/developer-tools/state/developer-tools-state.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panels/developer-tools/state/developer-tools-state.js b/src/panels/developer-tools/state/developer-tools-state.js index 84552378d3..c1199baebc 100644 --- a/src/panels/developer-tools/state/developer-tools-state.js +++ b/src/panels/developer-tools/state/developer-tools-state.js @@ -45,7 +45,6 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { } .entities tr { - word-break: break-word; vertical-align: top; } @@ -58,6 +57,8 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { } .entities td { padding: 4px; + min-width: 200px; + word-break: break-word; } .entities ha-svg-icon { --mdc-icon-size: 20px; From 10a5b3f9c3fd54667981e7df4336d1ee42181e4f Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 5 Jun 2020 23:46:16 +0200 Subject: [PATCH 4/7] Glance height fix (Again): A row could be zero height (#6110) --- src/panels/lovelace/cards/hui-glance-card.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/panels/lovelace/cards/hui-glance-card.ts b/src/panels/lovelace/cards/hui-glance-card.ts index 59e31cb15f..4d3d577de6 100644 --- a/src/panels/lovelace/cards/hui-glance-card.ts +++ b/src/panels/lovelace/cards/hui-glance-card.ts @@ -66,17 +66,15 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard { private _configEntities?: GlanceConfigEntity[]; public getCardSize(): number { - return ( - (this._config!.title ? 1 : 0) + - Math.max( - ((this._config!.show_icon ? 1 : 0) + - (this._config!.show_name && this._config!.show_state ? 1 : 0)) * - Math.ceil( - this._configEntities!.length / (this._config!.columns || 5) - ), - 1 - ) + const rowHeight = + (this._config!.show_icon ? 1 : 0) + + (this._config!.show_name && this._config!.show_state ? 1 : 0) || 1; + + const numRows = Math.ceil( + this._configEntities!.length / (this._config!.columns || 5) ); + + return (this._config!.title ? 1 : 0) + rowHeight * numRows; } public setConfig(config: GlanceCardConfig): void { From ca678330d3f1f30c39e87b1b2b8dbbfe53d632c2 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 5 Jun 2020 23:46:48 +0200 Subject: [PATCH 5/7] Bumped version to 20200603.2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 03c5157ae6..36a6357884 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20200603.1", + version="20200603.2", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", From c4340e05d269bd600bb111f8cbe982525d11e5a8 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Sat, 13 Jun 2020 08:58:21 +0200 Subject: [PATCH 6/7] Disable pointer events when disabled (#6155) --- src/components/ha-icon-button.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/components/ha-icon-button.ts b/src/components/ha-icon-button.ts index 311e4fb368..1c645b50cd 100644 --- a/src/components/ha-icon-button.ts +++ b/src/components/ha-icon-button.ts @@ -24,28 +24,21 @@ export class HaIconButton extends LitElement { protected render(): TemplateResult { return html` - + `; } - private _handleClick(ev) { - if (this.disabled) { - ev.stopPropagation(); - } - } - static get styles(): CSSResult { return css` :host { display: inline-block; outline: none; } + :host([disabled]) { + pointer-events: none; + } mwc-icon-button { --mdc-theme-on-primary: currentColor; --mdc-theme-text-disabled-on-light: var(--disabled-text-color); From bee21cd3fe5bf2aaf22a01aef44473c288cb6630 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Sat, 13 Jun 2020 10:56:44 +0200 Subject: [PATCH 7/7] Bumped version to 20200603.3 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 36a6357884..adb2a8790b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20200603.2", + version="20200603.3", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors",