ZWaveJS: abort S2 bootstrapping when inclusion is canceled (#23106)

This commit is contained in:
Petar Petrov 2024-12-03 14:56:17 +02:00 committed by GitHub
parent 19f54b6ba2
commit 7c486ec969
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 0 deletions

View File

@ -962,3 +962,12 @@ export const fetchZwaveIntegrationSettings = (
hass.callWS({
type: "zwave_js/get_integration_settings",
});
export const cancelSecureBootstrapS2 = (
hass: HomeAssistant,
entry_id: string
): Promise<void> =>
hass.callWS({
type: "zwave_js/cancel_secure_bootstrap_s2",
entry_id,
});

View File

@ -22,6 +22,7 @@ import type {
RequestedGrant,
} from "../../../../../data/zwave_js";
import {
cancelSecureBootstrapS2,
InclusionStrategy,
MINIMUM_QR_STRING_LENGTH,
provisionZwaveSmartStartNode,
@ -868,6 +869,16 @@ class DialogZWaveJSAddNode extends LitElement {
}
if (this._entryId) {
stopZwaveInclusion(this.hass, this._entryId);
if (
this._status &&
[
"waiting_for_device",
"validate_dsk_enter_pin",
"grant_security_classes",
].includes(this._status)
) {
cancelSecureBootstrapS2(this.hass, this._entryId);
}
if (this._params?.onStop) {
this._params.onStop();
}