mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
30_pilight_contact: fix protocols without id
git-svn-id: https://svn.fhem.de/fhem/trunk@12587 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c9079f812f
commit
77ce2cea51
@ -814,6 +814,9 @@ sub pilight_ctrl_Parse($$)
|
|||||||
readingsBulkUpdate($hash,"rcv_raw",$rmsg);
|
readingsBulkUpdate($hash,"rcv_raw",$rmsg);
|
||||||
readingsEndUpdate($hash, 1);
|
readingsEndUpdate($hash, 1);
|
||||||
|
|
||||||
|
# some protocols have no id but unit(code) e.q. ev1527
|
||||||
|
$id = $unit if ($id eq "" && $unit ne "");
|
||||||
|
|
||||||
$unit = "all" if ($unit eq "" && $all ne "");
|
$unit = "all" if ($unit eq "" && $all ne "");
|
||||||
|
|
||||||
my $protoID = -1;
|
my $protoID = -1;
|
||||||
|
@ -89,7 +89,10 @@ sub pilight_contact_Parse($$)
|
|||||||
foreach my $n (keys %{ $modules{pilight_contact}{defptr}{lc($protocol)} }) {
|
foreach my $n (keys %{ $modules{pilight_contact}{defptr}{lc($protocol)} }) {
|
||||||
my $lh = $modules{pilight_contact}{defptr}{$protocol}{$n};
|
my $lh = $modules{pilight_contact}{defptr}{$protocol}{$n};
|
||||||
next if ( !defined($lh->{ID}) );
|
next if ( !defined($lh->{ID}) );
|
||||||
if ($lh->{ID} eq $id && $lh->{UNIT} eq $unit) {
|
if ($lh->{ID} eq $id) {
|
||||||
|
if (defined($lh->{UNIT})) {
|
||||||
|
next if ($lh->{UNIT} ne $unit);
|
||||||
|
}
|
||||||
$chash = $lh;
|
$chash = $lh;
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user