mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
copy: added optional arguments for device creation
git-svn-id: https://svn.fhem.de/fhem/trunk@12200 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
3be4676238
commit
60107e50ab
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- feature: new optional arguments for device creation in copy command
|
||||
- bugfix: 49_SSCam: bugfix of get presets, get patrols of zoom-cams
|
||||
without pan/tilt
|
||||
- updated: 74_AMAD: New Version 2.6.3 new Reading userFlowState,
|
||||
|
@ -11,7 +11,7 @@ sub
|
||||
copy_Initialize($)
|
||||
{
|
||||
my %lhash = ( Fn=>"CommandCopy",
|
||||
Hlp=>"<orig name> <copy name>" );
|
||||
Hlp=>"<orig name> <copy name> [<type dependent arguments>]" );
|
||||
$cmds{copy} = \%lhash;
|
||||
}
|
||||
|
||||
@ -22,13 +22,18 @@ CommandCopy($$)
|
||||
|
||||
my @args = split(/ +/,$param);
|
||||
|
||||
return "Usage: copy <orig name> <copy name>" if (@args != 2);
|
||||
return "Usage: copy <orig name> <copy name> [<type dependent arguments>]" if (@args < 2);
|
||||
|
||||
my $d = $defs{$args[0]};
|
||||
return "$args[0] not defined" if( !$d );
|
||||
|
||||
my $cmd = "$args[1] $d->{TYPE}";
|
||||
$cmd .= " $d->{DEF}" if( $d->{DEF} );
|
||||
if( $args[2] ) {
|
||||
$cmd .= ' '. join( ' ', @args[2..@args-1]);
|
||||
} else {
|
||||
$cmd .= " $d->{DEF}" if( $d->{DEF} );
|
||||
}
|
||||
|
||||
my $ret = CommandDefine($hash, $cmd );
|
||||
return $ret if( $ret );
|
||||
|
||||
@ -56,9 +61,10 @@ CommandCopy($$)
|
||||
<a name="copy"></a>
|
||||
<h3>copy</h3>
|
||||
<ul>
|
||||
<code>copy <orig name> <copy name></code><br>
|
||||
<code>copy <orig name> <copy name> [<type dependent arguments>]</code><br>
|
||||
<br>
|
||||
Create a copy of device <orig name> with the name <copy name>.
|
||||
Create a copy of device <orig name> with the name <copy name>.<br>
|
||||
If <type dependent arguments> are given they will replace the DEF of <orig name> for the creation of <copy name>.
|
||||
</ul>
|
||||
|
||||
=end html
|
||||
@ -68,9 +74,10 @@ CommandCopy($$)
|
||||
<a name="copy"></a>
|
||||
<h3>copy</h3>
|
||||
<ul>
|
||||
<code>copy <orig name> <copy name></code><br>
|
||||
<code>copy <orig name> <copy name> [<type dependent arguments>]</code><br>
|
||||
<br>
|
||||
Erzeugt eine Kopie des Device <orig name> mit dem namen <copy name>.
|
||||
Erzeugt eine Kopie des Device <orig name> mit dem namen <copy name>.<br>
|
||||
Wenn <type dependent arguments> angegeben sind ersetzen die die DEF von <orig name> beim anlegen von <copy name>.
|
||||
</ul>
|
||||
|
||||
=end html_DE
|
||||
|
Loading…
Reference in New Issue
Block a user