From 4a615cb054db7ad2d5ffe8441000db10ef47d9bb Mon Sep 17 00:00:00 2001 From: justme-1968 Date: Sat, 27 Dec 2014 20:14:51 +0000 Subject: [PATCH] 33_readingsGroup.pm: fixed longpoll updates for commands mapped to widgets (by Chris, http://forum.fhem.de/index.php/topic,14425.msg235824.html#msg235824D) git-svn-id: https://svn.fhem.de/fhem/trunk@7337 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/33_readingsGroup.pm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/fhem/FHEM/33_readingsGroup.pm b/fhem/FHEM/33_readingsGroup.pm index b2567ef16..d3ccee852 100644 --- a/fhem/FHEM/33_readingsGroup.pm +++ b/fhem/FHEM/33_readingsGroup.pm @@ -627,9 +627,9 @@ readingsGroup_2html($;$) } } - my $inform_id = ""; - $inform_id = "informId=\"$d-$name.i$item.item\"" if( $readings ); - $ret .= "
$txt
"; + my $informid = ""; + $informid = "informId=\"$d-$name.i$item.item\"" if( $readings ); + $ret .= "
$txt
"; $first = 0; ++$cell_column; next; @@ -678,7 +678,7 @@ readingsGroup_2html($;$) Log3 $name, 3, $name .": ". $regex .": ". $@; last; } - next if( $n !~ m/^$regex$/); + next if( $n !~ m/^$regex$/); } my $val = $h->{$n}; @@ -694,6 +694,7 @@ readingsGroup_2html($;$) $v = FW_htmlEscape($val); } + my $informid = "informId=\"$d-$name.$n\""; my $row_style = lookup2($hash->{helper}{cellStyle},$name,$1,undef,$cell_row,undef); my $cell_style0 = lookup2($hash->{helper}{cellStyle},$name,$1,undef,$cell_row,0); my $cell_style = lookup2($hash->{helper}{cellStyle},$name,$1,undef,$cell_row,$cell_column); @@ -776,6 +777,11 @@ readingsGroup_2html($;$) last if(defined($htmlTxt)); } + if( $htmlTxt =~ m/$name-$set/ ) { + $htmlTxt =~ s/$name-$set/$d-$name.$n/g; + $informid = ""; + } + if( $htmlTxt && $htmlTxt =~ m/(.*)<\/td>/s ) { $v = $1; @@ -783,6 +789,7 @@ readingsGroup_2html($;$) if( defined($mapped) ) { $v =~ s/$set /$mapped /; } + $v =~ s/(.*) // if( !$informid ); $webCmdFn = 1; } elsif( $htmlTxt ) { $v = $htmlTxt; @@ -824,8 +831,8 @@ readingsGroup_2html($;$) } } - $ret .= "$devStateIcon" if( $devStateIcon ); - $ret .= "
$v
" if( !$devStateIcon ); + $ret .= "$devStateIcon" if( $devStateIcon ); + $ret .= "
$v
" if( !$devStateIcon ); $ret .= "
$t
" if( $show_time && $t ); $first = 0; @@ -1053,6 +1060,7 @@ readingsGroup_Notify($$) $cmd = lookup2($hash->{helper}{commands},$n,$reading,$value); if( $cmd && $cmd =~ m/^(\w.*):(\S.*)?$/ ) { + DoTrigger( $name, "$n.$reading: $value" ); next; }