mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-28 15:27:20 +00:00
Merge pull request #13319 from home-assistant/fix-device-page-strip
This commit is contained in:
commit
ecc1bf5206
@ -11,24 +11,24 @@ import {
|
|||||||
} from "lit";
|
} from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { computeDomain } from "../../../../common/entity/compute_domain";
|
import { computeDomain } from "../../../../common/entity/compute_domain";
|
||||||
|
import { computeStateName } from "../../../../common/entity/compute_state_name";
|
||||||
import { domainIcon } from "../../../../common/entity/domain_icon";
|
import { domainIcon } from "../../../../common/entity/domain_icon";
|
||||||
|
import { stripPrefixFromEntityName } from "../../../../common/entity/strip_prefix_from_entity_name";
|
||||||
import "../../../../components/entity/state-badge";
|
import "../../../../components/entity/state-badge";
|
||||||
import "../../../../components/ha-card";
|
import "../../../../components/ha-card";
|
||||||
import "../../../../components/ha-icon";
|
import "../../../../components/ha-icon";
|
||||||
import type { LovelaceRowConfig } from "../../../lovelace/entity-rows/types";
|
|
||||||
import type { HomeAssistant } from "../../../../types";
|
|
||||||
import type { HuiErrorCard } from "../../../lovelace/cards/hui-error-card";
|
|
||||||
import { createRowElement } from "../../../lovelace/create-element/create-row-element";
|
|
||||||
import { addEntitiesToLovelaceView } from "../../../lovelace/editor/add-entities-to-view";
|
|
||||||
import { LovelaceRow } from "../../../lovelace/entity-rows/types";
|
|
||||||
import { showEntityEditorDialog } from "../../entities/show-dialog-entity-editor";
|
|
||||||
import { EntityRegistryStateEntry } from "../ha-config-device-page";
|
|
||||||
import { computeStateName } from "../../../../common/entity/compute_state_name";
|
|
||||||
import { stripPrefixFromEntityName } from "../../../../common/entity/strip_prefix_from_entity_name";
|
|
||||||
import {
|
import {
|
||||||
ExtEntityRegistryEntry,
|
ExtEntityRegistryEntry,
|
||||||
getExtendedEntityRegistryEntry,
|
getExtendedEntityRegistryEntry,
|
||||||
} from "../../../../data/entity_registry";
|
} from "../../../../data/entity_registry";
|
||||||
|
import type { HomeAssistant } from "../../../../types";
|
||||||
|
import type { HuiErrorCard } from "../../../lovelace/cards/hui-error-card";
|
||||||
|
import { createRowElement } from "../../../lovelace/create-element/create-row-element";
|
||||||
|
import { addEntitiesToLovelaceView } from "../../../lovelace/editor/add-entities-to-view";
|
||||||
|
import type { LovelaceRowConfig } from "../../../lovelace/entity-rows/types";
|
||||||
|
import { LovelaceRow } from "../../../lovelace/entity-rows/types";
|
||||||
|
import { showEntityEditorDialog } from "../../entities/show-dialog-entity-editor";
|
||||||
|
import { EntityRegistryStateEntry } from "../ha-config-device-page";
|
||||||
|
|
||||||
@customElement("ha-device-entities-card")
|
@customElement("ha-device-entities-card")
|
||||||
export class HaDeviceEntitiesCard extends LitElement {
|
export class HaDeviceEntitiesCard extends LitElement {
|
||||||
@ -165,7 +165,7 @@ export class HaDeviceEntitiesCard extends LitElement {
|
|||||||
const stateObj = this.hass.states[entry.entity_id];
|
const stateObj = this.hass.states[entry.entity_id];
|
||||||
|
|
||||||
let name = entry.name
|
let name = entry.name
|
||||||
? entry.name
|
? stripPrefixFromEntityName(entry.name, this.deviceName.toLowerCase())
|
||||||
: entry.has_entity_name
|
: entry.has_entity_name
|
||||||
? entry.original_name || this.deviceName
|
? entry.original_name || this.deviceName
|
||||||
: stripPrefixFromEntityName(
|
: stripPrefixFromEntityName(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user