From 7b589c834c734ceb0cf0da46f55d6ea25a82ea1f Mon Sep 17 00:00:00 2001 From: mgehre <> Date: Sun, 9 Dec 2012 15:03:30 +0000 Subject: [PATCH] CUL_MAX: ignore re-pair pings git-svn-id: https://svn.fhem.de/fhem/trunk@2305 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/14_CUL_MAX.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/14_CUL_MAX.pm b/fhem/FHEM/14_CUL_MAX.pm index 9a1c0b1c9..94de6eadc 100644 --- a/fhem/FHEM/14_CUL_MAX.pm +++ b/fhem/FHEM/14_CUL_MAX.pm @@ -183,11 +183,12 @@ CUL_MAX_Parse($$) my ($unk1,$type,$unk2,$serial) = unpack("CCCa*",pack("H*",$payload)); Log 5, "CUL_MAX_Parse: Got PairPing (dst $dst, pairmode $shash->{pairmode}), unk1 $unk1, type $type, unk2 $unk2, serial $serial"; - #There are two variants of PairPing: The first has a destination address of "000000" and can be paired - #to any device. The other is send after changing batteries (without factory reset) and has a destination address of the last paired device. - #It can still be paired to any device (doesn't have to be the last paired device). - if(($dst ne "000000") and ($dst ne $shash->{addr})) { - Log 2, "Device want's to be re-paired to $dst"; + #There are two variants of PairPing: + #1. It has a destination address of "000000" and can be paired to any device. + #2. It is sent after changing batteries or repressing the pair button (without factory reset) and has a destination address of the last paired device. We can answer it with PairPong and even get an Ack, but it will still not be paired to us. A factory reset (originating from the last paired device) is needed first. + if(($dst ne "000000") and !$isToMe) { + Log 2, "Device want's to be re-paired to $dst, not to us"; + return undef; } if($shash->{pairmode}) {