2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-27 16:43:29 +00:00

SVG: accept def without CURRENT (for dblog)

git-svn-id: https://svn.fhem.de/fhem/trunk@3857 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-09-04 21:09:38 +00:00
parent f543beaa20
commit 19b9b06386

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;