@@ -22,6 +22,7 @@ import "./voice-assistant-setup-step-pipeline";
22
22
import "./voice-assistant-setup-step-success" ;
23
23
import "./voice-assistant-setup-step-update" ;
24
24
import "./voice-assistant-setup-step-wake-word" ;
25
+ import "./voice-assistant-setup-step-local" ;
25
26
26
27
export const enum STEP {
27
28
INIT ,
@@ -32,6 +33,7 @@ export const enum STEP {
32
33
PIPELINE ,
33
34
SUCCESS ,
34
35
CLOUD ,
36
+ LOCAL ,
35
37
CHANGE_WAKEWORD ,
36
38
}
37
39
@@ -118,22 +120,24 @@ export class HaVoiceAssistantSetupDialog extends LitElement {
118
120
scrimClickAction
119
121
>
120
122
<ha- dialog- header slot= "heading" >
121
- ${ this . _previousSteps . length
122
- ? html `<ha- icon- butto n
123
- slot= "navigationIcon"
124
- .label = ${ this . hass . localize ( "ui.common.back" ) ?? "Back" }
125
- .path = ${ mdiChevronLeft }
126
- @click = ${ this . _goToPreviousStep }
127
- > </ ha- icon- butto n> `
128
- : this . _step !== STEP . UPDATE
123
+ ${ this . _step === STEP . LOCAL
124
+ ? nothing
125
+ : this . _previousSteps . length
129
126
? html `<ha- icon- butto n
130
127
slot= "navigationIcon"
131
- .label = ${ this . hass . localize ( "ui.dialogs.generic.close" ) ??
132
- "Close" }
133
- .path = ${ mdiClose }
134
- @click = ${ this . closeDialog }
128
+ .label = ${ this . hass . localize ( "ui.common.back" ) ?? "Back" }
129
+ .path = ${ mdiChevronLeft }
130
+ @click = ${ this . _goToPreviousStep }
135
131
> </ ha- icon- butto n> `
136
- : nothing }
132
+ : this . _step !== STEP . UPDATE
133
+ ? html `<ha- icon- butto n
134
+ slot= "navigationIcon"
135
+ .label = ${ this . hass . localize ( "ui.dialogs.generic.close" ) ??
136
+ "Close" }
137
+ .path = ${ mdiClose }
138
+ @click = ${ this . closeDialog }
139
+ > </ ha- icon- butto n> `
140
+ : nothing }
137
141
${ this . _step === STEP . WAKEWORD ||
138
142
this . _step === STEP . AREA ||
139
143
this . _step === STEP . PIPELINE
@@ -145,7 +149,11 @@ export class HaVoiceAssistantSetupDialog extends LitElement {
145
149
> `
146
150
: nothing }
147
151
</ ha- dialog- header>
148
- <div class= "content" @next-step = ${ this . _goToNextStep } >
152
+ <div
153
+ class= "content"
154
+ @next-step = ${ this . _goToNextStep }
155
+ @prev-step = ${ this . _goToPreviousStep }
156
+ >
149
157
${ this . _step === STEP . UPDATE
150
158
? html `<ha- voice- assis tant- setup- step- update
151
159
.hass = ${ this . hass }
@@ -197,14 +205,20 @@ export class HaVoiceAssistantSetupDialog extends LitElement {
197
205
? html `<ha- voice- assis tant- setup- step- cloud
198
206
.hass = ${ this . hass }
199
207
> </ ha- voice- assis tant- setup- step- cloud> `
200
- : this . _step === STEP . SUCCESS
201
- ? html `<ha- voice- assis tant- setup- step- success
208
+ : this . _step === STEP . LOCAL
209
+ ? html `<ha- voice- assis tant- setup- step- local
202
210
.hass = ${ this . hass }
203
211
.assistConfiguration = ${ this
204
212
. _assistConfiguration }
205
- .assistEntityId = ${ assistSatelliteEntityId }
206
- > </ ha- voice- assis tant- setup- step- success> `
207
- : nothing }
213
+ > </ ha- voice- assis tant- setup- step- local> `
214
+ : this . _step === STEP . SUCCESS
215
+ ? html `<ha- voice- assis tant- setup- step- success
216
+ .hass = ${ this . hass }
217
+ .assistConfiguration = ${ this
218
+ . _assistConfiguration }
219
+ .assistEntityId = ${ assistSatelliteEntityId }
220
+ > </ ha- voice- assis tant- setup- step- success> `
221
+ : nothing }
208
222
</ div>
209
223
</ ha- dialog>
210
224
` ;
@@ -229,17 +243,17 @@ export class HaVoiceAssistantSetupDialog extends LitElement {
229
243
this . _step = this . _previousSteps . pop ( ) ! ;
230
244
}
231
245
232
- private _goToNextStep ( ev ) {
233
- if ( ev . detail ?. updateConfig ) {
246
+ private _goToNextStep ( ev ?: CustomEvent ) {
247
+ if ( ev ? .detail ?. updateConfig ) {
234
248
this . _fetchAssistConfiguration ( ) ;
235
249
}
236
- if ( ev . detail ?. nextStep ) {
250
+ if ( ev ? .detail ?. nextStep ) {
237
251
this . _nextStep = ev . detail . nextStep ;
238
252
}
239
- if ( ! ev . detail ?. noPrevious ) {
253
+ if ( ! ev ? .detail ?. noPrevious ) {
240
254
this . _previousSteps . push ( this . _step ) ;
241
255
}
242
- if ( ev . detail ?. step ) {
256
+ if ( ev ? .detail ?. step ) {
243
257
this . _step = ev . detail . step ;
244
258
} else if ( this . _nextStep ) {
245
259
this . _step = this . _nextStep ;
@@ -294,5 +308,6 @@ declare global {
294
308
nextStep ?: STEP ;
295
309
}
296
310
| undefined ;
311
+ "prev-step" : undefined ;
297
312
}
298
313
}
0 commit comments