mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-12 22:56:34 +00:00
fhem.pl: some more cautinary changes (Forum #57806)
git-svn-id: https://svn.fhem.de/fhem/trunk@14270 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1b018ea058
commit
a49c9cade6
15
fhem/fhem.pl
15
fhem/fhem.pl
@ -3597,7 +3597,8 @@ Dispatch($$$)
|
||||
}
|
||||
|
||||
if(!int(@found) || !defined($found[0])) {
|
||||
my $h = $hash->{MatchList}; $h = $module->{MatchList} if(!$h);
|
||||
my $h = $hash->{MatchList};
|
||||
$h = $module->{MatchList} if(!$h);
|
||||
if(defined($h)) {
|
||||
foreach my $m (sort keys %{$h}) {
|
||||
if($dmsg =~ m/$h->{$m}/) {
|
||||
@ -3808,8 +3809,8 @@ ReplaceEventMap($$$)
|
||||
map { $_ =~ s/.*?=//s; $_ =~ s/.*?://s; "$_:noArg" } @emList);
|
||||
}
|
||||
|
||||
my $dname = shift @{$str} if(!$dir);
|
||||
my $nstr;
|
||||
my ($dname, $nstr);
|
||||
$dname = shift @{$str} if(!$dir);
|
||||
$nstr = join(" ", @{$str}) if(!$dir);
|
||||
|
||||
my $changed;
|
||||
@ -4237,14 +4238,16 @@ readingsEndUpdate($$)
|
||||
} elsif($modifier eq "difference") {
|
||||
$result= $value - $oldvalue if(defined($oldvalue));
|
||||
} elsif($modifier eq "differential") {
|
||||
my $deltav= $value - $oldvalue if(defined($oldvalue));
|
||||
my $deltat= $hash->{".updateTime"} - $oldt if(defined($oldt));
|
||||
my ($deltav, $deltat);
|
||||
$deltav = $value - $oldvalue if(defined($oldvalue));
|
||||
$deltat = $hash->{".updateTime"} - $oldt if(defined($oldt));
|
||||
if(defined($deltav) && defined($deltat) && ($deltat>= 1.0)) {
|
||||
$result= $deltav/$deltat;
|
||||
}
|
||||
} elsif($modifier eq "integral") {
|
||||
if(defined($oldt) && defined($oldvalue)) {
|
||||
my $deltat= $hash->{".updateTime"} - $oldt if(defined($oldt));
|
||||
my $deltat;
|
||||
$deltat = $hash->{".updateTime"} - $oldt if(defined($oldt));
|
||||
my $avgval= ($value + $oldvalue) / 2;
|
||||
$result = ReadingsVal($name,$reading,$value);
|
||||
if(defined($deltat) && $deltat>= 1.0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user