Skip to content

Commit

Permalink
fix expose view for yaml config (#16408)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored May 4, 2023
1 parent ed19cfe commit 060f6ce
Showing 1 changed file with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export class VoiceAssistantsExpose extends LitElement {
filteredAssistants.some(
(assis) =>
!(assis === "cloud.alexa" && alexaManual) &&
!(assis === "cloud.google_assistant" && googleManual) &&
exposedEntities?.[entity.entity_id]?.[assis]
)
);
Expand Down Expand Up @@ -377,20 +378,10 @@ export class VoiceAssistantsExpose extends LitElement {
);
Object.keys(this.hass.states).forEach((entityId) => {
const assistants: string[] = [];
if (
alexaManual &&
(!filteredAssistants ||
filteredAssistants.includes("cloud.alexa")) &&
manFilterFuncs.amazon(entityId)
) {
if (alexaManual && manFilterFuncs.amazon(entityId)) {
assistants.push("cloud.alexa");
}
if (
googleManual &&
(!filteredAssistants ||
filteredAssistants.includes("cloud.google_assistant")) &&
manFilterFuncs.google(entityId)
) {
if (googleManual && manFilterFuncs.google(entityId)) {
assistants.push("cloud.google_assistant");
}
if (!assistants.length) {
Expand All @@ -399,7 +390,10 @@ export class VoiceAssistantsExpose extends LitElement {
if (entityId in result) {
result[entityId].assistants.push(...assistants);
result[entityId].manAssistants = assistants;
} else {
} else if (
!filteredAssistants ||
filteredAssistants.some((ass) => assistants.includes(ass))
) {
const entityState = this.hass.states[entityId];
const entry: ExtEntityRegistryEntry | undefined =
entities[entityId];
Expand Down

0 comments on commit 060f6ce

Please sign in to comment.