mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
fixed order of truncaton
git-svn-id: https://svn.fhem.de/fhem/trunk@4365 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
67bae8b846
commit
18823105ed
@ -179,9 +179,6 @@ LaCrosse_Parse($$)
|
||||
if( my $resolution = AttrVal( $rname, "resolution", 0 ) ) {
|
||||
$temperature = int($temperature*10 / $resolution + 0.5) * $resolution / 10;
|
||||
$humidity = int($humidity / $resolution + 0.5) * $resolution;
|
||||
|
||||
$temperature = int($temperature*10 + 0.5) / 10;
|
||||
$humidity = int($humidity + 0.5) / 10;
|
||||
}
|
||||
|
||||
if( AttrVal( $rname, "doAverage", 0 ) ) {
|
||||
@ -195,9 +192,6 @@ LaCrosse_Parse($$)
|
||||
|
||||
readingsBeginUpdate($rhash);
|
||||
|
||||
readingsBulkUpdate($rhash, "temperature$channel", $temperature);
|
||||
readingsBulkUpdate($rhash, "humidity$channel", $humidity) if( $humidity && $humidity <= 99 );
|
||||
|
||||
my $dewpoint;
|
||||
if( AttrVal( $rname, "doDewpoint", 0 ) && $humidity && $humidity <= 99 ) {
|
||||
$dewpoint = LaCrosse_CalcDewpoint($temperature,$humidity);
|
||||
@ -205,6 +199,12 @@ LaCrosse_Parse($$)
|
||||
readingsBulkUpdate($rhash, "dewpoint$channel", $dewpoint);
|
||||
}
|
||||
|
||||
$temperature = int($temperature*10 + 0.5) / 10;
|
||||
$humidity = int($humidity + 0.5) / 10;
|
||||
|
||||
readingsBulkUpdate($rhash, "temperature$channel", $temperature);
|
||||
readingsBulkUpdate($rhash, "humidity$channel", $humidity) if( $humidity && $humidity <= 99 );
|
||||
|
||||
if( !$channel ) {
|
||||
my $state = "T: $temperature";
|
||||
$state .= " H: $humidity" if( $humidity && $humidity <= 99 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user