Fix refresh in developer state tools (#18532)

This commit is contained in:
Simon Lamon 2023-11-06 15:53:23 +01:00 committed by GitHub
parent 3d03f74d66
commit a7f6ce3079
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 = "";