Optional boolean service field defaults to false (#19043)

This commit is contained in:
karwosts 2023-12-18 03:56:01 -08:00 committed by GitHub
parent 62d8cdfcf9
commit e813108c66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -522,6 +522,14 @@ export class HaServiceControl extends LitElement {
defaultValue = field.selector.constant?.value;
}
if (
defaultValue == null &&
field?.selector &&
"boolean" in field.selector
) {
defaultValue = false;
}
if (defaultValue != null) {
data = {
...this._value?.data,