fhem.pl: add -temporary for defmod (Forum #85545)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@16675 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-04-29 22:15:41 +00:00
parent 81b54956ec
commit f49a132f21

View File

@ -2022,6 +2022,10 @@ CommandDefMod($$)
my @a = split("[ \t]+", $def, 3);
return "Usage: defmod <name> <type> <type dependent arguments>"
if(int(@a) < 2);
if($a[0] eq "-temporary" && $defs{$a[1]}) {
@a = split("[ \t]+", $def, 4);
shift @a;
}
if($defs{$a[0]}) {
$def = $a[2] ? "$a[0] $a[2]" : $a[0];
return "defmod $a[0]: Cannot change the TYPE of an existing definition"