mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
10_pilight_ctrl: FIX: handling ContactAsSwitch befor white list check
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@9232 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c73d6f4000
commit
58f137f146
@ -1,5 +1,5 @@
|
||||
##############################################
|
||||
# $Id: 10_pilight_ctrl.pm 1.11 2015-09-06 Risiko $
|
||||
# $Id: 10_pilight_ctrl.pm 1.12 2015-09-11 Risiko $
|
||||
#
|
||||
# Usage
|
||||
#
|
||||
@ -36,6 +36,7 @@
|
||||
# V 1.09 2015-07-21 - NEW: support submodule pilight_raw to send raw codes
|
||||
# V 1.10 2015-08-30 - NEW: support pressure, windavg, winddir, windgust from weather stations and GPIO sensors
|
||||
# V 1.11 2015-09-06 - FIX: pressure, windavg, winddir, windgust from weather stations without temperature
|
||||
# V 1.12 2015-09-11 - FIX: handling ContactAsSwitch befor white list check
|
||||
##############################################
|
||||
package main;
|
||||
|
||||
@ -752,6 +753,15 @@ sub pilight_ctrl_Parse($$)
|
||||
last if ($unit ne "");
|
||||
}
|
||||
|
||||
# handling ContactAsSwitch befor white list check
|
||||
my $asSwitch = $attr{$me}{ContactAsSwitch};
|
||||
if ( defined($asSwitch) && $proto =~ /contact/ && $asSwitch =~ /$id/) {
|
||||
$proto =~ s/contact/switch/g;
|
||||
$state =~ s/opened/on/g;
|
||||
$state =~ s/closed/off/g;
|
||||
Log3 $me, 5, "$me(Parse): contact as switch for $id";
|
||||
}
|
||||
|
||||
my @ignoreIDs = split(",",AttrVal($me, "ignoreProtocol",""));
|
||||
|
||||
# white or ignore list
|
||||
@ -828,17 +838,7 @@ sub pilight_ctrl_Parse($$)
|
||||
$msg.= ",$dimlevel" if ($dimlevel ne "");
|
||||
return Dispatch($hash, $msg ,undef);
|
||||
}
|
||||
case 3 {
|
||||
my $asSwitch = $attr{$me}{ContactAsSwitch};
|
||||
if ( defined($asSwitch) && $asSwitch =~ /$id/) {
|
||||
$proto =~ s/contact/switch/g;
|
||||
$state =~ s/opened/on/g;
|
||||
$state =~ s/closed/off/g;
|
||||
Log3 $me, 5, "$me(Parse): contact as switch for $id";
|
||||
return Dispatch($hash, "PISWITCH,$proto,$id,$unit,$state",undef);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case 3 {return;}
|
||||
case 4 {
|
||||
my $piTempData = "";
|
||||
$piTempData .= ",temperature:$data->{$s}{temperature}" if (defined($data->{$s}{temperature}));
|
||||
|
Loading…
x
Reference in New Issue
Block a user