From 6d7df18e8291f2a8f7c80552240a8e979c1642d7 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 10 Jul 2025 15:58:09 +0200 Subject: [PATCH] Fix available entities and header --- .../voice/ha-more-info-view-toggle-group.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dialogs/more-info/components/voice/ha-more-info-view-toggle-group.ts b/src/dialogs/more-info/components/voice/ha-more-info-view-toggle-group.ts index e7541d71ee..de6e5eecb6 100644 --- a/src/dialogs/more-info/components/voice/ha-more-info-view-toggle-group.ts +++ b/src/dialogs/more-info/components/voice/ha-more-info-view-toggle-group.ts @@ -16,6 +16,7 @@ import type { LovelaceSectionConfig } from "../../../../data/lovelace/config/sec import type { TileCardConfig } from "../../../../panels/lovelace/cards/types"; import "../../../../panels/lovelace/sections/hui-section"; import type { HomeAssistant } from "../../../../types"; +import "../ha-more-info-state-header"; export interface GroupToggleDialogParams { entityIds: string[]; @@ -71,14 +72,16 @@ class HaMoreInfoViewToggleGroup extends LitElement { const isGroup = this.params.entityIds.length > 1; - const isAllOn = entities.every((entity) => - entity.state === UNAVAILABLE || + const availableEntities = entities.filter( + (entity) => entity.state !== UNAVAILABLE + ); + + const isAllOn = availableEntities.every((entity) => computeDomain(entity.entity_id) === "cover" ? isFullyOpen(entity) : entity.state === "on" ); - const isAllOff = entities.every((entity) => - entity.state === UNAVAILABLE || + const isAllOff = availableEntities.every((entity) => computeDomain(entity.entity_id) === "cover" ? isFullyClosed(entity) : entity.state === "off"