Use more text selector types for add-on configuration (#12303)

This commit is contained in:
Joakim Sørensen 2022-04-11 16:01:30 +02:00 committed by GitHub
parent d900e40d04
commit 714f2447b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,6 +55,8 @@ const ADDON_YAML_SCHEMA = DEFAULT_SCHEMA.extend([
}), }),
]); ]);
const MASKED_FIELDS = ["password", "secret", "token"];
@customElement("hassio-addon-config") @customElement("hassio-addon-config")
class HassioAddonConfig extends LitElement { class HassioAddonConfig extends LitElement {
@property({ attribute: false }) public addon!: HassioAddonDetails; @property({ attribute: false }) public addon!: HassioAddonDetails;
@ -113,7 +115,14 @@ class HassioAddonConfig extends LitElement {
: { : {
name: entry.name, name: entry.name,
required: entry.required, required: entry.required,
selector: { text: { type: "text" } }, selector: {
text: {
type:
entry.format || MASKED_FIELDS.includes(entry.name)
? "password"
: "text",
},
},
} }
: entry.type === "boolean" : entry.type === "boolean"
? { ? {