Skip to content

Commit

Permalink
Added sorting of channels by name on reading new configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
ppieczul committed Jun 10, 2017
1 parent ee53f80 commit 814f433
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: Loxone Binding
Bundle-SymbolicName: org.openhab.binding.loxone;singleton:=true
Bundle-Vendor: openHAB
Bundle-Version: 2.1.0.10
Bundle-Version: 2.1.0.11
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: .
Import-Package:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>org.openhab.binding</groupId>
<artifactId>org.openhab.binding.loxone</artifactId>
<version>2.1.0-10</version>
<version>2.1.0-11</version>

<name>Loxone Binding</name>
<packaging>eclipse-plugin</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.nio.channels.Channels;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -256,6 +257,13 @@ public void onNewConfig(LxServer server) {
}
}

channels.sort(new Comparator<Channel>() {
@Override
public int compare(Channel c1, Channel c2) {
return c1.getLabel().compareTo(c2.getLabel());
}
});

builder.withChannels(channels);
updateThing(builder.build());
}
Expand Down

0 comments on commit 814f433

Please sign in to comment.