2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 10:46:03 +00:00

fhem.pl: finetuning of attr grouping (Forum #119289)

git-svn-id: https://svn.fhem.de/fhem/trunk@23903 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-03-07 09:02:55 +00:00
parent 5b854a4b9e
commit 6c2dd3050b
2 changed files with 17 additions and 5 deletions

View File

@ -1441,7 +1441,11 @@ FW_detailSelect(@)
{
my ($d, $cmd, $list, $param, $typeHash) = @_;
return "" if(!$list || $FW_hiddenroom{input});
my @al = map { s/:.*//; $_ } split(" ", $list);
my @al = sort {
my $ta = $typeHash->{$a} ? $typeHash->{$a}.$a : $a;
my $tb = $typeHash->{$b} ? $typeHash->{$b}.$b : $b;
$ta cmp $tb;
} map { s/:.*//; $_ } split(" ", $list);
my $selEl = (defined($al[0]) ? $al[0] : " ");
$selEl = $1 if($list =~ m/([^ ]*):slider,/); # promote a slider if available

View File

@ -281,8 +281,8 @@ $selectTimestamp = gettimeofday();
$cvsid = '$Id$';
my $AttrList = "alias comment:textField-long eventMap:textField-long ".
"group room suppressReading userReadings:textField-long ".
"verbose:0,1,2,3,4,5 userattr";
"group room suppressReading userattr ".
"userReadings:textField-long verbose:0,1,2,3,4,5 ";
my $currcfgfile=""; # current config/include file
my $currlogfile; # logfile, without wildcards
@ -388,6 +388,12 @@ my @attrList = qw(
timestamp-on-change-reading
);
$readingFnAttributes = join(" ", @attrList);
my %framework_attrList = map { $_ => 1 } @attrList;
map { $framework_attrList{$_} = 1 } (
"ignore",
"disable",
"disabledForIntervals"
);
my %ra = (
"suppressReading" => { s=>"\n" },
@ -2747,7 +2753,9 @@ getAllAttr($;$$)
return if(!defined($v));
$list .= " " if($list);
$list .= $v;
map { s/:.*//; $typeHash->{$_} = $type } split(" ",$v) if($typeHash);
map { s/:.*//;
$typeHash->{$_} = $framework_attrList{$_} ? "framework" : $type }
split(" ",$v) if($typeHash);
};
&$add($AttrList, "global");
@ -2764,7 +2772,7 @@ getAllAttr($;$$)
$v =~ s/\n/ /g;
&$add($v, $type);
};
$nl2space->($attr{global}{userattr}, "Global userattr");
$nl2space->($attr{global}{userattr}, "global userattr");
$nl2space->($attr{$d}{userattr}, "Device userattr") if($attr{$d});
return $list;
}