Z-Wave JS: Sort security classes from highest to lowest (#20851)

This commit is contained in:
AlCalzone 2024-05-22 14:18:09 +02:00 committed by GitHub
parent 9fe8f507ec
commit 0b6994d402
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -237,8 +237,12 @@ class DialogZWaveJSAddNode extends LitElement {
: ""}
<div class="flex-column">
${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`<ha-formfield