mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
20230802.0 (#17457)
This commit is contained in:
commit
7d80eb06b0
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "home-assistant-frontend"
|
name = "home-assistant-frontend"
|
||||||
version = "20230801.0"
|
version = "20230802.0"
|
||||||
license = {text = "Apache-2.0"}
|
license = {text = "Apache-2.0"}
|
||||||
description = "The Home Assistant frontend"
|
description = "The Home Assistant frontend"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { HassEntity } from "home-assistant-js-websocket";
|
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 { ComboBoxLitRenderer } from "@vaadin/combo-box/lit";
|
||||||
import { customElement, property, query, state } from "lit/decorators";
|
import { customElement, property, query, state } from "lit/decorators";
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
@ -87,6 +87,8 @@ export class HaStatisticPicker extends LitElement {
|
|||||||
|
|
||||||
private _statistics: StatisticItem[] = [];
|
private _statistics: StatisticItem[] = [];
|
||||||
|
|
||||||
|
@state() private _filteredItems?: StatisticItem[] = undefined;
|
||||||
|
|
||||||
private _rowRenderer: ComboBoxLitRenderer<StatisticItem> = (item) =>
|
private _rowRenderer: ComboBoxLitRenderer<StatisticItem> = (item) =>
|
||||||
html`<mwc-list-item graphic="avatar" twoline>
|
html`<mwc-list-item graphic="avatar" twoline>
|
||||||
${item.state
|
${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`
|
return html`
|
||||||
<ha-combo-box
|
<ha-combo-box
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@ -265,9 +271,8 @@ export class HaStatisticPicker extends LitElement {
|
|||||||
.renderer=${this._rowRenderer}
|
.renderer=${this._rowRenderer}
|
||||||
.disabled=${this.disabled}
|
.disabled=${this.disabled}
|
||||||
.allowCustomValue=${this.allowCustomEntity}
|
.allowCustomValue=${this.allowCustomEntity}
|
||||||
.filteredItems=${this.value && this._statistics.length === 0
|
.items=${this._statistics}
|
||||||
? undefined
|
.filteredItems=${this._filteredItems ?? this._statistics}
|
||||||
: this._statistics}
|
|
||||||
item-value-path="id"
|
item-value-path="id"
|
||||||
item-id-path="id"
|
item-id-path="id"
|
||||||
item-label-path="name"
|
item-label-path="name"
|
||||||
@ -303,11 +308,10 @@ export class HaStatisticPicker extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _filterChanged(ev: CustomEvent): void {
|
private _filterChanged(ev: CustomEvent): void {
|
||||||
const target = ev.target as HaComboBox;
|
|
||||||
const filterString = ev.detail.value.toLowerCase();
|
const filterString = ev.detail.value.toLowerCase();
|
||||||
target.filteredItems = filterString.length
|
this._filteredItems = filterString.length
|
||||||
? fuzzyFilterSort<StatisticItem>(filterString, this._statistics)
|
? fuzzyFilterSort<StatisticItem>(filterString, this._statistics)
|
||||||
: this._statistics;
|
: undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _setValue(value: string) {
|
private _setValue(value: string) {
|
||||||
|
@ -4,7 +4,6 @@ import "@material/mwc-list/mwc-list-item";
|
|||||||
import "@material/mwc-tab";
|
import "@material/mwc-tab";
|
||||||
import "@material/mwc-tab-bar";
|
import "@material/mwc-tab-bar";
|
||||||
import { mdiDotsVertical } from "@mdi/js";
|
import { mdiDotsVertical } from "@mdi/js";
|
||||||
import { PaperInputElement } from "@polymer/paper-input/paper-input";
|
|
||||||
import { css, CSSResultGroup, html, LitElement, nothing } from "lit";
|
import { css, CSSResultGroup, html, LitElement, nothing } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { cache } from "lit/directives/cache";
|
import { cache } from "lit/directives/cache";
|
||||||
@ -15,7 +14,6 @@ import "../../../components/ha-circular-progress";
|
|||||||
import "../../../components/ha-expansion-panel";
|
import "../../../components/ha-expansion-panel";
|
||||||
import "../../../components/ha-formfield";
|
import "../../../components/ha-formfield";
|
||||||
import "../../../components/ha-icon-button";
|
import "../../../components/ha-icon-button";
|
||||||
import "../../../components/ha-radio";
|
|
||||||
import { extractApiErrorMessage } from "../../../data/hassio/common";
|
import { extractApiErrorMessage } from "../../../data/hassio/common";
|
||||||
import {
|
import {
|
||||||
AccessPoints,
|
AccessPoints,
|
||||||
@ -31,6 +29,10 @@ import {
|
|||||||
} from "../../../dialogs/generic/show-dialog-box";
|
} from "../../../dialogs/generic/show-dialog-box";
|
||||||
import type { HomeAssistant } from "../../../types";
|
import type { HomeAssistant } from "../../../types";
|
||||||
import { showIPDetailDialog } from "./show-ip-detail-dialog";
|
import { showIPDetailDialog } from "./show-ip-detail-dialog";
|
||||||
|
import "../../../components/ha-textfield";
|
||||||
|
import type { HaTextField } from "../../../components/ha-textfield";
|
||||||
|
import "../../../components/ha-radio";
|
||||||
|
import type { HaRadio } from "../../../components/ha-radio";
|
||||||
|
|
||||||
const IP_VERSIONS = ["ipv4", "ipv6"];
|
const IP_VERSIONS = ["ipv4", "ipv6"];
|
||||||
|
|
||||||
@ -213,18 +215,16 @@ export class HassioNetwork extends LitElement {
|
|||||||
${this._wifiConfiguration.auth === "wpa-psk" ||
|
${this._wifiConfiguration.auth === "wpa-psk" ||
|
||||||
this._wifiConfiguration.auth === "wep"
|
this._wifiConfiguration.auth === "wep"
|
||||||
? html`
|
? html`
|
||||||
<paper-input
|
<ha-textfield
|
||||||
class="flex-auto"
|
|
||||||
type="password"
|
type="password"
|
||||||
id="psk"
|
id="psk"
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
"ui.panel.config.network.supervisor.wifi_password"
|
"ui.panel.config.network.supervisor.wifi_password"
|
||||||
)}
|
)}
|
||||||
version="wifi"
|
.version="wifi"
|
||||||
@value-changed=${this
|
@change=${this._handleInputValueChangedWifi}
|
||||||
._handleInputValueChangedWifi}
|
|
||||||
>
|
>
|
||||||
</paper-input>
|
</ha-textfield>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
`
|
`
|
||||||
@ -348,39 +348,36 @@ export class HassioNetwork extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
${this._interface![version].method === "static"
|
${this._interface![version].method === "static"
|
||||||
? html`
|
? html`
|
||||||
<paper-input
|
<ha-textfield
|
||||||
class="flex-auto"
|
|
||||||
id="address"
|
id="address"
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
"ui.panel.config.network.supervisor.ip_netmask"
|
"ui.panel.config.network.supervisor.ip_netmask"
|
||||||
)}
|
)}
|
||||||
.version=${version}
|
.version=${version}
|
||||||
.value=${this._toString(this._interface![version].address)}
|
.value=${this._toString(this._interface![version].address)}
|
||||||
@value-changed=${this._handleInputValueChanged}
|
@change=${this._handleInputValueChanged}
|
||||||
>
|
>
|
||||||
</paper-input>
|
</ha-textfield>
|
||||||
<paper-input
|
<ha-textfield
|
||||||
class="flex-auto"
|
|
||||||
id="gateway"
|
id="gateway"
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
"ui.panel.config.network.supervisor.gateway"
|
"ui.panel.config.network.supervisor.gateway"
|
||||||
)}
|
)}
|
||||||
.version=${version}
|
.version=${version}
|
||||||
.value=${this._interface![version].gateway}
|
.value=${this._interface![version].gateway}
|
||||||
@value-changed=${this._handleInputValueChanged}
|
@change=${this._handleInputValueChanged}
|
||||||
>
|
>
|
||||||
</paper-input>
|
</ha-textfield>
|
||||||
<paper-input
|
<ha-textfield
|
||||||
class="flex-auto"
|
|
||||||
id="nameservers"
|
id="nameservers"
|
||||||
.label=${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
"ui.panel.config.network.supervisor.dns_servers"
|
"ui.panel.config.network.supervisor.dns_servers"
|
||||||
)}
|
)}
|
||||||
.version=${version}
|
.version=${version}
|
||||||
.value=${this._toString(this._interface![version].nameservers)}
|
.value=${this._toString(this._interface![version].nameservers)}
|
||||||
@value-changed=${this._handleInputValueChanged}
|
@change=${this._handleInputValueChanged}
|
||||||
>
|
>
|
||||||
</paper-input>
|
</ha-textfield>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
</ha-expansion-panel>
|
</ha-expansion-panel>
|
||||||
@ -487,8 +484,9 @@ export class HassioNetwork extends LitElement {
|
|||||||
this._interface = { ...this._interfaces[ev.detail.index] };
|
this._interface = { ...this._interfaces[ev.detail.index] };
|
||||||
}
|
}
|
||||||
|
|
||||||
private _handleRadioValueChanged(ev: CustomEvent): void {
|
private _handleRadioValueChanged(ev: Event): void {
|
||||||
const value = (ev.target as any).value as "disabled" | "auto" | "static";
|
const source = ev.target as HaRadio;
|
||||||
|
const value = source.value as "disabled" | "auto" | "static";
|
||||||
const version = (ev.target as any).version as "ipv4" | "ipv6";
|
const version = (ev.target as any).version as "ipv4" | "ipv6";
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -504,21 +502,19 @@ export class HassioNetwork extends LitElement {
|
|||||||
this.requestUpdate("_interface");
|
this.requestUpdate("_interface");
|
||||||
}
|
}
|
||||||
|
|
||||||
private _handleRadioValueChangedAp(ev: CustomEvent): void {
|
private _handleRadioValueChangedAp(ev: Event): void {
|
||||||
const value = (ev.target as any).value as string as
|
const source = ev.target as HaRadio;
|
||||||
| "open"
|
const value = source.value as string as "open" | "wep" | "wpa-psk";
|
||||||
| "wep"
|
|
||||||
| "wpa-psk";
|
|
||||||
this._wifiConfiguration!.auth = value;
|
this._wifiConfiguration!.auth = value;
|
||||||
this._dirty = true;
|
this._dirty = true;
|
||||||
this.requestUpdate("_wifiConfiguration");
|
this.requestUpdate("_wifiConfiguration");
|
||||||
}
|
}
|
||||||
|
|
||||||
private _handleInputValueChanged(ev: CustomEvent): void {
|
private _handleInputValueChanged(ev: Event): void {
|
||||||
const value: string | null | undefined = (ev.target as PaperInputElement)
|
const source = ev.target as HaTextField;
|
||||||
.value;
|
const value = source.value;
|
||||||
const version = (ev.target as any).version as "ipv4" | "ipv6";
|
const version = (ev.target as any).version as "ipv4" | "ipv6";
|
||||||
const id = (ev.target as PaperInputElement).id;
|
const id = source.id;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!value ||
|
!value ||
|
||||||
@ -532,10 +528,10 @@ export class HassioNetwork extends LitElement {
|
|||||||
this._interface[version]![id] = value;
|
this._interface[version]![id] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _handleInputValueChangedWifi(ev: CustomEvent): void {
|
private _handleInputValueChangedWifi(ev: Event): void {
|
||||||
const value: string | null | undefined = (ev.target as PaperInputElement)
|
const source = ev.target as HaTextField;
|
||||||
.value;
|
const value = source.value;
|
||||||
const id = (ev.target as PaperInputElement).id;
|
const id = source.id;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!value ||
|
!value ||
|
||||||
@ -573,8 +569,9 @@ export class HassioNetwork extends LitElement {
|
|||||||
--expansion-panel-summary-padding: 0 16px;
|
--expansion-panel-summary-padding: 0 16px;
|
||||||
margin: 4px 0;
|
margin: 4px 0;
|
||||||
}
|
}
|
||||||
paper-input {
|
ha-textfield {
|
||||||
padding: 0 14px;
|
display: block;
|
||||||
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
mwc-list-item {
|
mwc-list-item {
|
||||||
--mdc-list-side-padding: 10px;
|
--mdc-list-side-padding: 10px;
|
||||||
|
@ -80,6 +80,10 @@ export class HuiEnergySourcesTableCard
|
|||||||
let totalWater = 0;
|
let totalWater = 0;
|
||||||
let totalWaterCost = 0;
|
let totalWaterCost = 0;
|
||||||
|
|
||||||
|
let hasGridCost = false;
|
||||||
|
let hasGasCost = false;
|
||||||
|
let hasWaterCost = false;
|
||||||
|
|
||||||
let totalGridCompare = 0;
|
let totalGridCompare = 0;
|
||||||
let totalGridCostCompare = 0;
|
let totalGridCostCompare = 0;
|
||||||
let totalSolarCompare = 0;
|
let totalSolarCompare = 0;
|
||||||
@ -477,6 +481,7 @@ export class HuiEnergySourcesTableCard
|
|||||||
) || 0
|
) || 0
|
||||||
: null;
|
: null;
|
||||||
if (cost !== null) {
|
if (cost !== null) {
|
||||||
|
hasGridCost = true;
|
||||||
totalGridCost += cost;
|
totalGridCost += cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -575,6 +580,7 @@ export class HuiEnergySourcesTableCard
|
|||||||
) || 0) * -1
|
) || 0) * -1
|
||||||
: null;
|
: null;
|
||||||
if (cost !== null) {
|
if (cost !== null) {
|
||||||
|
hasGridCost = true;
|
||||||
totalGridCost += cost;
|
totalGridCost += cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -686,14 +692,16 @@ export class HuiEnergySourcesTableCard
|
|||||||
? html`<td
|
? html`<td
|
||||||
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
||||||
>
|
>
|
||||||
${formatNumber(
|
${hasGridCost
|
||||||
totalGridCostCompare,
|
? formatNumber(
|
||||||
this.hass.locale,
|
totalGridCostCompare,
|
||||||
{
|
this.hass.locale,
|
||||||
style: "currency",
|
{
|
||||||
currency: this.hass.config.currency!,
|
style: "currency",
|
||||||
}
|
currency: this.hass.config.currency!,
|
||||||
)}
|
}
|
||||||
|
)
|
||||||
|
: ""}
|
||||||
</td>`
|
</td>`
|
||||||
: ""}`
|
: ""}`
|
||||||
: ""}
|
: ""}
|
||||||
@ -706,10 +714,12 @@ export class HuiEnergySourcesTableCard
|
|||||||
? html`<td
|
? html`<td
|
||||||
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
||||||
>
|
>
|
||||||
${formatNumber(totalGridCost, this.hass.locale, {
|
${hasGridCost
|
||||||
style: "currency",
|
? formatNumber(totalGridCost, this.hass.locale, {
|
||||||
currency: this.hass.config.currency!,
|
style: "currency",
|
||||||
})}
|
currency: this.hass.config.currency!,
|
||||||
|
})
|
||||||
|
: ""}
|
||||||
</td>`
|
</td>`
|
||||||
: ""}
|
: ""}
|
||||||
</tr>`
|
</tr>`
|
||||||
@ -737,6 +747,7 @@ export class HuiEnergySourcesTableCard
|
|||||||
0
|
0
|
||||||
: null;
|
: null;
|
||||||
if (cost !== null) {
|
if (cost !== null) {
|
||||||
|
hasGasCost = true;
|
||||||
totalGasCost += cost;
|
totalGasCost += cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -835,14 +846,16 @@ export class HuiEnergySourcesTableCard
|
|||||||
? html`<td
|
? html`<td
|
||||||
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
||||||
>
|
>
|
||||||
${formatNumber(
|
${hasGasCost
|
||||||
totalGasCostCompare,
|
? formatNumber(
|
||||||
this.hass.locale,
|
totalGasCostCompare,
|
||||||
{
|
this.hass.locale,
|
||||||
style: "currency",
|
{
|
||||||
currency: this.hass.config.currency!,
|
style: "currency",
|
||||||
}
|
currency: this.hass.config.currency!,
|
||||||
)}
|
}
|
||||||
|
)
|
||||||
|
: ""}
|
||||||
</td>`
|
</td>`
|
||||||
: ""}`
|
: ""}`
|
||||||
: ""}
|
: ""}
|
||||||
@ -855,10 +868,12 @@ export class HuiEnergySourcesTableCard
|
|||||||
? html`<td
|
? html`<td
|
||||||
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
||||||
>
|
>
|
||||||
${formatNumber(totalGasCost, this.hass.locale, {
|
${hasGasCost
|
||||||
style: "currency",
|
? formatNumber(totalGasCost, this.hass.locale, {
|
||||||
currency: this.hass.config.currency!,
|
style: "currency",
|
||||||
})}
|
currency: this.hass.config.currency!,
|
||||||
|
})
|
||||||
|
: ""}
|
||||||
</td>`
|
</td>`
|
||||||
: ""}
|
: ""}
|
||||||
</tr>`
|
</tr>`
|
||||||
@ -886,6 +901,7 @@ export class HuiEnergySourcesTableCard
|
|||||||
0
|
0
|
||||||
: null;
|
: null;
|
||||||
if (cost !== null) {
|
if (cost !== null) {
|
||||||
|
hasWaterCost = true;
|
||||||
totalWaterCost += cost;
|
totalWaterCost += cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -984,14 +1000,16 @@ export class HuiEnergySourcesTableCard
|
|||||||
? html`<td
|
? html`<td
|
||||||
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
||||||
>
|
>
|
||||||
${formatNumber(
|
${hasWaterCost
|
||||||
totalWaterCostCompare,
|
? formatNumber(
|
||||||
this.hass.locale,
|
totalWaterCostCompare,
|
||||||
{
|
this.hass.locale,
|
||||||
style: "currency",
|
{
|
||||||
currency: this.hass.config.currency!,
|
style: "currency",
|
||||||
}
|
currency: this.hass.config.currency!,
|
||||||
)}
|
}
|
||||||
|
)
|
||||||
|
: ""}
|
||||||
</td>`
|
</td>`
|
||||||
: ""}`
|
: ""}`
|
||||||
: ""}
|
: ""}
|
||||||
@ -1004,16 +1022,18 @@ export class HuiEnergySourcesTableCard
|
|||||||
? html`<td
|
? html`<td
|
||||||
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
||||||
>
|
>
|
||||||
${formatNumber(totalWaterCost, this.hass.locale, {
|
${hasWaterCost
|
||||||
style: "currency",
|
? formatNumber(totalWaterCost, this.hass.locale, {
|
||||||
currency: this.hass.config.currency!,
|
style: "currency",
|
||||||
})}
|
currency: this.hass.config.currency!,
|
||||||
|
})
|
||||||
|
: ""}
|
||||||
</td>`
|
</td>`
|
||||||
: ""}
|
: ""}
|
||||||
</tr>`
|
</tr>`
|
||||||
: ""}
|
: ""}
|
||||||
${[totalGasCost, totalWaterCost, totalGridCost].filter(Boolean)
|
${[hasGasCost, hasWaterCost, hasGridCost].filter(Boolean).length >
|
||||||
.length > 1
|
1
|
||||||
? html`<tr class="mdc-data-table__row total">
|
? html`<tr class="mdc-data-table__row total">
|
||||||
<td class="mdc-data-table__cell"></td>
|
<td class="mdc-data-table__cell"></td>
|
||||||
<th class="mdc-data-table__cell" scope="row">
|
<th class="mdc-data-table__cell" scope="row">
|
||||||
@ -1022,9 +1042,7 @@ export class HuiEnergySourcesTableCard
|
|||||||
)}
|
)}
|
||||||
</th>
|
</th>
|
||||||
${compare
|
${compare
|
||||||
? html`${showCosts
|
? html`<td class="mdc-data-table__cell"></td>
|
||||||
? html`<td class="mdc-data-table__cell"></td>`
|
|
||||||
: ""}
|
|
||||||
<td
|
<td
|
||||||
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
class="mdc-data-table__cell mdc-data-table__cell--numeric"
|
||||||
>
|
>
|
||||||
|
@ -36,6 +36,7 @@ const HIDE_DOMAIN = new Set([
|
|||||||
"script",
|
"script",
|
||||||
"sun",
|
"sun",
|
||||||
"zone",
|
"zone",
|
||||||
|
"event",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const HIDE_PLATFORM = new Set(["mobile_app"]);
|
const HIDE_PLATFORM = new Set(["mobile_app"]);
|
||||||
|
@ -68,16 +68,23 @@ class HuiEventEntityRow extends LitElement implements LovelaceRow {
|
|||||||
hasDoubleClick: hasAction(this._config.double_tap_action),
|
hasDoubleClick: hasAction(this._config.double_tap_action),
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<div class="what">
|
|
||||||
${computeStateDisplay(
|
|
||||||
this.hass!.localize,
|
|
||||||
stateObj,
|
|
||||||
this.hass.locale,
|
|
||||||
this.hass.config,
|
|
||||||
this.hass.entities
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div class="when">
|
<div class="when">
|
||||||
|
${isUnavailableState(stateObj.state)
|
||||||
|
? computeStateDisplay(
|
||||||
|
this.hass!.localize,
|
||||||
|
stateObj,
|
||||||
|
this.hass.locale,
|
||||||
|
this.hass.config,
|
||||||
|
this.hass.entities
|
||||||
|
)
|
||||||
|
: html`<hui-timestamp-display
|
||||||
|
.hass=${this.hass}
|
||||||
|
.ts=${new Date(stateObj.state)}
|
||||||
|
.format=${this._config.format}
|
||||||
|
capitalize
|
||||||
|
></hui-timestamp-display>`}
|
||||||
|
</div>
|
||||||
|
<div class="what">
|
||||||
${isUnavailableState(stateObj.state)
|
${isUnavailableState(stateObj.state)
|
||||||
? ``
|
? ``
|
||||||
: computeAttributeValueDisplay(
|
: computeAttributeValueDisplay(
|
||||||
@ -104,10 +111,10 @@ class HuiEventEntityRow extends LitElement implements LovelaceRow {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.when {
|
.when {
|
||||||
color: var(--secondary-text-color);
|
color: var(--primary-text-color);
|
||||||
}
|
}
|
||||||
.what {
|
.what {
|
||||||
color: var(--primary-text-color);
|
color: var(--secondary-text-color);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -87,8 +87,7 @@ class PanelShoppingList extends LitElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-left: 4px;
|
margin: 8px;
|
||||||
margin-right: 4px;
|
|
||||||
}
|
}
|
||||||
.column {
|
.column {
|
||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user