2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

added sortDevices attribute

git-svn-id: https://svn.fhem.de/fhem/trunk@5053 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-02-26 15:43:44 +00:00
parent e29d8f1be3
commit a9404010f3
2 changed files with 10 additions and 1 deletions

View File

@ -1,6 +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.
- SVN
- feature: readingsGroup: added sortDevices attribute
- feature: ENIGMA2: new reading 'recordings', new command record
- change: ENIGMA2: rewrite for NonBlocking
- feature: SYSMOM: new Plot + Doc

View File

@ -40,7 +40,7 @@ sub readingsGroup_Initialize($)
#$hash->{SetFn} = "readingsGroup_Set";
$hash->{GetFn} = "readingsGroup_Get";
$hash->{AttrFn} = "readingsGroup_Attr";
$hash->{AttrList} = "disable:1,2,3 nameIcon valueIcon mapping separator style nameStyle valueColumns valueStyle valueFormat commands timestampStyle noheading:1 nolinks:1 notime:1 nostate:1 alwaysTrigger:1";
$hash->{AttrList} = "disable:1,2,3 nameIcon valueIcon mapping separator style nameStyle valueColumns valueStyle valueFormat commands timestampStyle noheading:1 nolinks:1 notime:1 nostate:1 alwaysTrigger:1 sortDevices:1";
$hash->{FW_detailFn} = "readingsGroup_detailFn";
$hash->{FW_summaryFn} = "readingsGroup_detailFn";
@ -129,6 +129,12 @@ readingsGroup_updateDevices($)
}
}
if( AttrVal( $hash->{NAME}, "sortDevices", 0 ) == 1 ) {
@devices = sort { my $aa = @{$a}[0]; my $bb = @{$b}[0];
lc(AttrVal($aa,"sortby",AttrVal($aa,"alias",$aa))) cmp
lc(AttrVal($bb,"sortby",AttrVal($bb,"alias",$bb))) } @devices;
}
$hash->{CONTENT} = \%list;
$hash->{DEVICES} = \@devices;
@ -974,6 +980,8 @@ readingsGroup_Attr($$$)
1 -> disable notify processing and longpoll updates. Notice: this also disables rename and delete handling.<br>
2 -> also disable html table creation<br>
3 -> also disable html creation completely</li>
<li>sortDevices<br>
1 -> sort the device lines alphabetically. use the first of sortby or alias or name that is defined for each device.</li>
<li>noheading<br>
If set to 1 the readings table will have no heading.</li>
<li>nolinks<br>