mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-04 23:46:35 +00:00
33_readingsGroup.pm: added timestamp update for FW_addToWritebuffer
fixed updates for format suffixes git-svn-id: https://svn.fhem.de/fhem/trunk@20686 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
df9e8689cf
commit
7cd54f2dc8
@ -1109,6 +1109,7 @@ readingsGroup_2html($;$)
|
|||||||
($informid,$v,$devStateIcon) = readingsGroup_value2html($hash,$calc,$name,$name2,$n,$v,$cell_row,$cell_column,$type);
|
($informid,$v,$devStateIcon) = readingsGroup_value2html($hash,$calc,$name,$name2,$n,$v,$cell_row,$cell_column,$type);
|
||||||
next if( !defined($informid) );
|
next if( !defined($informid) );
|
||||||
#$informid = "informId=\"$d-item:$cell_row:$item\"" if( $format );
|
#$informid = "informId=\"$d-item:$cell_row:$item\"" if( $format );
|
||||||
|
$informid =~ s/"$/:$format"/ if( $format );
|
||||||
|
|
||||||
my $cell_style0 = lookup2($hash->{helper}{cellStyle},$name,$n,$v,$cell_row,0);
|
my $cell_style0 = lookup2($hash->{helper}{cellStyle},$name,$n,$v,$cell_row,0);
|
||||||
my $cell_style = lookup2($hash->{helper}{cellStyle},$name,$n,$v,$cell_row,$cell_column);
|
my $cell_style = lookup2($hash->{helper}{cellStyle},$name,$n,$v,$cell_row,$cell_column);
|
||||||
@ -1218,8 +1219,6 @@ readingsGroup_Update($$$)
|
|||||||
my ($hash, $item, $value) = @_;
|
my ($hash, $item, $value) = @_;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
#Log 1, "$name, $item, $value";
|
|
||||||
|
|
||||||
$hash->{changed} = 1;
|
$hash->{changed} = 1;
|
||||||
|
|
||||||
if( $hash->{alwaysTrigger} ) {
|
if( $hash->{alwaysTrigger} ) {
|
||||||
@ -1234,7 +1233,13 @@ readingsGroup_Update($$$)
|
|||||||
$ntfy->{inform}{type} ne "status");
|
$ntfy->{inform}{type} ne "status");
|
||||||
next if( !$ntfy->{inform}{devices}{$name} );
|
next if( !$ntfy->{inform}{devices}{$name} );
|
||||||
if(!FW_addToWritebuffer($ntfy,
|
if(!FW_addToWritebuffer($ntfy,
|
||||||
FW_longpollInfo($ntfy->{inform}{fmt}, "$name-$item", "", $value )."\n" )) {
|
FW_longpollInfo($ntfy->{inform}{fmt}, "$name-$item", "", $value ) ."\n" )) {
|
||||||
|
my $name = $ntfy->{NAME};
|
||||||
|
Log3 $name, 4, "Closing connection $name due to full buffer in FW_Notify";
|
||||||
|
TcpServer_Close($ntfy, 1);
|
||||||
|
}
|
||||||
|
if(!FW_addToWritebuffer($ntfy,
|
||||||
|
FW_longpollInfo($ntfy->{inform}{fmt}, "$name-$item-ts", "", TimeNow() ) ."\n" )) {
|
||||||
my $name = $ntfy->{NAME};
|
my $name = $ntfy->{NAME};
|
||||||
Log3 $name, 4, "Closing connection $name due to full buffer in FW_Notify";
|
Log3 $name, 4, "Closing connection $name due to full buffer in FW_Notify";
|
||||||
TcpServer_Close($ntfy, 1);
|
TcpServer_Close($ntfy, 1);
|
||||||
@ -1298,8 +1303,10 @@ readingsGroup_Notify($$)
|
|||||||
$hash->{DEF} =~ s/ $//;
|
$hash->{DEF} =~ s/ $//;
|
||||||
}
|
}
|
||||||
readingsGroup_updateDevices($hash);
|
readingsGroup_updateDevices($hash);
|
||||||
|
|
||||||
} elsif( $dev->{NAME} eq "global" && $s =~ m/^DEFINED ([^ ]*)$/) {
|
} elsif( $dev->{NAME} eq "global" && $s =~ m/^DEFINED ([^ ]*)$/) {
|
||||||
readingsGroup_updateDevices($hash);
|
readingsGroup_updateDevices($hash);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
next if(AttrVal($name,"disable", undef));
|
next if(AttrVal($name,"disable", undef));
|
||||||
|
|
||||||
@ -1511,7 +1518,11 @@ readingsGroup_Notify($$)
|
|||||||
$value = "<div $value_style>$value</div>" if( $value_style );
|
$value = "<div $value_style>$value</div>" if( $value_style );
|
||||||
|
|
||||||
#FIXME: create {'$n.$reading'} = $value hash to avaid multiple events and calculations if same reading is included multiple times
|
#FIXME: create {'$n.$reading'} = $value hash to avaid multiple events and calculations if same reading is included multiple times
|
||||||
|
if( $format ) {
|
||||||
|
$triggers{"$n.$reading:$format"} = $value;
|
||||||
|
} else {
|
||||||
$triggers{"$n.$reading"} = $value;
|
$triggers{"$n.$reading"} = $value;
|
||||||
|
}
|
||||||
|
|
||||||
if( my $cells = $hash->{helper}{positions}{"$n.$reading"} ) {
|
if( my $cells = $hash->{helper}{positions}{"$n.$reading"} ) {
|
||||||
foreach my $cell ( split( ',', $cells ) ) {
|
foreach my $cell ( split( ',', $cells ) ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user