diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts index 5ccfa2e3b603..61ebc154a396 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-add-node.ts @@ -237,8 +237,12 @@ class DialogZWaveJSAddNode extends LitElement { : ""}
${this._requestedGrant?.securityClasses - .sort() - .reverse() + .sort((a, b) => { + // Put highest security classes at the top, S0 at the bottom + if (a === SecurityClass.S0_Legacy) return 1; + if (b === SecurityClass.S0_Legacy) return -1; + return b - a; + }) .map( (securityClass) => html`