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 GitHub
parent f75f4b9733
commit c6aec2db7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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