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));
|
||||
my $hf = $hash->{$housecode_func};
|
||||
my $dmsg= "X10:$housecode;$hu;$hf";
|
||||
Dispatch($hash, $dmsg);
|
||||
Dispatch($hash, $dmsg, undef);
|
||||
} else {
|
||||
# data byte is unitcode
|
||||
# if a command was executed before, clear unitcode list
|
||||
|
@ -761,17 +761,13 @@ CUL_Read($)
|
||||
goto NEXTMSG;
|
||||
}
|
||||
|
||||
$hash->{RSSI} = $rssi if(defined($rssi));
|
||||
$hash->{RAWMSG} = $rmsg;
|
||||
my $foundp = Dispatch($hash, $dmsg);
|
||||
if($foundp) {
|
||||
foreach my $d (@{$foundp}) {
|
||||
next if(!$defs{$d});
|
||||
$defs{$d}{"RSSI_$name"} = $rssi if($rssi);
|
||||
$defs{$d}{RAWMSG} = $rmsg;
|
||||
$defs{$d}{"MSGCNT_$name"}++;
|
||||
}
|
||||
my %addvals = (RAWMSG => $rmsg);
|
||||
if(defined($rssi)) {
|
||||
$hash->{RSSI} = $rssi;
|
||||
$addvals{RSSI} = $rssi;
|
||||
}
|
||||
Dispatch($hash, $dmsg, \%addvals);
|
||||
|
||||
NEXTMSG:
|
||||
}
|
||||
|
@ -694,14 +694,8 @@ FHZ_Read($)
|
||||
}
|
||||
|
||||
$hash->{RAWMSG} = $dmsg;
|
||||
my $foundp = Dispatch($hash, $dmsg);
|
||||
if($foundp) {
|
||||
foreach my $d (@{$foundp}) {
|
||||
next if(!$defs{$d});
|
||||
$defs{$d}{RAWMSG} = $dmsg;
|
||||
$defs{$d}{"MSGCNT_$name"}++;
|
||||
}
|
||||
}
|
||||
my %addvals = (RAWMSG => $rmsg);
|
||||
my $foundp = Dispatch($hash, $dmsg, \%addvals);
|
||||
|
||||
$fhzdata = substr($fhzdata, $len);
|
||||
|
||||
|
18
fhem/fhem.pl
18
fhem/fhem.pl
@ -48,7 +48,7 @@ sub CallFn(@);
|
||||
sub CommandChain($$);
|
||||
sub CheckDuplicate($$);
|
||||
sub DoClose($);
|
||||
sub Dispatch($$);
|
||||
sub Dispatch($$$);
|
||||
sub FmtDateTime($);
|
||||
sub FmtTime($);
|
||||
sub GetLogLevel(@);
|
||||
@ -155,7 +155,7 @@ my $nextat; # Time when next timer will be triggered.
|
||||
my $intAtCnt=0;
|
||||
my %duplicate; # Pool of received msg for multi-fhz/cul setups
|
||||
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 =
|
||||
"where <name> is either:\n" .
|
||||
"- a single device name\n" .
|
||||
@ -2037,9 +2037,9 @@ HandleArchiving($)
|
||||
# Call a logical device (FS20) ParseMessage with data from a physical device
|
||||
# (FHZ)
|
||||
sub
|
||||
Dispatch($$)
|
||||
Dispatch($$$)
|
||||
{
|
||||
my ($hash, $dmsg) = @_;
|
||||
my ($hash, $dmsg, $addvals) = @_;
|
||||
my $iohash = $modules{$hash->{TYPE}}; # The phyiscal device module pointer
|
||||
my $name = $hash->{NAME};
|
||||
|
||||
@ -2093,9 +2093,19 @@ Dispatch($$)
|
||||
CommandDelete(undef, $d); # Remove the device
|
||||
return undef;
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
$duplicate{$idx}{FND} = \@found;
|
||||
|
||||
return \@found;
|
||||
|
Loading…
Reference in New Issue
Block a user