Fix stt/tts pickers (#16241)

This commit is contained in:
Bram Kragten 2023-04-20 11:03:47 +02:00 committed by GitHub
parent eeb84f65b9
commit 0d020e0300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -5,7 +5,6 @@ import {
LitElement, LitElement,
nothing, nothing,
PropertyValues, PropertyValues,
TemplateResult,
} from "lit"; } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import { fireEvent } from "../common/dom/fire_event"; import { fireEvent } from "../common/dom/fire_event";
@ -34,9 +33,12 @@ export class HaSTTPicker extends LitElement {
@property({ type: Boolean }) public required = false; @property({ type: Boolean }) public required = false;
@state() _engines: STTEngine[] = []; @state() _engines?: STTEngine[];
protected render(): TemplateResult { protected render() {
if (!this._engines) {
return nothing;
}
const value = const value =
this.value ?? this.value ??
(this.required (this.required

View File

@ -6,7 +6,6 @@ import {
LitElement, LitElement,
nothing, nothing,
PropertyValues, PropertyValues,
TemplateResult,
} from "lit"; } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import { fireEvent } from "../common/dom/fire_event"; import { fireEvent } from "../common/dom/fire_event";
@ -34,9 +33,12 @@ export class HaTTSPicker extends LitElement {
@property({ type: Boolean }) public required = false; @property({ type: Boolean }) public required = false;
@state() _engines: TTSEngine[] = []; @state() _engines?: TTSEngine[];
protected render(): TemplateResult { protected render() {
if (!this._engines) {
return nothing;
}
const value = const value =
this.value ?? this.value ??
(this.required (this.required