From a804ee02aa5bf7785f826d4b32b634396b7653c1 Mon Sep 17 00:00:00 2001 From: justme1968 Date: Thu, 12 Dec 2013 09:05:37 +0000 Subject: [PATCH] fixed order of truncaton git-svn-id: https://svn.fhem.de/fhem/trunk@4365 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/36_LaCrosse.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fhem/FHEM/36_LaCrosse.pm b/fhem/FHEM/36_LaCrosse.pm index 351b8a9ac..8610224cc 100644 --- a/fhem/FHEM/36_LaCrosse.pm +++ b/fhem/FHEM/36_LaCrosse.pm @@ -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 );