Skip to content

Commit

Permalink
Add edit button to areas in area dashboard + color add floor fab (#20339
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bramkragten authored Apr 2, 2024
1 parent 41fdf31 commit 5b86b12
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/panels/config/areas/ha-config-areas-dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,14 @@ export class HaConfigAreasDashboard extends SubscribeMixin(LitElement) {
? html`<ha-icon .icon=${area.icon}></ha-icon>`
: ""}
</div>
<h1 class="card-header">${area.name}</h1>
<div class="card-header">
${area.name}
<ha-icon-button
.area=${area}
.path=${mdiPencil}
@click=${this._openAreaDetails}
></ha-icon-button>
</div>
<div class="card-content">
<div>
${formatListWithAnds(
Expand Down Expand Up @@ -305,6 +312,16 @@ export class HaConfigAreasDashboard extends SubscribeMixin(LitElement) {
loadAreaRegistryDetailDialog();
}

private _openAreaDetails(ev) {
ev.preventDefault();
const area = ev.currentTarget.area;
showAreaRegistryDetailDialog(this, {
entry: area,
updateEntry: async (values) =>
updateAreaRegistryEntry(this.hass!, area.area_id, values),
});
}

private async _areaMoved(ev) {
const areasAndFloors = this._processAreas(
this.hass.areas,
Expand Down Expand Up @@ -469,8 +486,10 @@ export class HaConfigAreasDashboard extends SubscribeMixin(LitElement) {
min-height: 16px;
color: var(--secondary-text-color);
}
.floor {
--primary-color: var(--secondary-text-color);
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.warning {
color: var(--error-color);
Expand Down

0 comments on commit 5b86b12

Please sign in to comment.