From 5547fb19ab48a6a27f07b4dd1d6992244876f452 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Fri, 25 Jul 2008 14:20:52 +0000 Subject: [PATCH] Auto-Loading the SVG module if plotmode is SVG git-svn-id: https://svn.fhem.de/fhem/trunk@214 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/webfrontend/pgm2/01_FHEMWEB.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fhem/webfrontend/pgm2/01_FHEMWEB.pm b/fhem/webfrontend/pgm2/01_FHEMWEB.pm index 3960eb43a..e79f47a91 100755 --- a/fhem/webfrontend/pgm2/01_FHEMWEB.pm +++ b/fhem/webfrontend/pgm2/01_FHEMWEB.pm @@ -81,6 +81,7 @@ FHEMWEB_Initialize($) $hash->{DefFn} = "FHEMWEB_Define"; $hash->{UndefFn} = "FHEMWEB_Undef"; + $hash->{AttrFn} = "FHEMWEB_Attr"; $hash->{AttrList}= "loglevel:0,1,2,3,4,5,6 webname plotmode:gnuplot,gnuplot-scroll,SVG plotsize"; } @@ -126,6 +127,18 @@ FHEMWEB_Undef($$) return undef; } +##################################### +sub +FHEMWEB_Attr(@) +{ + my @a = @_; + + if($a[0] eq "set" && $a[2] eq "plotmode" && $a[3] eq "SVG" && + !$modules{SVG}{LOADED}) { + CommandReload(undef, "98_SVG"); + } +} + ##################################### sub FHEMWEB_Read($)