mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Fix available entities and header
This commit is contained in:
parent
1471cfea66
commit
6d7df18e82
@ -16,6 +16,7 @@ import type { LovelaceSectionConfig } from "../../../../data/lovelace/config/sec
|
|||||||
import type { TileCardConfig } from "../../../../panels/lovelace/cards/types";
|
import type { TileCardConfig } from "../../../../panels/lovelace/cards/types";
|
||||||
import "../../../../panels/lovelace/sections/hui-section";
|
import "../../../../panels/lovelace/sections/hui-section";
|
||||||
import type { HomeAssistant } from "../../../../types";
|
import type { HomeAssistant } from "../../../../types";
|
||||||
|
import "../ha-more-info-state-header";
|
||||||
|
|
||||||
export interface GroupToggleDialogParams {
|
export interface GroupToggleDialogParams {
|
||||||
entityIds: string[];
|
entityIds: string[];
|
||||||
@ -71,14 +72,16 @@ class HaMoreInfoViewToggleGroup extends LitElement {
|
|||||||
|
|
||||||
const isGroup = this.params.entityIds.length > 1;
|
const isGroup = this.params.entityIds.length > 1;
|
||||||
|
|
||||||
const isAllOn = entities.every((entity) =>
|
const availableEntities = entities.filter(
|
||||||
entity.state === UNAVAILABLE ||
|
(entity) => entity.state !== UNAVAILABLE
|
||||||
|
);
|
||||||
|
|
||||||
|
const isAllOn = availableEntities.every((entity) =>
|
||||||
computeDomain(entity.entity_id) === "cover"
|
computeDomain(entity.entity_id) === "cover"
|
||||||
? isFullyOpen(entity)
|
? isFullyOpen(entity)
|
||||||
: entity.state === "on"
|
: entity.state === "on"
|
||||||
);
|
);
|
||||||
const isAllOff = entities.every((entity) =>
|
const isAllOff = availableEntities.every((entity) =>
|
||||||
entity.state === UNAVAILABLE ||
|
|
||||||
computeDomain(entity.entity_id) === "cover"
|
computeDomain(entity.entity_id) === "cover"
|
||||||
? isFullyClosed(entity)
|
? isFullyClosed(entity)
|
||||||
: entity.state === "off"
|
: entity.state === "off"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user