diff --git a/fhem/FHEM/98_SVG.pm b/fhem/FHEM/98_SVG.pm index 6e56208ff..b91d8ecf5 100755 --- a/fhem/FHEM/98_SVG.pm +++ b/fhem/FHEM/98_SVG.pm @@ -74,6 +74,7 @@ SVG_Initialize($) use warnings 'qw'; $hash->{AttrList} = join(" ", @attrList); $hash->{SetFn} = "SVG_Set"; + $hash->{NotifyFn} = "SVG_Notify"; $hash->{FW_summaryFn} = "SVG_FwFn"; $hash->{FW_detailFn} = "SVG_FwFn"; $hash->{FW_atPageEnd} = 1; @@ -99,6 +100,7 @@ SVG_Define($$) $hash->{LOGFILE} = ($3 ? $3 : "CURRENT"); $hash->{STATE} = "initialized"; $hash->{LOGDEVICE} =~ s/^fileplot //; # Autocreate bug. + notifyRegexpChanged($hash, "global"); return undef; } @@ -145,6 +147,19 @@ SVG_Attr($$$$) return AttrVal($parent, $attr, $default); } +sub +SVG_Notify($$) +{ + my ($me, $dev) = @_; + + my $events = deviceEvents($defs{global}, 0); + return if(!$events || + $events->[0] !~m/^RENAMED (.+) (.+)$/ || + $2 ne $me->{NAME} || + $1 ne $me->{GPLOTFILE}); + SVG_Set($me, $me->{NAME}, "copyGplotFile"); # Forum #59786 +} + ################## sub SVG_FwDetail($@)