Voice assistants config: Filter unavailable assists (#23637)

Filter unavailable assists from num of assist devices.
This commit is contained in:
Wendelin 2025-01-08 16:22:43 +01:00 committed by Bram Kragten
parent 12b2edaa65
commit 9acdd9f903

View File

@ -84,7 +84,9 @@ export class AssistPref extends LitElement {
this._preferred = pipelines.preferred_pipeline;
});
this._pipelineEntitiesCount = Object.values(this.hass.entities).filter(
(entity) => computeDomain(entity.entity_id) === "assist_satellite"
(entity) =>
computeDomain(entity.entity_id) === "assist_satellite" &&
this.hass.states[entity.entity_id].state !== "unavailable"
).length;
}