From e4016fae82fb6ef3aff7045bb6291e3718138b5e Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Thu, 25 Oct 2018 08:58:50 +0200 Subject: [PATCH] fix humidity --- 74_XiaomiBTLESens.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/74_XiaomiBTLESens.pm b/74_XiaomiBTLESens.pm index ebaea1e..4b6508f 100644 --- a/74_XiaomiBTLESens.pm +++ b/74_XiaomiBTLESens.pm @@ -35,7 +35,7 @@ package main; use strict; use warnings; -my $version = "2.4.3"; +my $version = "2.4.4"; sub XiaomiBTLESens_Initialize($) { @@ -860,7 +860,7 @@ sub ThermoHygroSensHandle0x18($$) { Log3 $name, 4, "XiaomiBTLESens ($name) - Thermo/Hygro Sens Handle0x18"; chomp($notification); - $notification =~ s/ //g; + $notification =~ s/\s+//g; ### neue Vereinheitlichung für Batteriereadings Forum #800017 $readings{'batteryPercent'} = hex( "0x" . $notification ); @@ -889,12 +889,12 @@ sub ThermoHygroSensHandle0x10($$) { $notification =~ s/\s+//g; $readings{'temperature'} = pack( 'H*', substr( $notification, 4, 8 ) ); - if ( scalar(@numberOfHex) < 14 ) { +# if ( scalar(@numberOfHex) < 14 ) { $readings{'humidity'} = pack( 'H*', substr( $notification, 18, 8 ) ); - } - else { - $readings{'humidity'} = pack( 'H*', substr( $notification, 16, 8 ) ); - } +# } +# else { +# $readings{'humidity'} = pack( 'H*', substr( $notification, 16, 8 ) ); +# } $hash->{helper}{CallBattery} = 0; return \%readings;