2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 19:30:31 +00:00

MAX_LAN: always directly answer re-pair request

git-svn-id: https://svn.fhem.de/fhem/trunk@4110 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mgehre 2013-10-25 10:47:00 +00:00
parent b585c9dfcb
commit 60511648a0

View File

@ -316,19 +316,21 @@ CUL_MAX_Parse($$)
return $shash->{NAME}; return $shash->{NAME};
} }
if($shash->{pairmode}) { #If $isToMe is true, this device is already paired and just wants to be reacknowledged
Log 3, "CUL_MAX_Parse: Pairing device $src of type $device_types{$type} with serial $serial"; if($shash->{pairmode} || $isToMe) {
Log 3, "CUL_MAX_Parse: " . ($isToMe ? "Re-Pairing" : "Pairing") . " device $src of type $device_types{$type} with serial $serial";
Dispatch($shash, "MAX,$isToMe,define,$src,$device_types{$type},$serial,0,0", {RAWMSG => $rmsg}); Dispatch($shash, "MAX,$isToMe,define,$src,$device_types{$type},$serial,0,0", {RAWMSG => $rmsg});
#Send after dispatch the define, otherwise Send will create an invalid device #Send after dispatch the define, otherwise Send will create an invalid device
CUL_MAX_Send($shash, "PairPong", $src, "00"); CUL_MAX_Send($shash, "PairPong", $src, "00");
return $shash->{NAME} if($isToMe); #Skip default values if just rePairing
#This are the default values that a device has after factory reset or pairing #This are the default values that a device has after factory reset or pairing
if($device_types{$type} =~ /HeatingThermostat.*/) { if($device_types{$type} =~ /HeatingThermostat.*/) {
Dispatch($shash, "MAX,$isToMe,HeatingThermostatConfig,$src,17,21,30.5,4.5,80,5,0,12,15,100,0,0,12,$defaultWeekProfile", {RAWMSG => $rmsg}); Dispatch($shash, "MAX,$isToMe,HeatingThermostatConfig,$src,17,21,30.5,4.5,80,5,0,12,15,100,0,0,12,$defaultWeekProfile", {RAWMSG => $rmsg});
} elsif($device_types{$type} eq "WallMountedThermostat") { } elsif($device_types{$type} eq "WallMountedThermostat") {
Dispatch($shash, "MAX,$isToMe,WallThermostatConfig,$src,17,21,30.5,4.5,$defaultWeekProfile", {RAWMSG => $rmsg}); Dispatch($shash, "MAX,$isToMe,WallThermostatConfig,$src,17,21,30.5,4.5,$defaultWeekProfile", {RAWMSG => $rmsg});
} }
#Todo: CUL_MAX_SendTimeInformation($shash, $src); on Ack for our PairPong
} }
} elsif($msgType ~~ ["ShutterContactState", "WallThermostatState", "WallThermostatControl", "ThermostatState", "PushButtonState"]) { } elsif($msgType ~~ ["ShutterContactState", "WallThermostatState", "WallThermostatControl", "ThermostatState", "PushButtonState"]) {
Dispatch($shash, "MAX,$isToMe,$msgType,$src,$payload", {RAWMSG => $rmsg}); Dispatch($shash, "MAX,$isToMe,$msgType,$src,$payload", {RAWMSG => $rmsg});