mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 14:04:15 +00:00
33_readingsGroup.pm: fix for item: informid (see forum: http://forum.fhem.de/index.php/topic,42305.msg344886.html#msg344886)
git-svn-id: https://svn.fhem.de/fhem/trunk@9459 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
8ff1452b96
commit
60a258bff5
@ -730,9 +730,8 @@ readingsGroup_2html($;$)
|
|||||||
$ret .= "<tr><td><table $style id='readingsGroup-$d' groupId=\"$group\" class=\"block wide readingsGroup\">";
|
$ret .= "<tr><td><table $style id='readingsGroup-$d' groupId=\"$group\" class=\"block wide readingsGroup\">";
|
||||||
$ret .= "<tr><td colspan=\"99\"><div style=\"color:#ff8888;text-align:center\">updates disabled</div></tr>" if( $disable > 0 );
|
$ret .= "<tr><td colspan=\"99\"><div style=\"color:#ff8888;text-align:center\">updates disabled</div></tr>" if( $disable > 0 );
|
||||||
|
|
||||||
my $item = 0;
|
|
||||||
foreach my $device (@{$devices}) {
|
foreach my $device (@{$devices}) {
|
||||||
$item++;
|
my $item = 0;
|
||||||
my $h = $defs{$device->[0]};
|
my $h = $defs{$device->[0]};
|
||||||
my $regex = $device->[1];
|
my $regex = $device->[1];
|
||||||
if( !$h && $device->[0] =~ m/^<.*>$/ ) {
|
if( !$h && $device->[0] =~ m/^<.*>$/ ) {
|
||||||
@ -759,6 +758,7 @@ readingsGroup_2html($;$)
|
|||||||
&& defined($list[++$i]) ) {
|
&& defined($list[++$i]) ) {
|
||||||
$regex .= ",". $list[$i];
|
$regex .= ",". $list[$i];
|
||||||
}
|
}
|
||||||
|
$item++;
|
||||||
my $h = $h;
|
my $h = $h;
|
||||||
my $type;
|
my $type;
|
||||||
my $force_show = 0;
|
my $force_show = 0;
|
||||||
@ -906,7 +906,7 @@ readingsGroup_2html($;$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $informid = "";
|
my $informid = "";
|
||||||
$informid = "informId=\"$d-item:$item\"" if( $readings );
|
$informid = "informId=\"$d-item:$cell_row:$item\"" if( $readings );
|
||||||
$ret .= "<td $value_columns><div $cell_style $name_style $informid>$txt</div></td>";
|
$ret .= "<td $value_columns><div $cell_style $name_style $informid>$txt</div></td>";
|
||||||
$first = 0;
|
$first = 0;
|
||||||
++$cell_column;
|
++$cell_column;
|
||||||
@ -1163,9 +1163,10 @@ readingsGroup_Notify($$)
|
|||||||
$value = "" if( !defined($value) );
|
$value = "" if( !defined($value) );
|
||||||
my $show_state = !AttrVal( $name, "nostate", "0" );
|
my $show_state = !AttrVal( $name, "nostate", "0" );
|
||||||
|
|
||||||
my $item = 0;
|
my $cell_row = 0;
|
||||||
foreach my $device (@{$devices}) {
|
foreach my $device (@{$devices}) {
|
||||||
$item++;
|
my $item = 0;
|
||||||
|
++$cell_row;
|
||||||
my $h = $defs{@{$device}[0]};
|
my $h = $defs{@{$device}[0]};
|
||||||
next if( !$h );
|
next if( !$h );
|
||||||
next if( $dev->{NAME} ne $h->{NAME} );
|
next if( $dev->{NAME} ne $h->{NAME} );
|
||||||
@ -1174,7 +1175,7 @@ readingsGroup_Notify($$)
|
|||||||
my @list = (undef);
|
my @list = (undef);
|
||||||
@list = split(",",$regex) if( $regex );
|
@list = split(",",$regex) if( $regex );
|
||||||
for( my $i = 0; $i <= $#list; ++$i ) {
|
for( my $i = 0; $i <= $#list; ++$i ) {
|
||||||
my $regex = $list[$i];
|
my $regex = $list[$i];
|
||||||
while ($regex
|
while ($regex
|
||||||
&& ( ($regex =~ m/^</ && $regex !~ m/>$/) #handle , in <...>
|
&& ( ($regex =~ m/^</ && $regex !~ m/>$/) #handle , in <...>
|
||||||
|| ($regex =~ m/@\{/ && $regex !~ m/\}$/) #handle , in reading@{...}
|
|| ($regex =~ m/@\{/ && $regex !~ m/\}$/) #handle , in reading@{...}
|
||||||
@ -1182,6 +1183,7 @@ readingsGroup_Notify($$)
|
|||||||
&& defined($list[++$i]) ) {
|
&& defined($list[++$i]) ) {
|
||||||
$regex .= ",". $list[$i];
|
$regex .= ",". $list[$i];
|
||||||
}
|
}
|
||||||
|
++$item;
|
||||||
next if( $reading eq "state" && !$show_state && (!defined($regex) || $regex ne "state") );
|
next if( $reading eq "state" && !$show_state && (!defined($regex) || $regex ne "state") );
|
||||||
my $modifier = "";
|
my $modifier = "";
|
||||||
if( $regex && $regex =~ m/^([+?!\$]*)(.*)/ ) {
|
if( $regex && $regex =~ m/^([+?!\$]*)(.*)/ ) {
|
||||||
@ -1224,7 +1226,7 @@ readingsGroup_Notify($$)
|
|||||||
($txt,undef) = readingsGroup_makeLink($txt,undef,$cmd);
|
($txt,undef) = readingsGroup_makeLink($txt,undef,$cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
DoTrigger( $name, "item:$item: $txt" );
|
DoTrigger( $name, "item:$cell_row:$item: $txt" );
|
||||||
}
|
}
|
||||||
|
|
||||||
next;
|
next;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user