Skip to content

Commit

Permalink
Z-Wave JS: Sort security classes from highest to lowest (#20851)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored May 22, 2024
1 parent 9fe8f50 commit 0b6994d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0b6994d

Please sign in to comment.