2
0
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:
justme-1968 2014-05-18 20:14:20 +00:00
parent c88675b4d8
commit 0167e989f9
5 changed files with 70 additions and 0 deletions

View File

@ -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
View 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 &lt;orig name&gt; &lt;copy name&gt;</code><br>
<br>
Create a copy of device &lt;orig name&gt; with the name &lt;copy name&gt;.
</ul>
=end html
=begin html_DE
<a name="copy"></a>
<h3>copy</h3>
<ul>
<code>copy &lt;orig name&gt; &lt;copy name&gt;</code><br>
<br>
Erzeugt eine Kopie des Device &lt;orig name&gt; mit dem namen &lt;copy name&gt;.
</ul>
=end html_DE
=cut

View File

@ -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

View File

@ -39,6 +39,7 @@
<a href="#CULflash">CULflash</a> &nbsp;
<a href="#cmdalias">cmdalias</a> &nbsp;
<a href="#configdb">configdb</a> &nbsp;
<a href="#copy">copy</a> &nbsp;
<a href="#createlog">createlog</a> &nbsp;
<a href="#define">define</a> &nbsp;
<a href="#delete">delete</a> &nbsp;

View File

@ -38,6 +38,7 @@
<a href="#CULflash">CULflash</a> &nbsp;
<a href="#cmdalias">cmdalias</a> &nbsp;
<a href="#configdb">configdb</a> &nbsp;
<a href="#copy">copy</a> &nbsp;
<a href="#createlog">createlog</a> &nbsp;
<a href="#define">define</a> &nbsp;
<a href="#delete">delete</a> &nbsp;