diff --git a/src/panels/config/voice-assistants/assist-pipeline-detail/assist-pipeline-detail-wakeword.ts b/src/panels/config/voice-assistants/assist-pipeline-detail/assist-pipeline-detail-wakeword.ts index dfa6f0fd3922..316d21b51607 100644 --- a/src/panels/config/voice-assistants/assist-pipeline-detail/assist-pipeline-detail-wakeword.ts +++ b/src/panels/config/voice-assistants/assist-pipeline-detail/assist-pipeline-detail-wakeword.ts @@ -1,4 +1,11 @@ -import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; +import { + css, + CSSResultGroup, + html, + LitElement, + nothing, + PropertyValues, +} from "lit"; import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { LocalizeKeys } from "../../../../common/translations/localize"; @@ -6,6 +13,7 @@ import "../../../../components/ha-form/ha-form"; import { AssistPipeline } from "../../../../data/assist_pipeline"; import { HomeAssistant } from "../../../../types"; import { fetchWakeWordInfo, WakeWord } from "../../../../data/wake_word"; +import { documentationUrl } from "../../../../util/documentation-url"; @customElement("assist-pipeline-detail-wakeword") export class AssistPipelineDetailWakeWord extends LitElement { @@ -67,7 +75,12 @@ export class AssistPipelineDetailWakeWord extends LitElement { } } + private _hasWakeWorkEntities = memoizeOne((states: HomeAssistant["states"]) => + Object.keys(states).some((entityId) => entityId.startsWith("wake_word.")) + ); + protected render() { + const hasWakeWorkEntities = this._hasWakeWorkEntities(this.hass.states); return html`