SVG: accept def without CURRENT (for dblog)

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@3857 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2013-09-04 21:09:38 +00:00
parent 97c10d1cd3
commit 418bdf47c6

View File

@@ -64,13 +64,14 @@ SVG_Define($$)
my ($hash, $def) = @_;
my ($name, $type, $arg) = split("[ \t]+", $def, 3);
if(!$arg || $arg !~ m/^(.*):(.*):(.*)$/) {
if(!$arg ||
!($arg =~ m/^(.*):(.*):(.*)$/ || $arg =~ m/^(.*):(.*)$/)) {
return "Usage: define <name> SVG <logdevice>:<gnuplot-file>:<logfile>";
}
$hash->{LOGDEVICE} = $1;
$hash->{GPLOTFILE} = $2;
$hash->{LOGFILE} = $3;
$hash->{LOGFILE} = ($3 ? $3 : "CURRENT");
$hash->{STATE} = "initialized";
return undef;