mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
Dispatch changed to make RSSI available in notify
git-svn-id: https://svn.fhem.de/fhem/trunk@471 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2b1e107d83
commit
7056e7a7b5
@ -671,7 +671,7 @@ CM11_Read($)
|
|||||||
$hu= "" unless(defined($hu));
|
$hu= "" unless(defined($hu));
|
||||||
my $hf = $hash->{$housecode_func};
|
my $hf = $hash->{$housecode_func};
|
||||||
my $dmsg= "X10:$housecode;$hu;$hf";
|
my $dmsg= "X10:$housecode;$hu;$hf";
|
||||||
Dispatch($hash, $dmsg);
|
Dispatch($hash, $dmsg, undef);
|
||||||
} else {
|
} else {
|
||||||
# data byte is unitcode
|
# data byte is unitcode
|
||||||
# if a command was executed before, clear unitcode list
|
# if a command was executed before, clear unitcode list
|
||||||
|
@ -761,17 +761,13 @@ CUL_Read($)
|
|||||||
goto NEXTMSG;
|
goto NEXTMSG;
|
||||||
}
|
}
|
||||||
|
|
||||||
$hash->{RSSI} = $rssi if(defined($rssi));
|
|
||||||
$hash->{RAWMSG} = $rmsg;
|
$hash->{RAWMSG} = $rmsg;
|
||||||
my $foundp = Dispatch($hash, $dmsg);
|
my %addvals = (RAWMSG => $rmsg);
|
||||||
if($foundp) {
|
if(defined($rssi)) {
|
||||||
foreach my $d (@{$foundp}) {
|
$hash->{RSSI} = $rssi;
|
||||||
next if(!$defs{$d});
|
$addvals{RSSI} = $rssi;
|
||||||
$defs{$d}{"RSSI_$name"} = $rssi if($rssi);
|
|
||||||
$defs{$d}{RAWMSG} = $rmsg;
|
|
||||||
$defs{$d}{"MSGCNT_$name"}++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Dispatch($hash, $dmsg, \%addvals);
|
||||||
|
|
||||||
NEXTMSG:
|
NEXTMSG:
|
||||||
}
|
}
|
||||||
|
@ -694,14 +694,8 @@ FHZ_Read($)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$hash->{RAWMSG} = $dmsg;
|
$hash->{RAWMSG} = $dmsg;
|
||||||
my $foundp = Dispatch($hash, $dmsg);
|
my %addvals = (RAWMSG => $rmsg);
|
||||||
if($foundp) {
|
my $foundp = Dispatch($hash, $dmsg, \%addvals);
|
||||||
foreach my $d (@{$foundp}) {
|
|
||||||
next if(!$defs{$d});
|
|
||||||
$defs{$d}{RAWMSG} = $dmsg;
|
|
||||||
$defs{$d}{"MSGCNT_$name"}++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$fhzdata = substr($fhzdata, $len);
|
$fhzdata = substr($fhzdata, $len);
|
||||||
|
|
||||||
|
18
fhem/fhem.pl
18
fhem/fhem.pl
@ -48,7 +48,7 @@ sub CallFn(@);
|
|||||||
sub CommandChain($$);
|
sub CommandChain($$);
|
||||||
sub CheckDuplicate($$);
|
sub CheckDuplicate($$);
|
||||||
sub DoClose($);
|
sub DoClose($);
|
||||||
sub Dispatch($$);
|
sub Dispatch($$$);
|
||||||
sub FmtDateTime($);
|
sub FmtDateTime($);
|
||||||
sub FmtTime($);
|
sub FmtTime($);
|
||||||
sub GetLogLevel(@);
|
sub GetLogLevel(@);
|
||||||
@ -155,7 +155,7 @@ my $nextat; # Time when next timer will be triggered.
|
|||||||
my $intAtCnt=0;
|
my $intAtCnt=0;
|
||||||
my %duplicate; # Pool of received msg for multi-fhz/cul setups
|
my %duplicate; # Pool of received msg for multi-fhz/cul setups
|
||||||
my $duplidx=0; # helper for the above pool
|
my $duplidx=0; # helper for the above pool
|
||||||
my $cvsid = '$Id: fhem.pl,v 1.82 2009-11-12 19:08:00 rudolfkoenig Exp $';
|
my $cvsid = '$Id: fhem.pl,v 1.83 2009-11-14 09:20:37 rudolfkoenig Exp $';
|
||||||
my $namedef =
|
my $namedef =
|
||||||
"where <name> is either:\n" .
|
"where <name> is either:\n" .
|
||||||
"- a single device name\n" .
|
"- a single device name\n" .
|
||||||
@ -2037,9 +2037,9 @@ HandleArchiving($)
|
|||||||
# Call a logical device (FS20) ParseMessage with data from a physical device
|
# Call a logical device (FS20) ParseMessage with data from a physical device
|
||||||
# (FHZ)
|
# (FHZ)
|
||||||
sub
|
sub
|
||||||
Dispatch($$)
|
Dispatch($$$)
|
||||||
{
|
{
|
||||||
my ($hash, $dmsg) = @_;
|
my ($hash, $dmsg, $addvals) = @_;
|
||||||
my $iohash = $modules{$hash->{TYPE}}; # The phyiscal device module pointer
|
my $iohash = $modules{$hash->{TYPE}}; # The phyiscal device module pointer
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
@ -2093,9 +2093,19 @@ Dispatch($$)
|
|||||||
CommandDelete(undef, $d); # Remove the device
|
CommandDelete(undef, $d); # Remove the device
|
||||||
return undef;
|
return undef;
|
||||||
} else {
|
} else {
|
||||||
|
if($defs{$found}) {
|
||||||
|
if($addvals) {
|
||||||
|
foreach my $av (keys %{$addvals}) {
|
||||||
|
$defs{$found}{"${name}_$av"} = $addvals->{$av};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$defs{$found}{"${name}_MSGCNT"}++;
|
||||||
|
$defs{$found}{LASTIODev} = $name;
|
||||||
|
}
|
||||||
DoTrigger($found, undef);
|
DoTrigger($found, undef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$duplicate{$idx}{FND} = \@found;
|
$duplicate{$idx}{FND} = \@found;
|
||||||
|
|
||||||
return \@found;
|
return \@found;
|
||||||
|
Loading…
Reference in New Issue
Block a user