Add picture uploader to area (#10544)

This commit is contained in:
Bram Kragten
2021-11-10 21:42:43 +01:00
committed by GitHub
parent 6623e5f017
commit 4cb45d6313
9 changed files with 254 additions and 104 deletions

View File

@@ -340,7 +340,7 @@ export class HaAreaPicker extends SubscribeMixin(LitElement) {
item-value-path="area_id"
item-id-path="area_id"
item-label-path="name"
.value=${this._value}
.value=${this.value}
.disabled=${this.disabled}
${comboBoxRenderer(rowRenderer)}
@opened-changed=${this._openedChanged}
@@ -431,12 +431,24 @@ export class HaAreaPicker extends SubscribeMixin(LitElement) {
name,
});
this._areas = [...this._areas!, area];
(this.comboBox as any).items = this._getAreas(
this._areas!,
this._devices!,
this._entities!,
this.includeDomains,
this.excludeDomains,
this.includeDeviceClasses,
this.deviceFilter,
this.entityFilter,
this.noAdd
);
this._setValue(area.area_id);
} catch (err: any) {
showAlertDialog(this, {
text: this.hass.localize(
title: this.hass.localize(
"ui.components.area-picker.add_dialog.failed_create_area"
),
text: err.message,
});
}
},