Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions src/panels/config/zha/zha-device-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,6 @@ export class ZHADevicePage extends LitElement {
@property() private _bindableDevices: ZHADevice[] = [];
@property() private _groups: ZHAGroup[] = [];

private _firstUpdatedCalled: boolean = false;

public connectedCallback(): void {
super.connectedCallback();
if (this.hass && this._firstUpdatedCalled) {
this._fetchGroups();
}
}

protected firstUpdated(changedProperties: PropertyValues): void {
super.firstUpdated(changedProperties);
if (this.hass) {
this._fetchGroups();
}
this._firstUpdatedCalled = true;
}

protected updated(changedProperties: PropertyValues): void {
if (changedProperties.has("ieee")) {
this._fetchData();
Expand Down Expand Up @@ -148,16 +131,10 @@ export class ZHADevicePage extends LitElement {
sortZHADevices
)
: [];
this._groups = (await fetchGroups(this.hass!)).sort(sortZHAGroups);
}
}

private async _fetchGroups() {
this._groups =
this.device && this.device.device_type !== "Coordinator"
? (await fetchGroups(this.hass!)).sort(sortZHAGroups)
: [];
}

static get styles(): CSSResult[] {
return [
haStyle,
Expand Down