mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix inclusion dialog in ZwaveJS panel (#24234)
This commit is contained in:
parent
5dc5879773
commit
0abccb88d6
@ -76,6 +76,8 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
|
|||||||
@state()
|
@state()
|
||||||
private _statistics?: ZWaveJSControllerStatisticsUpdatedMessage;
|
private _statistics?: ZWaveJSControllerStatisticsUpdatedMessage;
|
||||||
|
|
||||||
|
private _dialogOpen = false;
|
||||||
|
|
||||||
protected async firstUpdated() {
|
protected async firstUpdated() {
|
||||||
if (this.hass) {
|
if (this.hass) {
|
||||||
await this._fetchData();
|
await this._fetchData();
|
||||||
@ -104,11 +106,17 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
|
|||||||
}
|
}
|
||||||
),
|
),
|
||||||
subscribeS2Inclusion(this.hass, this.configEntryId, (message) => {
|
subscribeS2Inclusion(this.hass, this.configEntryId, (message) => {
|
||||||
showZWaveJSAddNodeDialog(this, {
|
if (!this._dialogOpen) {
|
||||||
entry_id: this.configEntryId,
|
showZWaveJSAddNodeDialog(this, {
|
||||||
dsk: message.dsk,
|
entry_id: this.configEntryId,
|
||||||
onStop: () => setTimeout(() => this._fetchData(), 100),
|
dsk: message.dsk,
|
||||||
});
|
onStop: () => {
|
||||||
|
setTimeout(() => this._fetchData(), 100);
|
||||||
|
this._dialogOpen = false;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this._dialogOpen = true;
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -570,11 +578,17 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _addNodeClicked() {
|
private async _addNodeClicked() {
|
||||||
showZWaveJSAddNodeDialog(this, {
|
if (!this._dialogOpen) {
|
||||||
entry_id: this.configEntryId!,
|
showZWaveJSAddNodeDialog(this, {
|
||||||
// refresh the data after the dialog is closed. add a small delay for the inclusion state to update
|
entry_id: this.configEntryId!,
|
||||||
onStop: () => setTimeout(() => this._fetchData(), 100),
|
// refresh the data after the dialog is closed. add a small delay for the inclusion state to update
|
||||||
});
|
onStop: () => {
|
||||||
|
setTimeout(() => this._fetchData(), 100);
|
||||||
|
this._dialogOpen = false;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this._dialogOpen = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _removeNodeClicked() {
|
private async _removeNodeClicked() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user