mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 18:56:39 +00:00
Prevent service call error if preset_mode is null (#13825)
This commit is contained in:
parent
8e4bebb694
commit
182b8f809c
@ -377,12 +377,14 @@ class MoreInfoClimate extends LitElement {
|
|||||||
|
|
||||||
private _handlePresetmodeChanged(ev) {
|
private _handlePresetmodeChanged(ev) {
|
||||||
const newVal = ev.target.value || null;
|
const newVal = ev.target.value || null;
|
||||||
this._callServiceHelper(
|
if (newVal) {
|
||||||
this.stateObj!.attributes.preset_mode,
|
this._callServiceHelper(
|
||||||
newVal,
|
this.stateObj!.attributes.preset_mode,
|
||||||
"set_preset_mode",
|
newVal,
|
||||||
{ preset_mode: newVal }
|
"set_preset_mode",
|
||||||
);
|
{ preset_mode: newVal }
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _callServiceHelper(
|
private async _callServiceHelper(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user