2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 04:36:36 +00:00

Clients/regexpCLients and Matchlist residing optionally in the device (not the

module).


git-svn-id: https://svn.fhem.de/fhem/trunk@764 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2010-12-12 08:39:57 +00:00
parent 6582c6c62b
commit 33c46c0d18
3 changed files with 17 additions and 13 deletions

View File

@ -76,10 +76,6 @@ CUL_Initialize($)
# Provider
$hash->{ReadFn} = "CUL_Read";
$hash->{WriteFn} = "CUL_Write";
$hash->{Clients} = $clientsSlowRF;
$hash->{MatchList} = \%matchListSlowRF;
$hash->{HomeMaticClients} = $clientsHomeMatic;
$hash->{HomeMaticMatchList} = \%matchListHomeMatic;
$hash->{ReadyFn} = "CUL_Ready";
# Normal devices
@ -117,6 +113,8 @@ CUL_Define($$)
if(uc($a[3]) !~ m/^[0-6][0-9A-F][0-6][0-9A-F]$/);
$hash->{FHTID} = uc($a[3]);
$hash->{initString} = "X21";
$hash->{Clients} = $clientsSlowRF;
$hash->{MatchList} = \%matchListSlowRF;
if($dev eq "none") {
Log 1, "$name device is none, commands will be echoed only";
@ -1122,13 +1120,15 @@ CUL_Attr(@)
if($a[3] eq "HomeMatic") {
return if($hash->{initString} eq "Ar");
$hash->{mode} = "HomeMatic";
$hash->{Clients} = $clientsHomeMatic;
$hash->{MatchList} = \%matchListHomeMatic;
$hash->{initString} = "Ar";
CUL_SimpleWrite($hash, $hash->{initString});
} else {
return if($hash->{initString} eq "X21");
delete($hash->{mode});
$hash->{Clients} = $clientsSlowRF;
$hash->{MatchList} = \%matchListSlowRF;
$hash->{initString} = "X21";
CUL_SimpleWrite($hash, "Ax");
CUL_SimpleWrite($hash, $hash->{initString});

View File

@ -22,6 +22,7 @@ my %culHmDevProps=(
"41" => { st => "sensor", cl => "sender" },
"42" => { st => "swi", cl => "sender" },
"43" => { st => "pushButton", cl => "sender" },
"60" => { st => "KFM100", cl => "sender" },
"80" => { st => "threeStateSensor",cl => "sender" },
"81" => { st => "motionDetector", cl => "sender" },
"C0" => { st => "keyMatic", cl => "sender" },
@ -86,7 +87,9 @@ my %culHmModel=(
"0044" => "HM-SEN-EP",
"0045" => "HM-SEC-WDS",
"0046" => "HM-SWI-3-FM",
"0047" => "KFM-Display",
"0048" => "IS-WDS-TH-OD-S-R3",
"0049" => "KFM-Sensor",
"004A" => "HM-SEC-MDIR",
"004C" => "HM-RC-12-SW",
"004D" => "HM-RC-19-SW",
@ -324,7 +327,7 @@ CUL_HM_Set($@)
return "Usage: set $a[0] $cmd <btn> [on|off] <txt1> <txt2>" if(@a != 6);
return "$a[2] is not a button number" if($a[2] !~ m/^\d$/);
return "$a[3] is not on or off" if($a[3] !~ m/^(on|off)$/);
my $bn = $a[2]*2-($a[3] eq "on" ? 1 : 0);
my $bn = $a[2]*2-($a[3] eq "on" ? 0 : 1);
CUL_HM_PushCmdStack($hash,
sprintf("++A001%s%s%02d050000000001", $id, $hash->{DEF}, $bn));
@ -344,8 +347,8 @@ CUL_HM_Set($@)
$tl = length($l1);
for(my $l = 0; $l < $tl; $l+=28) {
my $ml = $tl-$l < 28 ? $tl-$l : 28;
CUL_HM_PushCmdStack($hash,
sprintf("++A001%s%s%02d08%s", $id, $hash->{DEF}, $bn, substr($l1,$l,$ml)));
CUL_HM_PushCmdStack($hash, sprintf("++A001%s%s%02d08%s",
$id, $hash->{DEF}, $bn, substr($l1,$l,$ml)));
}
CUL_HM_PushCmdStack($hash,
@ -411,12 +414,13 @@ CUL_HM_Pair(@)
my $stn = $attr{$name}{subType}; # subTypeName
my $stt = $stn eq "unknown" ? "subType unknown" : "is a $stn";
Log GetLogLevel($name,2), "CUL_HM pair: $name $stt, model $attr{$name}{model} ".
"serialNr $attr{$name}{serialNr}";
Log GetLogLevel($name,2),
"CUL_HM pair: $name $stt, model $attr{$name}{model} ".
"serialNr $attr{$name}{serialNr}";
# Abort if we are not authorized
if($dst eq "000000") {
return if(!$iohash->{HM_PAIR} && !AttrVal($iohash->{NAME}, "hm_autopair", 0));
return if(!$iohash->{hmPair});
} elsif($dst ne $id) {
return "" ;

View File

@ -24,7 +24,6 @@ FHEM2FHEM_Initialize($)
$hash->{WriteFn} = "FHEM2FHEM_Write";
$hash->{ReadyFn} = "FHEM2FHEM_Ready";
$hash->{noRawInform} = 1;
$hash->{regexpClients} = ".*";
# Normal devices
$hash->{DefFn} = "FHEM2FHEM_Define";
@ -54,6 +53,7 @@ FHEM2FHEM_Define($$)
} else {
$hash->{remoteDevice} = $2;
$hash->{remoteDevice} =~ s/^://;
$hash->{regexpClients} = ".*";
}
my $dev = $a[2];