2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-07 12:58:13 +00:00

32_mailcheck.pm: added set active/inactive commands

git-svn-id: https://svn.fhem.de/fhem/trunk@10850 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2016-02-15 07:46:25 +00:00
parent 222f260fb0
commit f95f6b46e6
2 changed files with 28 additions and 2 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # Do not insert empty lines here, update check depends on it.
- feature: 32_mailcheck: added set active/inactive commands
- feature: 02_RSS: new attribute urlOverride - feature: 02_RSS: new attribute urlOverride
- feature: 71_YAMAHA_NP: Added auto reading update for tuner and player - feature: 71_YAMAHA_NP: Added auto reading update for tuner and player
- feature 49_SSCAM: The port in DEF-String is optional now, - feature 49_SSCAM: The port in DEF-String is optional now,

View File

@ -34,7 +34,7 @@ mailcheck_Initialize($)
$hash->{DefFn} = "mailcheck_Define"; $hash->{DefFn} = "mailcheck_Define";
$hash->{NotifyFn} = "mailcheck_Notify"; $hash->{NotifyFn} = "mailcheck_Notify";
$hash->{UndefFn} = "mailcheck_Undefine"; $hash->{UndefFn} = "mailcheck_Undefine";
#$hash->{SetFn} = "mailcheck_Set"; $hash->{SetFn} = "mailcheck_Set";
$hash->{GetFn} = "mailcheck_Get"; $hash->{GetFn} = "mailcheck_Get";
$hash->{AttrFn} = "mailcheck_Attr"; $hash->{AttrFn} = "mailcheck_Attr";
$hash->{AttrList} = "debug:1 ". $hash->{AttrList} = "debug:1 ".
@ -240,7 +240,23 @@ mailcheck_Set($$@)
{ {
my ($hash, $name, $cmd) = @_; my ($hash, $name, $cmd) = @_;
my $list = ""; my $list = "active:noArgs inactive:noArgs";
if( $cmd eq 'active' ) {
mailcheck_Disconnect($hash);
$hash->{STATE} = "Initialized";
mailcheck_Connect($hash);
return undef;
} elsif( $cmd eq 'inactive' ) {
mailcheck_Disconnect($hash);
$hash->{STATE} = 'inactive';
return undef;
}
return "Unknown argument $cmd, choose one of $list"; return "Unknown argument $cmd, choose one of $list";
} }
@ -515,6 +531,15 @@ mailcheck_Read($)
the mail address of the last sender</li> the mail address of the last sender</li>
</ul><br> </ul><br>
<a name="mailcheck_Set"></a>
<b>Set</b>
<ul>
<li>inactive<br>
temporarily deactivates the device</li>
<li>active<br>
reenables the device</li>
</ul><br>
<a name="mailcheck_Get"></a> <a name="mailcheck_Get"></a>
<b>Get</b> <b>Get</b>
<ul> <ul>