modify definition argument is optional now
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2653 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
5
fhem.pl
5
fhem.pl
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user