diff --git a/fhem/CHANGED b/fhem/CHANGED index 372836fc2..3569113d1 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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, diff --git a/fhem/FHEM/98_copy.pm b/fhem/FHEM/98_copy.pm index 47fefedc7..6d84653c2 100644 --- a/fhem/FHEM/98_copy.pm +++ b/fhem/FHEM/98_copy.pm @@ -11,7 +11,7 @@ sub copy_Initialize($) { my %lhash = ( Fn=>"CommandCopy", - Hlp=>" " ); + Hlp=>" []" ); $cmds{copy} = \%lhash; } @@ -22,13 +22,18 @@ CommandCopy($$) my @args = split(/ +/,$param); - return "Usage: copy " if (@args != 2); + return "Usage: copy []" 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($$)

copy

    - copy <orig name> <copy name>
    + copy <orig name> <copy name> [<type dependent arguments>]

    - Create a copy of device <orig name> with the name <copy name>. + Create a copy of device <orig name> with the name <copy name>.
    + If <type dependent arguments> are given they will replace the DEF of <orig name> for the creation of <copy name>.
=end html @@ -68,9 +74,10 @@ CommandCopy($$)

copy

    - copy <orig name> <copy name>
    + copy <orig name> <copy name> [<type dependent arguments>]

    - Erzeugt eine Kopie des Device <orig name> mit dem namen <copy name>. + Erzeugt eine Kopie des Device <orig name> mit dem namen <copy name>.
    + Wenn <type dependent arguments> angegeben sind ersetzen die die DEF von <orig name> beim anlegen von <copy name>.
=end html_DE