";
foreach my $device (@{$devices}) {
my $h = $defs{$device->[0]};
my $regex = $device->[1];
my $name = $h->{NAME};
next if( !$h );
my @list = (undef);
@list = split(",",$regex) if( $regex );
my $first = 1;
my $multi = @list;
my $show_time = $show_time;
$show_time = 0 if( $regex && $regex =~ m/,/ );
foreach my $regex (@list) {
my $h = $h;
if( $regex && $regex =~ m/^\+(.*)/ ) {
$regex = $1;
$show_time = 0;
} elsif( $regex && $regex =~ m/^\?(.*)/ ) {
$regex = $1;
$show_time = 0;
$h = $attr{$name};
} else {
$h = $h->{READINGS};
}
foreach my $n (sort keys %{$h}) {
next if( $n =~ m/^\./);
next if( $n eq "state" && !$show_state && (!defined($regex) || $regex ne "state") );
next if( defined($regex) && $n !~ m/^$regex$/);
my $val = $h->{$n};
my ($v, $t);
if(ref($val)) {
next if( ref($val) ne "HASH" || !defined($val->{VAL}) );
($v, $t) = ($val->{VAL}, $val->{TIME});
$v = FW_htmlEscape($v);
$t = "" if(!$t);
} else {
$v = FW_htmlEscape($val);
}
my $name_style = lookup2($name_style,$name,$n,$v);
my $value_style = lookup2($value_style,$name,$n,$v);
my $value_format = lookup2($value_format,$name,$n,$v);
next if( !defined($value_format) );
$v = sprintf( $value_format, $v ) if( $value_format );
my $a = AttrVal($name, "alias", $name);
my $m = "$a$separator$n";
my $room = AttrVal($name, "room", "");
my $group = AttrVal($name, "group", "");
my $txt = lookup($mapping,$name,$a,$n,$v,$room,$group,$m);
if( $nameIcon ) {
if( my $icon = lookup($nameIcon,$name,$a,$n,$v,$room,$group,"") ) {
$txt = FW_makeImage( $icon, $txt, "icon" );
}
}
my $devStateIcon;
if( $valueIcon ) {
if( my $icon = lookup($valueIcon,$name,$a,$n,$v,$room,$group,"") ) {
if( $icon =~ m/^[\%\$]devStateIcon$/ ) {
my %extPage = ();
my ($allSets, $cmdlist, $txt) = FW_devState($name, $room, \%extPage);
$devStateIcon = $txt;
} else {
$devStateIcon = FW_makeImage( $icon, $v, "icon" );
}
}
}
if( $first || $multi == 1 ) {
$ret .= sprintf("", ($row&1)?"odd":"even");
$row++;
}
$txt = "$txt" if( $show_links );
$ret .= "$txt | " if( $first || $multi == 1 );
$ret .= "$devStateIcon | " if( $devStateIcon );
$ret .= "$v | " if( !$devStateIcon );
$ret .= "$t | " if( $show_time );
$first = 0;
}
}
}
$ret .= " |
";
$ret .= "