Date: Wed, 2 Aug 2023 13:48:48 +0200
Subject: [PATCH 2/6] =?UTF-8?q?Make=20event=20entity=20row=20show=20time?=
=?UTF-8?q?=20as=20relative=20by=20default,=20hide=20in=20gener=E2=80=A6?=
=?UTF-8?q?=20(#17456)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../common/generate-lovelace-config.ts | 1 +
.../entity-rows/hui-event-entity-row.ts | 29 ++++++++++++-------
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/src/panels/lovelace/common/generate-lovelace-config.ts b/src/panels/lovelace/common/generate-lovelace-config.ts
index 65b66c3ce1..673e8286a5 100644
--- a/src/panels/lovelace/common/generate-lovelace-config.ts
+++ b/src/panels/lovelace/common/generate-lovelace-config.ts
@@ -36,6 +36,7 @@ const HIDE_DOMAIN = new Set([
"script",
"sun",
"zone",
+ "event",
]);
const HIDE_PLATFORM = new Set(["mobile_app"]);
diff --git a/src/panels/lovelace/entity-rows/hui-event-entity-row.ts b/src/panels/lovelace/entity-rows/hui-event-entity-row.ts
index cb6e097a50..f7abad2349 100644
--- a/src/panels/lovelace/entity-rows/hui-event-entity-row.ts
+++ b/src/panels/lovelace/entity-rows/hui-event-entity-row.ts
@@ -68,16 +68,23 @@ class HuiEventEntityRow extends LitElement implements LovelaceRow {
hasDoubleClick: hasAction(this._config.double_tap_action),
})}
>
-
- ${computeStateDisplay(
- this.hass!.localize,
- stateObj,
- this.hass.locale,
- this.hass.config,
- this.hass.entities
- )}
-
+ ${isUnavailableState(stateObj.state)
+ ? computeStateDisplay(
+ this.hass!.localize,
+ stateObj,
+ this.hass.locale,
+ this.hass.config,
+ this.hass.entities
+ )
+ : html``}
+
+
${isUnavailableState(stateObj.state)
? ``
: computeAttributeValueDisplay(
@@ -104,10 +111,10 @@ class HuiEventEntityRow extends LitElement implements LovelaceRow {
text-align: right;
}
.when {
- color: var(--secondary-text-color);
+ color: var(--primary-text-color);
}
.what {
- color: var(--primary-text-color);
+ color: var(--secondary-text-color);
}
`;
}
From 0f56e8f985dd896a7d1d90ec8e026316807ded72 Mon Sep 17 00:00:00 2001
From: Bram Kragten
Date: Wed, 2 Aug 2023 13:52:03 +0200
Subject: [PATCH 3/6] Update ha-panel-shopping-list.ts
---
src/panels/shopping-list/ha-panel-shopping-list.ts | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/panels/shopping-list/ha-panel-shopping-list.ts b/src/panels/shopping-list/ha-panel-shopping-list.ts
index a9cfb23eaf..fa5921455b 100644
--- a/src/panels/shopping-list/ha-panel-shopping-list.ts
+++ b/src/panels/shopping-list/ha-panel-shopping-list.ts
@@ -87,8 +87,7 @@ class PanelShoppingList extends LitElement {
display: flex;
flex-direction: row;
justify-content: center;
- margin-left: 4px;
- margin-right: 4px;
+ margin: 8px;
}
.column {
flex: 1 0 0;
From 788e48a5a6367be154d1a8d2acee94208457338e Mon Sep 17 00:00:00 2001
From: Bram Kragten
Date: Wed, 2 Aug 2023 13:52:27 +0200
Subject: [PATCH 4/6] Bumped version to 20230802.0
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 3461519203..50d335eed6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "home-assistant-frontend"
-version = "20230801.0"
+version = "20230802.0"
license = {text = "Apache-2.0"}
description = "The Home Assistant frontend"
readme = "README.md"
From bde93c44bd88102d2f2eddb105a4c664d4a53e99 Mon Sep 17 00:00:00 2001
From: karwosts <32912880+karwosts@users.noreply.github.com>
Date: Wed, 2 Aug 2023 04:53:05 -0700
Subject: [PATCH 5/6] Fix statistic-picker filter behavior (#17453)
---
src/components/entity/ha-statistic-picker.ts | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/components/entity/ha-statistic-picker.ts b/src/components/entity/ha-statistic-picker.ts
index e9a9388243..3a46527766 100644
--- a/src/components/entity/ha-statistic-picker.ts
+++ b/src/components/entity/ha-statistic-picker.ts
@@ -1,5 +1,5 @@
import { HassEntity } from "home-assistant-js-websocket";
-import { html, LitElement, PropertyValues, TemplateResult } from "lit";
+import { html, LitElement, nothing, PropertyValues, TemplateResult } from "lit";
import { ComboBoxLitRenderer } from "@vaadin/combo-box/lit";
import { customElement, property, query, state } from "lit/decorators";
import memoizeOne from "memoize-one";
@@ -87,6 +87,8 @@ export class HaStatisticPicker extends LitElement {
private _statistics: StatisticItem[] = [];
+ @state() private _filteredItems?: StatisticItem[] = undefined;
+
private _rowRenderer: ComboBoxLitRenderer = (item) =>
html`
${item.state
@@ -254,7 +256,11 @@ export class HaStatisticPicker extends LitElement {
}
}
- protected render(): TemplateResult {
+ protected render(): TemplateResult | typeof nothing {
+ if (this._statistics.length === 0) {
+ return nothing;
+ }
+
return html`
(filterString, this._statistics)
- : this._statistics;
+ : undefined;
}
private _setValue(value: string) {
From 6653a8f63426755d6a58bce0ef3d55d83d8ec99c Mon Sep 17 00:00:00 2001
From: karwosts <32912880+karwosts@users.noreply.github.com>
Date: Wed, 2 Aug 2023 04:55:51 -0700
Subject: [PATCH 6/6] Fix some minor issues with cost display in energy sources
table (#17452)
---
.../energy/hui-energy-sources-table-card.ts | 100 +++++++++++-------
1 file changed, 59 insertions(+), 41 deletions(-)
diff --git a/src/panels/lovelace/cards/energy/hui-energy-sources-table-card.ts b/src/panels/lovelace/cards/energy/hui-energy-sources-table-card.ts
index 734a4067ae..4b061f42a0 100644
--- a/src/panels/lovelace/cards/energy/hui-energy-sources-table-card.ts
+++ b/src/panels/lovelace/cards/energy/hui-energy-sources-table-card.ts
@@ -80,6 +80,10 @@ export class HuiEnergySourcesTableCard
let totalWater = 0;
let totalWaterCost = 0;
+ let hasGridCost = false;
+ let hasGasCost = false;
+ let hasWaterCost = false;
+
let totalGridCompare = 0;
let totalGridCostCompare = 0;
let totalSolarCompare = 0;
@@ -477,6 +481,7 @@ export class HuiEnergySourcesTableCard
) || 0
: null;
if (cost !== null) {
+ hasGridCost = true;
totalGridCost += cost;
}
@@ -575,6 +580,7 @@ export class HuiEnergySourcesTableCard
) || 0) * -1
: null;
if (cost !== null) {
+ hasGridCost = true;
totalGridCost += cost;
}
@@ -686,14 +692,16 @@ export class HuiEnergySourcesTableCard
? html`
- ${formatNumber(
- totalGridCostCompare,
- this.hass.locale,
- {
- style: "currency",
- currency: this.hass.config.currency!,
- }
- )}
+ ${hasGridCost
+ ? formatNumber(
+ totalGridCostCompare,
+ this.hass.locale,
+ {
+ style: "currency",
+ currency: this.hass.config.currency!,
+ }
+ )
+ : ""}
| `
: ""}`
: ""}
@@ -706,10 +714,12 @@ export class HuiEnergySourcesTableCard
? html`
- ${formatNumber(totalGridCost, this.hass.locale, {
- style: "currency",
- currency: this.hass.config.currency!,
- })}
+ ${hasGridCost
+ ? formatNumber(totalGridCost, this.hass.locale, {
+ style: "currency",
+ currency: this.hass.config.currency!,
+ })
+ : ""}
| `
: ""}
`
@@ -737,6 +747,7 @@ export class HuiEnergySourcesTableCard
0
: null;
if (cost !== null) {
+ hasGasCost = true;
totalGasCost += cost;
}
@@ -835,14 +846,16 @@ export class HuiEnergySourcesTableCard
? html`
- ${formatNumber(
- totalGasCostCompare,
- this.hass.locale,
- {
- style: "currency",
- currency: this.hass.config.currency!,
- }
- )}
+ ${hasGasCost
+ ? formatNumber(
+ totalGasCostCompare,
+ this.hass.locale,
+ {
+ style: "currency",
+ currency: this.hass.config.currency!,
+ }
+ )
+ : ""}
| `
: ""}`
: ""}
@@ -855,10 +868,12 @@ export class HuiEnergySourcesTableCard
? html`
- ${formatNumber(totalGasCost, this.hass.locale, {
- style: "currency",
- currency: this.hass.config.currency!,
- })}
+ ${hasGasCost
+ ? formatNumber(totalGasCost, this.hass.locale, {
+ style: "currency",
+ currency: this.hass.config.currency!,
+ })
+ : ""}
| `
: ""}
`
@@ -886,6 +901,7 @@ export class HuiEnergySourcesTableCard
0
: null;
if (cost !== null) {
+ hasWaterCost = true;
totalWaterCost += cost;
}
@@ -984,14 +1000,16 @@ export class HuiEnergySourcesTableCard
? html`
- ${formatNumber(
- totalWaterCostCompare,
- this.hass.locale,
- {
- style: "currency",
- currency: this.hass.config.currency!,
- }
- )}
+ ${hasWaterCost
+ ? formatNumber(
+ totalWaterCostCompare,
+ this.hass.locale,
+ {
+ style: "currency",
+ currency: this.hass.config.currency!,
+ }
+ )
+ : ""}
| `
: ""}`
: ""}
@@ -1004,16 +1022,18 @@ export class HuiEnergySourcesTableCard
? html`
- ${formatNumber(totalWaterCost, this.hass.locale, {
- style: "currency",
- currency: this.hass.config.currency!,
- })}
+ ${hasWaterCost
+ ? formatNumber(totalWaterCost, this.hass.locale, {
+ style: "currency",
+ currency: this.hass.config.currency!,
+ })
+ : ""}
| `
: ""}
`
: ""}
- ${[totalGasCost, totalWaterCost, totalGridCost].filter(Boolean)
- .length > 1
+ ${[hasGasCost, hasWaterCost, hasGridCost].filter(Boolean).length >
+ 1
? html`
|
@@ -1022,9 +1042,7 @@ export class HuiEnergySourcesTableCard
)}
|
${compare
- ? html`${showCosts
- ? html` | `
- : ""}
+ ? html` |
|