mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 18:56:39 +00:00
Dont show voice wizard for voip (#24050)
dont show voice wizard for voip
This commit is contained in:
parent
02ae0b5864
commit
6c2cf1ff60
@ -65,7 +65,8 @@ class StepFlowCreateEntry extends LitElement {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
devices.length !== 1 ||
|
devices.length !== 1 ||
|
||||||
devices[0].primary_config_entry !== this.step.result?.entry_id
|
devices[0].primary_config_entry !== this.step.result?.entry_id ||
|
||||||
|
this.step.result.domain === "voip"
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,8 @@ export class HaVoiceAssistantSetupDialog extends LitElement {
|
|||||||
|
|
||||||
@state() private _assistConfiguration?: AssistSatelliteConfiguration;
|
@state() private _assistConfiguration?: AssistSatelliteConfiguration;
|
||||||
|
|
||||||
|
@state() private _error?: string;
|
||||||
|
|
||||||
private _previousSteps: STEP[] = [];
|
private _previousSteps: STEP[] = [];
|
||||||
|
|
||||||
private _nextStep?: STEP;
|
private _nextStep?: STEP;
|
||||||
@ -165,10 +167,14 @@ export class HaVoiceAssistantSetupDialog extends LitElement {
|
|||||||
"update"
|
"update"
|
||||||
)}
|
)}
|
||||||
></ha-voice-assistant-setup-step-update>`
|
></ha-voice-assistant-setup-step-update>`
|
||||||
|
: this._error
|
||||||
|
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
||||||
: assistEntityState?.state === UNAVAILABLE
|
: assistEntityState?.state === UNAVAILABLE
|
||||||
? this.hass.localize(
|
? html`<ha-alert alert-type="error"
|
||||||
|
>${this.hass.localize(
|
||||||
"ui.panel.config.voice_assistants.satellite_wizard.not_available"
|
"ui.panel.config.voice_assistants.satellite_wizard.not_available"
|
||||||
)
|
)}</ha-alert
|
||||||
|
>`
|
||||||
: this._step === STEP.CHECK
|
: this._step === STEP.CHECK
|
||||||
? html`<ha-voice-assistant-setup-step-check
|
? html`<ha-voice-assistant-setup-step-check
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
@ -229,6 +235,7 @@ export class HaVoiceAssistantSetupDialog extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _fetchAssistConfiguration() {
|
private async _fetchAssistConfiguration() {
|
||||||
|
try {
|
||||||
this._assistConfiguration = await fetchAssistSatelliteConfiguration(
|
this._assistConfiguration = await fetchAssistSatelliteConfiguration(
|
||||||
this.hass,
|
this.hass,
|
||||||
this._findDomainEntityId(
|
this._findDomainEntityId(
|
||||||
@ -237,7 +244,9 @@ export class HaVoiceAssistantSetupDialog extends LitElement {
|
|||||||
"assist_satellite"
|
"assist_satellite"
|
||||||
)!
|
)!
|
||||||
);
|
);
|
||||||
return this._assistConfiguration;
|
} catch (err: any) {
|
||||||
|
this._error = err.message;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _goToPreviousStep() {
|
private _goToPreviousStep() {
|
||||||
@ -293,6 +302,10 @@ export class HaVoiceAssistantSetupDialog extends LitElement {
|
|||||||
.skip-btn {
|
.skip-btn {
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
}
|
}
|
||||||
|
ha-alert {
|
||||||
|
margin: 24px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,15 @@ export class HaVoiceAssistantSetupStepWakeWord extends LitElement {
|
|||||||
protected override willUpdate(changedProperties: PropertyValues) {
|
protected override willUpdate(changedProperties: PropertyValues) {
|
||||||
super.willUpdate(changedProperties);
|
super.willUpdate(changedProperties);
|
||||||
|
|
||||||
|
if (changedProperties.has("assistConfiguration")) {
|
||||||
|
if (
|
||||||
|
this.assistConfiguration &&
|
||||||
|
!this.assistConfiguration.available_wake_words.length
|
||||||
|
) {
|
||||||
|
this._nextStep();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (changedProperties.has("assistEntityId")) {
|
if (changedProperties.has("assistEntityId")) {
|
||||||
this._detected = false;
|
this._detected = false;
|
||||||
this._muteSwitchEntity = this.deviceEntities?.find(
|
this._muteSwitchEntity = this.deviceEntities?.find(
|
||||||
@ -135,13 +144,16 @@ export class HaVoiceAssistantSetupStepWakeWord extends LitElement {
|
|||||||
>`
|
>`
|
||||||
: nothing}
|
: nothing}
|
||||||
</div>
|
</div>
|
||||||
<div class="footer centered">
|
${this.assistConfiguration &&
|
||||||
|
this.assistConfiguration.available_wake_words.length > 1
|
||||||
|
? html`<div class="footer centered">
|
||||||
<ha-button @click=${this._changeWakeWord}
|
<ha-button @click=${this._changeWakeWord}
|
||||||
>${this.hass.localize(
|
>${this.hass.localize(
|
||||||
"ui.panel.config.voice_assistants.satellite_wizard.wake_word.change_wake_word"
|
"ui.panel.config.voice_assistants.satellite_wizard.wake_word.change_wake_word"
|
||||||
)}</ha-button
|
)}</ha-button
|
||||||
>
|
>
|
||||||
</div>`;
|
</div>`
|
||||||
|
: nothing}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _listenWakeWord() {
|
private async _listenWakeWord() {
|
||||||
|
@ -1073,7 +1073,14 @@ export class HaConfigDevicePage extends LitElement {
|
|||||||
(ent) => computeDomain(ent.entity_id) === "assist_satellite"
|
(ent) => computeDomain(ent.entity_id) === "assist_satellite"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const domains = this._integrations(
|
||||||
|
device,
|
||||||
|
this.entries,
|
||||||
|
this.manifests
|
||||||
|
).map((int) => int.domain);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
!domains.includes("voip") &&
|
||||||
assistSatellite &&
|
assistSatellite &&
|
||||||
assistSatelliteSupportsSetupFlow(
|
assistSatelliteSupportsSetupFlow(
|
||||||
this.hass.states[assistSatellite.entity_id]
|
this.hass.states[assistSatellite.entity_id]
|
||||||
@ -1088,12 +1095,6 @@ export class HaConfigDevicePage extends LitElement {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const domains = this._integrations(
|
|
||||||
device,
|
|
||||||
this.entries,
|
|
||||||
this.manifests
|
|
||||||
).map((int) => int.domain);
|
|
||||||
|
|
||||||
if (domains.includes("mqtt")) {
|
if (domains.includes("mqtt")) {
|
||||||
const mqtt = await import(
|
const mqtt = await import(
|
||||||
"./device-detail/integration-elements/mqtt/device-actions"
|
"./device-detail/integration-elements/mqtt/device-actions"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user