From dd0b5936d034281ca0ce1f6862ee6636b60c67be Mon Sep 17 00:00:00 2001 From: risiko79 Date: Sun, 7 Jun 2015 11:09:17 +0000 Subject: [PATCH] 10_pilight_ctrl: fix set reset - lost connection to submodules git-svn-id: https://svn.fhem.de/fhem/trunk@8707 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/10_pilight_ctrl.pm | 28 ++++++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 82fd94b61..3a8d20c46 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. + - bugfix: 10_pilight_ctrl: set reset - lost connection to submodules - bugfix: 70_Pushalot: corrected parameter order for image - change: 70_Pushalot: changed http call to non-blocking - feature: 70_Pushalot: module to send push notification to Windows Phone diff --git a/fhem/FHEM/10_pilight_ctrl.pm b/fhem/FHEM/10_pilight_ctrl.pm index fd8557da5..17c97cca5 100644 --- a/fhem/FHEM/10_pilight_ctrl.pm +++ b/fhem/FHEM/10_pilight_ctrl.pm @@ -1,5 +1,5 @@ ############################################## -# $Id: 10_pilight_ctrl.pm 1.04 2015-05-30 Risiko $ +# $Id: 10_pilight_ctrl.pm 1.05 2015-06-07 Risiko $ # # Usage # @@ -28,6 +28,7 @@ # V 1.02 2015-05-16 - NEW: battery state for temperature sensors # V 1.03 2015-05-20 - NEW: handle screen messages (up,down) # V 1.04 2015-05-30 - FIX: StateFn +# V 1.05 2015-06-07 - FIX: Reset ############################################## package main; @@ -136,14 +137,6 @@ sub pilight_ctrl_Close($) BlockingKill($hash->{helper}{RUNNING_PID}) if(defined($hash->{helper}{RUNNING_PID})); RemoveInternalTimer($hash); - foreach my $d (sort keys %defs) { - if(defined($defs{$d}) && - defined($defs{$d}{IODev}) && - $defs{$d}{IODev} == $hash) - { - delete $defs{$d}{IODev}; - } - } DevIo_CloseDev($hash); } @@ -154,6 +147,15 @@ sub pilight_ctrl_Undef($$) my $me = $hash->{NAME}; pilight_ctrl_Close($hash); + + foreach my $d (sort keys %defs) { + if(defined($defs{$d}) && + defined($defs{$d}{IODev}) && + $defs{$d}{IODev} == $hash) + { + delete $defs{$d}{IODev}; + } + } return undef; } @@ -415,7 +417,7 @@ sub pilight_ctrl_Send($) my $rcv; $socket->recv($rcv,1024); $rcv =~ s/\n/ /g; - Log3 $me, 5, "$me(Send): RCV -> $rcv"; + Log3 $me, 4, "$me(Send): RCV -> $rcv"; } $socket->close(); @@ -602,7 +604,7 @@ sub pilight_ctrl_Parse($$) my ($hash, $rmsg) = @_; my $me = $hash->{NAME}; - Log3 $me, 4, "$me(Parse): RCV -> $rmsg"; + Log3 $me, 5, "$me(Parse): RCV -> $rmsg"; next if(!$rmsg || length($rmsg) < 1); @@ -614,6 +616,8 @@ sub pilight_ctrl_Parse($$) if ($hash->{helper}{CON} eq "identify") # we are in identify process { + Log3 $me, 4, "$me(Parse): identify -> $rmsg"; + $hash->{helper}{CON} = "identify-failed"; my $ret = pilight_ctrl_ClientAccepted($hash,$data); @@ -668,7 +672,7 @@ sub pilight_ctrl_Parse($$) my %whiteHash; @whiteHash{@{$hash->{helper}->{whiteList}}}=(); if (!exists $whiteHash{"$proto:$id"}) { - Log3 $me, 4, "$me(Parse): $proto:$id not in white list"; + Log3 $me, 5, "$me(Parse): $proto:$id not in white list"; return; } } else { #ignore list