From 8de542388fd7a9338043c63f69d3a12382f7942f Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 31 Mar 2022 17:59:20 +0200 Subject: [PATCH] Show hidden entities on device page (#12177) --- .../devices/device-detail/ha-device-entities-card.ts | 8 ++++++-- src/translations/en.json | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) 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 19e60da9ee..04209e5947 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 @@ -75,7 +75,7 @@ export class HaDeviceEntitiesCard extends LitElement { this._entityRows = []; this.entities.forEach((entry) => { - if (entry.disabled_by || entry.hidden_by) { + if (entry.disabled_by) { if (this._extDisabledEntityEntries) { hiddenEntities.push( this._extDisabledEntityEntries[entry.entity_id] || entry @@ -167,7 +167,11 @@ export class HaDeviceEntitiesCard extends LitElement { computeStateName(stateObj), this.deviceName.toLowerCase() ); - if (name) { + if (entry.hidden_by) { + config.name = `${ + name || computeStateName(stateObj) + } (${this.hass.localize("ui.panel.config.devices.entities.hidden")})`; + } else if (name) { config.name = name; } } diff --git a/src/translations/en.json b/src/translations/en.json index b31065b7fa..7a7dcc5032 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2463,7 +2463,8 @@ "add_entities_lovelace": "Add to dashboard", "none": "This device has no entities", "show_less": "Show less", - "hidden_entities": "+{count} {count, plural,\n one {entity}\n other {entities}\n} not shown" + "hidden_entities": "+{count} {count, plural,\n one {entity}\n other {entities}\n} not shown", + "hidden": "Hidden" }, "confirm_rename_entity_ids": "Do you also want to rename the entity IDs of your entities?", "confirm_rename_entity_ids_warning": "This will not change any configuration (like automations, scripts, scenes, dashboards) that is currently using these entities! You will have to update them yourself to use the new entity IDs!",