mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-14 05:46:35 +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:
parent
9622cc4026
commit
73e0b9de9b
@ -548,6 +548,17 @@ ECMD_Attr($@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
sub
|
||||||
|
ECMD_Reopen($)
|
||||||
|
{
|
||||||
|
my ($hash) = @_;
|
||||||
|
ECMD_CloseDev($hash);
|
||||||
|
ECMD_OpenDev($hash, 1);
|
||||||
|
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
sub
|
sub
|
||||||
ECMD_Set($@)
|
ECMD_Set($@)
|
||||||
@ -556,7 +567,11 @@ ECMD_Set($@)
|
|||||||
my $name = $a[0];
|
my $name = $a[0];
|
||||||
|
|
||||||
# usage check
|
# 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 != 4);
|
||||||
return $usage if($a[1] ne "classdef");
|
return $usage if($a[1] ne "classdef");
|
||||||
|
|
||||||
|
@ -3717,6 +3717,11 @@ Attributes:<br>
|
|||||||
<code>define AVRNETIO classdef /etc/fhem/ADC.classdef</code><br>
|
<code>define AVRNETIO classdef /etc/fhem/ADC.classdef</code><br>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
<code>set <name> reopen</code>
|
||||||
|
<br><br>
|
||||||
|
Closes and reopens the device. Could be handy if connection is lost and cannot be
|
||||||
|
reestablished automatically.
|
||||||
|
<br><br>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user