Fix refresh in developer state tools (#18532)

This commit is contained in:
Simon Lamon 2023-11-06 15:53:23 +01:00 committed by Bram Kragten
parent 6728e8d107
commit 06d76be2c2

View File

@ -167,7 +167,7 @@ class HaPanelDevState extends LitElement {
)}</mwc-button
>
<ha-icon-button
@click=${this._entityIdChanged}
@click=${this._updateEntity}
.label=${this.hass.localize("ui.common.refresh")}
.path=${mdiRefresh}
></ha-icon-button>
@ -349,6 +349,10 @@ class HaPanelDevState extends LitElement {
private _entityIdChanged(ev: CustomEvent) {
this._entityId = ev.detail.value;
this._updateEntity();
}
private _updateEntity() {
if (!this._entityId) {
this._entity = undefined;
this._state = "";