diff --git a/fhem/CHANGED b/fhem/CHANGED index f61fdc891..a1551c836 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 95_Dashboard: the sort order in columns is now correctly read + from the sorting attribute. - bugfix: 00_MAXLAN: set time on cube if it has none (by Tom_S) - bugfix: 14_CUL_MAX: work together with a-culfw - bugfix: 70_PushNotifier: bugfix regex deviceID diff --git a/fhem/FHEM/95_Dashboard.pm b/fhem/FHEM/95_Dashboard.pm index 6077ae50e..f1855f8c5 100644 --- a/fhem/FHEM/95_Dashboard.pm +++ b/fhem/FHEM/95_Dashboard.pm @@ -697,20 +697,34 @@ sub BuildGroupWidgets($$$$$) { my $counter = 0; my %sorting = (); + my %groups = (); + my @groupnames = (); foreach (split(":", $groupsorting)) { my @parts = split (',', $_); $sorting{$parts[1]} = $_; + # add group names to a list to have the correct order afterwards in the foreach loop + # store the group names in the right order to use them in the foreach loop + push(@groupnames, $parts[1]); } - my $groupicon = ''; my @devicegroups = split('ยงยงยง', $devicegroups); + # sort the devices into a hash to be able to access them via group name foreach my $singlegroup (@devicegroups) { # make sure that splitting with colon is not destroying the devspec that might # also contain a colon followed by a filter my ($groupname, $groupdevices, $groupicon) = split(/:(?!FILTER=)/, $singlegroup); + my @values = ($groupdevices, $groupicon); + $groups{$groupname} = \@values; + } + + my $groupicon = ''; + + foreach my $groupname (@groupnames) { + my ($groupdevices, $groupicon) = @{$groups{$groupname}}; + # if the device is not stored in the current column, skip it next if (index($sorting{$groupname}, 't'.$tab.'c'.$column) < 0);