]> git.basschouten.com Git - openhab-addons.git/commitdiff
Fix indexing of presets and playlists. (#13543)
authorMatthew Skinner <matt@pcmus.com>
Sat, 15 Oct 2022 08:07:49 +0000 (19:07 +1100)
committerGitHub <noreply@github.com>
Sat, 15 Oct 2022 08:07:49 +0000 (10:07 +0200)
Signed-off-by: Matthew Skinner <matt@pcmus.com>
bundles/org.openhab.binding.wled/src/main/java/org/openhab/binding/wled/internal/api/WledApiV0110.java

index bfa43cb080c8a40a7efc8afb386a86ebc228ca99..297d9a718f4a543bc366ef610fc33294566e50d9 100644 (file)
@@ -63,9 +63,9 @@ public class WledApiV0110 extends WledApiV084 {
             PresetState preset = gson.fromJson(presetEntry.getValue(), PresetState.class);
             if (preset != null && counter > 0) {
                 if (preset.bri == 0) {
-                    playlistsOptions.add(new StateOption(Integer.toString(counter), preset.n));
+                    playlistsOptions.add(new StateOption(presetEntry.getKey(), preset.n));
                 } else {
-                    presetsOptions.add(new StateOption(Integer.toString(counter), preset.n));
+                    presetsOptions.add(new StateOption(presetEntry.getKey(), preset.n));
                 }
             }
             counter++;