From ea5c428120e2c1ac51179e1ebc6d927fe4d657be Mon Sep 17 00:00:00 2001 From: LeonGaultier Date: Fri, 23 Nov 2018 21:51:15 +0000 Subject: [PATCH] 74_XiaomiBTLESens: fix humidity bug git-svn-id: https://svn.fhem.de/fhem/trunk@17828 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/74_XiaomiBTLESens.pm | 12 ++---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 7ad3927bd..f8916669c 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 74_XiaomiBTLESens: fix humidity bug - bugfix: 88_HMCCU: Some minor bugs fixed - bugfix: 42_XiaomiBTLESens: bugfix humidity reading - feature: 42_AptToDate: add new get command getDistribution to fetch diff --git a/fhem/FHEM/74_XiaomiBTLESens.pm b/fhem/FHEM/74_XiaomiBTLESens.pm index 3c4e25873..90ba203cd 100644 --- a/fhem/FHEM/74_XiaomiBTLESens.pm +++ b/fhem/FHEM/74_XiaomiBTLESens.pm @@ -35,7 +35,7 @@ package main; use strict; use warnings; -my $version = "2.4.5"; +my $version = "2.4.6"; sub XiaomiBTLESens_Initialize($) { @@ -889,16 +889,8 @@ sub ThermoHygroSensHandle0x10($$) { $notification =~ s/\s+//g; -# print "Temperatur: " . pack( 'H*', substr( $notification, 4, 8 ) ) . "\n"; -# -# -# print "Luftfeuchte: " . pack( 'H*', substr( $notification, 16, 8 ) ) . "\n" if ( scalar(@numberOfHex) == 13 and pack( 'H*', substr( $notification, 4, 8 ) ) < 10); -# -# print "Luftfeuchte: " . pack( 'H*', substr( $notification, 18, 8 ) ) . "\n" if ( scalar(@numberOfHex) == 14 or (scalar(@numberOfHex) == 13 and pack( 'H*', substr( $notification, 4, 8 ) )) > 9); - $readings{'temperature'} = pack( 'H*', substr( $notification, 4, 8 ) ); - $readings{'humidity'} = pack( 'H*', substr( $notification, (scalar(@numberOfHex) == 14 or (scalar(@numberOfHex) == 13 and $readings{'temperature'} > 9) ? 18 : 16), 8 ) ); - #$readings{'humidity'} = pack( 'H*', substr( $notification, 18, 8 ) ); + $readings{'humidity'} = pack( 'H*', substr( $notification, ( (scalar(@numberOfHex) == 14 or (scalar(@numberOfHex) == 13 and $readings{'temperature'} > 9)) ? 18 : 16 ), 8 ) ); $hash->{helper}{CallBattery} = 0; return \%readings;