mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
added copy command
git-svn-id: https://svn.fhem.de/fhem/trunk@5888 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c88675b4d8
commit
0167e989f9
@ -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 command copy (justme1968)
|
||||
- feature: enabled GIF, PNG and JPG as background image formats, enabled
|
||||
relative font size changed and perl specials for font size
|
||||
in 02_RSS.pm
|
||||
|
66
fhem/FHEM/98_copy.pm
Normal file
66
fhem/FHEM/98_copy.pm
Normal file
@ -0,0 +1,66 @@
|
||||
|
||||
# $Id$
|
||||
package main;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
sub CommandCopy($$);
|
||||
|
||||
sub
|
||||
copy_Initialize($)
|
||||
{
|
||||
my %lhash = ( Fn=>"CommandCopy",
|
||||
Hlp=>"<orig name> <copy name>" );
|
||||
$cmds{copy} = \%lhash;
|
||||
}
|
||||
|
||||
sub
|
||||
CommandCopy($$)
|
||||
{
|
||||
my ($hash, $param) = @_;
|
||||
|
||||
my @args = split(/ +/,$param);
|
||||
|
||||
return "Usage: copy <orig name> <copy name>" 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} );
|
||||
my $ret = CommandDefine($hash, $cmd );
|
||||
return $ret if( $ret );
|
||||
|
||||
foreach my $a (keys %{$attr{$args[0]}}) {
|
||||
CommandAttr($hash, "$args[1] $a $attr{$args[0]}{$a}");
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
=begin html
|
||||
|
||||
<a name="copy"></a>
|
||||
<h3>copy</h3>
|
||||
<ul>
|
||||
<code>copy <orig name> <copy name></code><br>
|
||||
<br>
|
||||
Create a copy of device <orig name> with the name <copy name>.
|
||||
</ul>
|
||||
|
||||
=end html
|
||||
|
||||
=begin html_DE
|
||||
|
||||
<a name="copy"></a>
|
||||
<h3>copy</h3>
|
||||
<ul>
|
||||
<code>copy <orig name> <copy name></code><br>
|
||||
<br>
|
||||
Erzeugt eine Kopie des Device <orig name> mit dem namen <copy name>.
|
||||
</ul>
|
||||
|
||||
=end html_DE
|
||||
=cut
|
@ -223,6 +223,7 @@ FHEM/98_backup.pm mfr69bs http://forum.fhem.de Sonstiges
|
||||
FHEM/98_cloneDummy.pm Joachim http://forum.fhem.de Automatisierung
|
||||
FHEM/98_cmdalias.pm rudolfkoenig http://forum.fhem.de Automatisierung
|
||||
FHEM/98_configdb.pm betateilchen http://forum.fhem.de Sonstiges
|
||||
FHEM/98_copy.pm justme1968 http://forum.fhem.de Sonstiges
|
||||
FHEM/98_dewpoint.pm wherzig http://forum.fhem.de Automatisierung
|
||||
FHEM/98_dummy.pm rudolfkoenig http://forum.fhem.de Automatisierung
|
||||
FHEM/98_fheminfo.pm mfr69bs http://forum.fhem.de Sonstiges
|
||||
|
@ -39,6 +39,7 @@
|
||||
<a href="#CULflash">CULflash</a>
|
||||
<a href="#cmdalias">cmdalias</a>
|
||||
<a href="#configdb">configdb</a>
|
||||
<a href="#copy">copy</a>
|
||||
<a href="#createlog">createlog</a>
|
||||
<a href="#define">define</a>
|
||||
<a href="#delete">delete</a>
|
||||
|
@ -38,6 +38,7 @@
|
||||
<a href="#CULflash">CULflash</a>
|
||||
<a href="#cmdalias">cmdalias</a>
|
||||
<a href="#configdb">configdb</a>
|
||||
<a href="#copy">copy</a>
|
||||
<a href="#createlog">createlog</a>
|
||||
<a href="#define">define</a>
|
||||
<a href="#delete">delete</a>
|
||||
|
Loading…
Reference in New Issue
Block a user