From a802825eda2e35edaca43a51628183206bbfb39a Mon Sep 17 00:00:00 2001 From: justme-1968 Date: Wed, 18 Sep 2013 23:16:45 +0000 Subject: [PATCH] initialisation bug fix git-svn-id: https://svn.fhem.de/fhem/trunk@3923 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/32_mailcheck.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/32_mailcheck.pm b/fhem/FHEM/32_mailcheck.pm index 578b0e150..ef5f9b52c 100755 --- a/fhem/FHEM/32_mailcheck.pm +++ b/fhem/FHEM/32_mailcheck.pm @@ -65,11 +65,12 @@ mailcheck_Define($$) $hash->{Folder} = "INBOX"; $hash->{Folder} = $folder if( $folder ); - if( $hash->{STATE} eq "???" ) { - $hash->{STATE} = "Initialized"; - } elsif( $hash->{STATE} ne "???" ) { + if( $init_done ) { + delete $modules{mailcheck}->{NotifyFn}; mailcheck_Disconnect($hash); mailcheck_Connect($hash); + } elsif( $hash->{STATE} ne "???" ) { + $hash->{STATE} = "Initialized"; } return undef; @@ -81,7 +82,7 @@ mailcheck_Notify($$) my ($hash,$dev) = @_; if( grep(m/^INITIALIZED$/, @{$dev->{CHANGED}}) ) { - delete $hash->{NotifyFn}; + delete $modules{mailcheck}->{NotifyFn}; mailcheck_Connect($hash); }