Skip to content

Commit 1392747

Browse files
committed
Add UI editor for (lists of) nested dicts in addon configs
1 parent 92456c0 commit 1392747

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

hassio/src/addon-view/config/hassio-addon-config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { haStyle } from "../../../../src/resources/styles";
3333
import type { HomeAssistant } from "../../../../src/types";
3434
import { suggestAddonRestart } from "../../dialogs/suggestAddonRestart";
3535
import { hassioStyle } from "../../resources/hassio-style";
36+
import type { ObjectSelector } from "../../../../src/data/selector";
3637

3738
const SUPPORTED_UI_TYPES = [
3839
"string",
@@ -138,7 +139,19 @@ class HassioAddonConfig extends LitElement {
138139
return { boolean: {} };
139140
}
140141
if (entry.type === "schema") {
141-
return { object: {} };
142+
const fields: NonNullable<ObjectSelector["object"]>["fields"] = {};
143+
for (const child_entry of entry.schema) {
144+
fields[child_entry.name] = {
145+
required: child_entry.required,
146+
selector: this._convertSchemaElementToSelector(child_entry, true)!,
147+
};
148+
}
149+
return {
150+
object: {
151+
multiple: entry.multiple,
152+
fields,
153+
},
154+
};
142155
}
143156
if (entry.type === "float" || entry.type === "integer") {
144157
return {

0 commit comments

Comments
 (0)