diff --git a/fhem/CHANGED b/fhem/CHANGED index 741dff80e..1e24c2c4e 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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: 32_mailcheck: added set active/inactive commands - feature: 02_RSS: new attribute urlOverride - feature: 71_YAMAHA_NP: Added auto reading update for tuner and player - feature 49_SSCAM: The port in DEF-String is optional now, diff --git a/fhem/FHEM/32_mailcheck.pm b/fhem/FHEM/32_mailcheck.pm index 9a285f790..425ef8c3e 100755 --- a/fhem/FHEM/32_mailcheck.pm +++ b/fhem/FHEM/32_mailcheck.pm @@ -34,7 +34,7 @@ mailcheck_Initialize($) $hash->{DefFn} = "mailcheck_Define"; $hash->{NotifyFn} = "mailcheck_Notify"; $hash->{UndefFn} = "mailcheck_Undefine"; - #$hash->{SetFn} = "mailcheck_Set"; + $hash->{SetFn} = "mailcheck_Set"; $hash->{GetFn} = "mailcheck_Get"; $hash->{AttrFn} = "mailcheck_Attr"; $hash->{AttrList} = "debug:1 ". @@ -240,7 +240,23 @@ mailcheck_Set($$@) { 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"; } @@ -515,6 +531,15 @@ mailcheck_Read($) the mail address of the last sender
+ + Set +
+ Get