mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 13:37:47 +00:00
fix area index on ZHA device card (#4406)
This commit is contained in:
parent
2988cc512f
commit
1b0d8bba29
@ -81,6 +81,12 @@ class ZHADeviceCard extends LitElement {
|
||||
super.connectedCallback();
|
||||
this._unsubAreas = subscribeAreaRegistry(this.hass.connection, (areas) => {
|
||||
this._areas = areas;
|
||||
if (this.device) {
|
||||
this._selectedAreaIndex =
|
||||
this._areas.findIndex(
|
||||
(area) => area.area_id === this.device!.area_id
|
||||
) + 1; // account for the no area selected index
|
||||
}
|
||||
});
|
||||
this.hass.connection
|
||||
.subscribeEvents((event: HassEvent) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user