mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +00:00
Show icon of disabled entities (#19717)
This commit is contained in:
parent
e51c98e1a7
commit
abb014745a
@ -31,11 +31,11 @@ import "../../../components/ha-area-picker";
|
||||
import "../../../components/ha-icon";
|
||||
import "../../../components/ha-icon-button-next";
|
||||
import "../../../components/ha-icon-picker";
|
||||
import "../../../components/ha-state-icon";
|
||||
import "../../../components/ha-list-item";
|
||||
import "../../../components/ha-radio";
|
||||
import "../../../components/ha-select";
|
||||
import "../../../components/ha-settings-row";
|
||||
import "../../../components/ha-state-icon";
|
||||
import "../../../components/ha-switch";
|
||||
import type { HaSwitch } from "../../../components/ha-switch";
|
||||
import "../../../components/ha-textfield";
|
||||
@ -52,10 +52,6 @@ import {
|
||||
createConfigFlow,
|
||||
handleConfigFlowStep,
|
||||
} from "../../../data/config_flow";
|
||||
import {
|
||||
createOptionsFlow,
|
||||
handleOptionsFlowStep,
|
||||
} from "../../../data/options_flow";
|
||||
import { DataEntryFlowStepCreateEntry } from "../../../data/data_entry_flow";
|
||||
import {
|
||||
DeviceRegistryEntry,
|
||||
@ -70,9 +66,13 @@ import {
|
||||
subscribeEntityRegistry,
|
||||
updateEntityRegistryEntry,
|
||||
} from "../../../data/entity_registry";
|
||||
import { entityIcon } from "../../../data/icons";
|
||||
import { entityIcon, entryIcon } from "../../../data/icons";
|
||||
import { domainToName } from "../../../data/integration";
|
||||
import { getNumberDeviceClassConvertibleUnits } from "../../../data/number";
|
||||
import {
|
||||
createOptionsFlow,
|
||||
handleOptionsFlowStep,
|
||||
} from "../../../data/options_flow";
|
||||
import {
|
||||
getSensorDeviceClassConvertibleUnits,
|
||||
getSensorNumericDeviceClasses,
|
||||
@ -392,7 +392,8 @@ export class EntityRegistrySettingsEditor extends LitElement {
|
||||
)}
|
||||
.placeholder=${this.entry.original_icon ||
|
||||
stateObj?.attributes.icon ||
|
||||
(stateObj && until(entityIcon(this.hass, stateObj)))}
|
||||
(stateObj && until(entityIcon(this.hass, stateObj))) ||
|
||||
until(entryIcon(this.hass, this.entry))}
|
||||
.disabled=${this.disabled}
|
||||
>
|
||||
${!this._icon && !stateObj?.attributes.icon && stateObj
|
||||
|
@ -25,6 +25,7 @@ import { customElement, property, query, state } from "lit/decorators";
|
||||
import { classMap } from "lit/directives/class-map";
|
||||
import { ifDefined } from "lit/directives/if-defined";
|
||||
import { styleMap } from "lit/directives/style-map";
|
||||
import { until } from "lit/directives/until";
|
||||
import memoize from "memoize-one";
|
||||
import type { HASSDomEvent } from "../../../common/dom/fire_event";
|
||||
import { computeDomain } from "../../../common/entity/compute_domain";
|
||||
@ -42,6 +43,7 @@ import type {
|
||||
} from "../../../components/data-table/ha-data-table";
|
||||
import "../../../components/ha-button-menu";
|
||||
import "../../../components/ha-check-list-item";
|
||||
import "../../../components/ha-icon";
|
||||
import "../../../components/ha-icon-button";
|
||||
import "../../../components/ha-svg-icon";
|
||||
import { ConfigEntry, getConfigEntries } from "../../../data/config_entries";
|
||||
@ -53,6 +55,7 @@ import {
|
||||
removeEntityRegistryEntry,
|
||||
updateEntityRegistryEntry,
|
||||
} from "../../../data/entity_registry";
|
||||
import { entryIcon } from "../../../data/icons";
|
||||
import { domainToName } from "../../../data/integration";
|
||||
import {
|
||||
showAlertDialog,
|
||||
@ -207,14 +210,23 @@ export class HaConfigEntities extends LitElement {
|
||||
title: "",
|
||||
label: localize("ui.panel.config.entities.picker.headers.state_icon"),
|
||||
type: "icon",
|
||||
template: (entry) => html`
|
||||
<ha-state-icon
|
||||
title=${ifDefined(entry.entity?.state)}
|
||||
slot="item-icon"
|
||||
.hass=${this.hass}
|
||||
.stateObj=${entry.entity}
|
||||
></ha-state-icon>
|
||||
`,
|
||||
template: (entry) =>
|
||||
entry.icon
|
||||
? html`
|
||||
<ha-state-icon
|
||||
title=${ifDefined(entry.entity?.state)}
|
||||
slot="item-icon"
|
||||
.hass=${this.hass}
|
||||
.stateObj=${entry.entity}
|
||||
></ha-state-icon>
|
||||
`
|
||||
: html`
|
||||
<ha-icon
|
||||
icon=${until(
|
||||
entryIcon(this.hass, entry as EntityRegistryEntry)
|
||||
)}
|
||||
></ha-icon>
|
||||
`,
|
||||
},
|
||||
name: {
|
||||
main: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user