mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Fix add-on configuration validation (#9424)
This commit is contained in:
parent
30d6c5eaf3
commit
915c46f144
@ -269,6 +269,9 @@ class HassioAddonConfig extends LitElement {
|
|||||||
|
|
||||||
private async _saveTapped(ev: CustomEvent): Promise<void> {
|
private async _saveTapped(ev: CustomEvent): Promise<void> {
|
||||||
const button = ev.currentTarget as any;
|
const button = ev.currentTarget as any;
|
||||||
|
const options: Record<string, unknown> = this._yamlMode
|
||||||
|
? this._editor?.value
|
||||||
|
: this._options;
|
||||||
const eventdata = {
|
const eventdata = {
|
||||||
success: true,
|
success: true,
|
||||||
response: undefined,
|
response: undefined,
|
||||||
@ -282,13 +285,13 @@ class HassioAddonConfig extends LitElement {
|
|||||||
const validation = await validateHassioAddonOption(
|
const validation = await validateHassioAddonOption(
|
||||||
this.hass,
|
this.hass,
|
||||||
this.addon.slug,
|
this.addon.slug,
|
||||||
this._editor?.value
|
options
|
||||||
);
|
);
|
||||||
if (!validation.valid) {
|
if (!validation.valid) {
|
||||||
throw Error(validation.message);
|
throw Error(validation.message);
|
||||||
}
|
}
|
||||||
await setHassioAddonOption(this.hass, this.addon.slug, {
|
await setHassioAddonOption(this.hass, this.addon.slug, {
|
||||||
options: this._yamlMode ? this._editor?.value : this._options,
|
options,
|
||||||
});
|
});
|
||||||
|
|
||||||
this._configHasChanged = false;
|
this._configHasChanged = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user