mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 10:46:35 +00:00
Fix ZHA visualization page (#13584)
This commit is contained in:
parent
81cc745c0a
commit
f032d0dbcf
@ -60,7 +60,7 @@ class ZHAConfigDashboardRouter extends HassRouterPage {
|
|||||||
} else if (this._currentPage === "device") {
|
} else if (this._currentPage === "device") {
|
||||||
el.ieee = this.routeTail.path.substr(1);
|
el.ieee = this.routeTail.path.substr(1);
|
||||||
} else if (this._currentPage === "visualization") {
|
} else if (this._currentPage === "visualization") {
|
||||||
el.zoomedDeviceId = this.routeTail.path.substr(1);
|
el.zoomedDeviceIdFromURL = this.routeTail.path.substr(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchParams = new URLSearchParams(window.location.search);
|
const searchParams = new URLSearchParams(window.location.search);
|
||||||
|
@ -37,7 +37,10 @@ export class ZHANetworkVisualizationPage extends LitElement {
|
|||||||
@property({ type: Boolean }) public isWide!: boolean;
|
@property({ type: Boolean }) public isWide!: boolean;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
public zoomedDeviceId?: string;
|
public zoomedDeviceIdFromURL?: string;
|
||||||
|
|
||||||
|
@state()
|
||||||
|
private zoomedDeviceId?: string;
|
||||||
|
|
||||||
@query("#visualization", true)
|
@query("#visualization", true)
|
||||||
private _visualization?: HTMLElement;
|
private _visualization?: HTMLElement;
|
||||||
@ -64,6 +67,11 @@ export class ZHANetworkVisualizationPage extends LitElement {
|
|||||||
protected firstUpdated(changedProperties: PropertyValues): void {
|
protected firstUpdated(changedProperties: PropertyValues): void {
|
||||||
super.firstUpdated(changedProperties);
|
super.firstUpdated(changedProperties);
|
||||||
|
|
||||||
|
// prevent zoomedDeviceIdFromURL from being restored to zoomedDeviceId after the user clears it
|
||||||
|
if (this.zoomedDeviceIdFromURL) {
|
||||||
|
this.zoomedDeviceId = this.zoomedDeviceIdFromURL;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.hass) {
|
if (this.hass) {
|
||||||
this._fetchData();
|
this._fetchData();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user