mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 13:07:49 +00:00
Add suggested name
This commit is contained in:
parent
31c6247a86
commit
960e0dd9e0
@ -34,8 +34,13 @@ class DialogCategoryDetail extends LitElement {
|
|||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
this._params = params;
|
this._params = params;
|
||||||
this._error = undefined;
|
this._error = undefined;
|
||||||
this._name = this._params.entry ? this._params.entry.name : "";
|
if (this._params.entry) {
|
||||||
this._icon = this._params.entry?.icon || null;
|
this._name = this._params.entry.name || "";
|
||||||
|
this._icon = this._params.entry.icon || null;
|
||||||
|
} else {
|
||||||
|
this._name = this._params.suggestedName || "";
|
||||||
|
this._icon = null;
|
||||||
|
}
|
||||||
await this.updateComplete;
|
await this.updateComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,6 +237,7 @@ export class HaCategoryPicker extends SubscribeMixin(LitElement) {
|
|||||||
|
|
||||||
showCategoryRegistryDetailDialog(this, {
|
showCategoryRegistryDetailDialog(this, {
|
||||||
scope: this.scope!,
|
scope: this.scope!,
|
||||||
|
suggestedName: newValue === ADD_NEW_SUGGESTION_ID ? this._suggestion : "",
|
||||||
createEntry: async (values) => {
|
createEntry: async (values) => {
|
||||||
const category = await createCategoryRegistryEntry(
|
const category = await createCategoryRegistryEntry(
|
||||||
this.hass,
|
this.hass,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user