2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 17:26:34 +00:00

modify definition argument is optional now

git-svn-id: https://svn.fhem.de/fhem/trunk@2653 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-02-06 18:19:59 +00:00
parent 2d75c086d4
commit c6b037f8e6

View File

@ -1304,7 +1304,7 @@ CommandModify($$)
my @a = split("[ \t]+", $def, 2); my @a = split("[ \t]+", $def, 2);
return "Usage: modify <name> <type dependent arguments>" return "Usage: modify <name> <type dependent arguments>"
if(int(@a) < 2); if(int(@a) < 1);
# Return a list of modules # Return a list of modules
return "Define $a[0] first" if(!defined($defs{$a[0]})); return "Define $a[0] first" if(!defined($defs{$a[0]}));
@ -1312,7 +1312,8 @@ CommandModify($$)
$hash->{OLDDEF} = $hash->{DEF}; $hash->{OLDDEF} = $hash->{DEF};
$hash->{DEF} = $a[1]; $hash->{DEF} = $a[1];
my $ret = CallFn($a[0], "DefFn", $hash, "$a[0] $hash->{TYPE} $a[1]"); my $ret = CallFn($a[0], "DefFn", $hash,
"$a[0] $hash->{TYPE}".(defined($a[1]) ? " $a[1]" : ""));
$hash->{DEF} = $hash->{OLDDEF} if($ret); $hash->{DEF} = $hash->{OLDDEF} if($ret);
delete($hash->{OLDDEF}); delete($hash->{OLDDEF});
return $ret; return $ret;