mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
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:
parent
81b54956ec
commit
f49a132f21
4
fhem.pl
4
fhem.pl
@ -2022,6 +2022,10 @@ CommandDefMod($$)
|
|||||||
my @a = split("[ \t]+", $def, 3);
|
my @a = split("[ \t]+", $def, 3);
|
||||||
return "Usage: defmod <name> <type> <type dependent arguments>"
|
return "Usage: defmod <name> <type> <type dependent arguments>"
|
||||||
if(int(@a) < 2);
|
if(int(@a) < 2);
|
||||||
|
if($a[0] eq "-temporary" && $defs{$a[1]}) {
|
||||||
|
@a = split("[ \t]+", $def, 4);
|
||||||
|
shift @a;
|
||||||
|
}
|
||||||
if($defs{$a[0]}) {
|
if($defs{$a[0]}) {
|
||||||
$def = $a[2] ? "$a[0] $a[2]" : $a[0];
|
$def = $a[2] ? "$a[0] $a[2]" : $a[0];
|
||||||
return "defmod $a[0]: Cannot change the TYPE of an existing definition"
|
return "defmod $a[0]: Cannot change the TYPE of an existing definition"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user