2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 17:26:34 +00:00

Added set reopen command to ECMD.

git-svn-id: https://svn.fhem.de/fhem/trunk@838 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2011-02-13 10:06:59 +00:00
parent 9622cc4026
commit 73e0b9de9b
2 changed files with 40 additions and 20 deletions

View File

@ -548,6 +548,17 @@ ECMD_Attr($@)
}
#####################################
sub
ECMD_Reopen($)
{
my ($hash) = @_;
ECMD_CloseDev($hash);
ECMD_OpenDev($hash, 1);
return undef;
}
#####################################
sub
ECMD_Set($@)
@ -556,7 +567,11 @@ ECMD_Set($@)
my $name = $a[0];
# usage check
my $usage= "Usage: set $name classdef <classname> <filename> ";
my $usage= "Usage: set $name classdef <classname> <filename> OR set $name reopen";
if((@a == 2) && ($a[1] eq "reopen")) {
return ECMD_Reopen($hash);
}
return $usage if(@a != 4);
return $usage if($a[1] ne "classdef");

View File

@ -3717,6 +3717,11 @@ Attributes:<br>
<code>define AVRNETIO classdef /etc/fhem/ADC.classdef</code><br>
</ul>
<br>
<code>set &lt;name&gt; reopen</code>
<br><br>
Closes and reopens the device. Could be handy if connection is lost and cannot be
reestablished automatically.
<br><br>
</ul>