From 8c65876413aceddd67f3c0ba8ff264ea7a49d7e3 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Wed, 13 Aug 2025 18:50:00 +0300 Subject: [PATCH] Filter hidden entities from group more-info (#26527) --- src/dialogs/more-info/more-info-content.ts | 51 +++++++++++++--------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/src/dialogs/more-info/more-info-content.ts b/src/dialogs/more-info/more-info-content.ts index 3e3808ca21..2c62de3cc7 100644 --- a/src/dialogs/more-info/more-info-content.ts +++ b/src/dialogs/more-info/more-info-content.ts @@ -72,31 +72,40 @@ class MoreInfoContent extends LitElement { return ( stateObj.attributes && stateObj.attributes.entity_id && - Array.isArray(stateObj.attributes.entity_id) + Array.isArray(stateObj.attributes.entity_id) && + stateObj.attributes.entity_id.some( + (entityId: string) => !this.hass!.entities[entityId]?.hidden + ) ); } private _entitiesSectionConfig = memoizeOne((entityIds: string[]) => { - const cards = entityIds.map((entityId) => { - const features: LovelaceCardFeatureConfig[] = []; - const context = { entity_id: entityId }; - if (supportsCoverPositionCardFeature(this.hass!, context)) { - features.push({ - type: "cover-position", - }); - } else if (supportsLightBrightnessCardFeature(this.hass!, context)) { - features.push({ - type: "light-brightness", - }); - } - return { - type: "tile", - entity: entityId, - features_position: "inline", - features, - grid_options: { columns: 12 }, - } as TileCardConfig; - }); + const cards = entityIds + .map((entityId) => { + const entity = this.hass!.entities[entityId]; + if (entity?.hidden) { + return null; + } + const features: LovelaceCardFeatureConfig[] = []; + const context = { entity_id: entityId }; + if (supportsCoverPositionCardFeature(this.hass!, context)) { + features.push({ + type: "cover-position", + }); + } else if (supportsLightBrightnessCardFeature(this.hass!, context)) { + features.push({ + type: "light-brightness", + }); + } + return { + type: "tile", + entity: entityId, + features_position: "inline", + features, + grid_options: { columns: 12 }, + } as TileCardConfig; + }) + .filter(Boolean); return { type: "grid", cards,