Added maxPairForSeconds to fundamentally allow MAX! pairing

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2098 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
gmaniac
2012-11-08 20:52:04 +00:00
parent a89e5257dc
commit aa7100cd1e

View File

@@ -31,6 +31,7 @@ my %gets = ( # Name, Data to send to the CUL, Regexp for the answer
my %sets = ( my %sets = (
"hmPairForSec" => "HomeMatic", "hmPairForSec" => "HomeMatic",
"hmPairSerial" => "HomeMatic", "hmPairSerial" => "HomeMatic",
"maxPairForSec" => "MAX",
"raw" => "", "raw" => "",
"freq" => "SlowRF", "freq" => "SlowRF",
"bWidth" => "SlowRF", "bWidth" => "SlowRF",
@@ -207,6 +208,13 @@ CUL_RemoveHMPair($)
delete($hash->{hmPair}); delete($hash->{hmPair});
} }
sub
CUL_RemoveMAXPair($)
{
my $hash = shift;
delete($hash->{maxPair});
}
##################################### #####################################
sub sub
@@ -242,6 +250,11 @@ CUL_Set($@)
$hash->{HM_CMDNR}, $id, unpack('H*', $arg))); $hash->{HM_CMDNR}, $id, unpack('H*', $arg)));
$hash->{hmPairSerial} = $arg; $hash->{hmPairSerial} = $arg;
} elsif($type eq "maxPairForSec") { ####################################
return "Usage: set $name maxPairForSec <seconds_active>"
if(!$arg || $arg !~ m/^\d+$/);
$hash->{maxPair} = 1;
InternalTimer(gettimeofday()+$arg, "CUL_RemoveMAXPair", $hash, 1);
} elsif($type eq "freq") { ######################################## MHz } elsif($type eq "freq") { ######################################## MHz
@@ -1136,7 +1149,7 @@ CUL_Attr(@)
<a name="hmPairForSec"></a> <a name="hmPairForSec"></a>
<li>hmPairForSec<br> <li>hmPairForSec<br>
<a href="#rfmode">HomeMatic</a> mode only.<br> <a href="#rfmode">HomeMatic</a> mode only.<br>
Set the CUL in Pairing-Mode for the given seconds. Any device set into Set the CUL in Pairing-Mode for the given seconds. Any HM device set into
pairing mode in this time will be paired with fhem. pairing mode in this time will be paired with fhem.
</li><br> </li><br>
<a name="hmPairSerial"></a> <a name="hmPairSerial"></a>
@@ -1147,6 +1160,12 @@ CUL_Attr(@)
the backside of the device. It is not necessary to put the given device the backside of the device. It is not necessary to put the given device
in learning mode if it is a receiver. in learning mode if it is a receiver.
</li><br> </li><br>
<a name="hmPairForSec"></a>
<li>maxPairForSec<br>
<a href="#rfmode">MAX</a> mode only.<br>
Set the CUL in Pairing-Mode for the given seconds. Any MAX device set into
pairing mode in this time will be paired with fhem.
</li><br>
<li>led<br> <li>led<br>
Set the CUL led off (00), on (01) or blinking (02). Set the CUL led off (00), on (01) or blinking (02).
</li><br> </li><br>