diff --git a/src/panels/config/devices/device-detail/ha-device-entities-card.ts b/src/panels/config/devices/device-detail/ha-device-entities-card.ts index e73d02c0c7..96599b1e5f 100644 --- a/src/panels/config/devices/device-detail/ha-device-entities-card.ts +++ b/src/panels/config/devices/device-detail/ha-device-entities-card.ts @@ -11,24 +11,24 @@ import { } from "lit"; import { customElement, property, state } from "lit/decorators"; import { computeDomain } from "../../../../common/entity/compute_domain"; +import { computeStateName } from "../../../../common/entity/compute_state_name"; import { domainIcon } from "../../../../common/entity/domain_icon"; +import { stripPrefixFromEntityName } from "../../../../common/entity/strip_prefix_from_entity_name"; import "../../../../components/entity/state-badge"; import "../../../../components/ha-card"; 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 { ExtEntityRegistryEntry, getExtendedEntityRegistryEntry, } 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") export class HaDeviceEntitiesCard extends LitElement { @@ -165,7 +165,7 @@ export class HaDeviceEntitiesCard extends LitElement { const stateObj = this.hass.states[entry.entity_id]; let name = entry.name - ? entry.name + ? stripPrefixFromEntityName(entry.name, this.deviceName.toLowerCase()) : entry.has_entity_name ? entry.original_name || this.deviceName : stripPrefixFromEntityName(