Show hidden entities on device page (#12177)

This commit is contained in:
Bram Kragten 2022-03-31 17:59:20 +02:00 committed by GitHub
parent e6c580aadc
commit 8de542388f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -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;
}
}

View File

@ -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!",