Bunch of fixes and cleanup (#11636)

This commit is contained in:
Bram Kragten
2022-02-10 15:24:47 +01:00
committed by GitHub
parent fd80408de2
commit 0eeed85193
27 changed files with 163 additions and 136 deletions

View File

@@ -78,6 +78,7 @@ export class HuiEntityEditor extends LitElement {
)}
</div>
<ha-entity-picker
class="add-entity"
.hass=${this.hass}
@value-changed=${this._addEntity}
></ha-entity-picker>
@@ -170,7 +171,7 @@ export class HuiEntityEditor extends LitElement {
const index = (ev.target as any).index;
const newConfigEntities = this.entities!.concat();
if (value === "") {
if (value === "" || value === undefined) {
newConfigEntities.splice(index, 1);
} else {
newConfigEntities[index] = {
@@ -186,6 +187,13 @@ export class HuiEntityEditor extends LitElement {
return [
sortableStyles,
css`
ha-entity-picker {
margin-top: 8px;
}
.add-entity {
display: block;
margin-left: 31px;
}
.entity {
display: flex;
align-items: center;