";
@@ -1527,7 +1527,7 @@ FW_showLog($)
FW_fC("get $d $file INT $f $t " . join(" ", @{$flog}), 1);
($cfg, $plot) = FW_substcfg(1, $wl, $cfg, $plot, $file, "");
$ret = SVG_render($wl, $f, $t, $cfg,
- $internal_data, $plot, $FW_wname, $FW_cssdir);
+ $internal_data, $plot, $FW_wname, $FW_cssdir, $flog);
FW_pO $ret;
if($SVGcache) {
mkdir($cDir) if(! -d $cDir);
@@ -2319,7 +2319,7 @@ FW_roomStatesForInform($)
foreach my $dn (@rl) {
my ($allSet, $cmdlist, $txt) = FW_devState($dn, "", \%extPage);
$data .= "$dn<<$defs{$dn}{STATE}<<$txt\r\n"
- if($defs{$dn} && $defs{$dn}{STATE});
+ if($defs{$dn} && $defs{$dn}{STATE} && $defs{$dn}{TYPE} ne "weblink");
}
return $data;
}
@@ -2463,7 +2463,7 @@ FW_devState($$@)
}
$link .= "&room=$room";
}
- if(AttrVal($FW_wname, "longpoll", undef)) {
+ if(AttrVal($FW_wname, "longpoll", 1)) {
$txt = "$txt";
} elsif($FW_ss || $FW_tp) {
@@ -2930,9 +2930,25 @@ FW_dropdownFn()
In this mode status update is refreshed more or less instantaneously,
and state change (on/off only) is done without requesting a complete
refresh from the server.
+ Default is on.
+
+
longpollSVG
+ Reloads an SVG weblink, if an event should modify its content. Since
+ an exact determination of the affected events is too complicated, we
+ need some help from the #FileLog definition in the .gplot file: the
+ filter used there (second parameter) must either contain only the
+ deviceName or have the form deviceName.event or deviceName.*. This is
+ always the case when using the Plot
+ editor. The SVG will be reloaded for any event triggered by
+ this deviceName.
+ Default is off.
+
+
+
+
redirectCmds
Clear the browser URL window after issuing the command by redirecting
diff --git a/fhem/FHEM/92_FileLog.pm b/fhem/FHEM/92_FileLog.pm
index e73a40ea1..688afa9c0 100755
--- a/fhem/FHEM/92_FileLog.pm
+++ b/fhem/FHEM/92_FileLog.pm
@@ -383,9 +383,9 @@ FileLog_Get($@)
$internal = 1;
}
-
+
if($inf eq "-") {
- # In case the plot is drawn afte midnight, before the first event is logged.
+ # In case now is after midnight, before the first event is logged.
FileLog_Switch($hash);
$inf = $hash->{currentlogfile};
@@ -414,7 +414,6 @@ FileLog_Get($@)
if(!-f $linf) {
# ... or in the archivelog
$linf = AttrVal($hash->{NAME},"archivedir",".") ."/". $inf;
- $linf = "";
}
$inf = $linf;
}
diff --git a/fhem/FHEM/98_SVG.pm b/fhem/FHEM/98_SVG.pm
index 6835380eb..33672b6b6 100755
--- a/fhem/FHEM/98_SVG.pm
+++ b/fhem/FHEM/98_SVG.pm
@@ -9,7 +9,7 @@ use POSIX;
-sub SVG_render($$$$$$$$);
+sub SVG_render($$$$$$$$$);
sub SVG_time_to_sec($);
sub SVG_fmtTime($$);
sub SVG_time_align($$);
@@ -76,7 +76,7 @@ SVG_digestConf($$)
#####################################
sub
-SVG_render($$$$$$$$)
+SVG_render($$$$$$$$$)
{
my $name = shift; # e.g. wl_8
my $from = shift; # e.g. 2008-01-01
@@ -86,6 +86,7 @@ SVG_render($$$$$$$$)
my $plot = shift; # Plot lines from the .gplot file
my $parent_name = shift; # e.g. FHEMWEB instance name
my $parent_dir = shift; # FW_dir
+ my $flog = shift; # #FileLog lines, as array pointer
$SVG_RET="";
@@ -103,12 +104,17 @@ SVG_render($$$$$$$$)
my ($ow,$oh) = split(",", $ps); # Original width
my ($w, $h) = ($ow-2*$x, $oh-2*$y); # Rect size
+ # Keep only the Filter part of the #FileLog
+ $flog = join(" ", map { my @a=split(":",$_);
+ $a[1]=~s/\.[^\.]*$//; $a[1]; } @{$flog});
+ $flog = AttrVal($parent_name, "longpollSVG", 0) ? "flog=\"$flog\"" : "";
+
######################
# Html Header
SVG_pO '';
SVG_pO '';
SVG_pO '