From 0414946713915fe4250685186a2e0e621eb8cf26 Mon Sep 17 00:00:00 2001 From: LeonGaultier Date: Fri, 26 Oct 2018 06:49:03 +0000 Subject: [PATCH] 74_XiaomiBTLESens : fix humidity code git-svn-id: https://svn.fhem.de/fhem/trunk@17620 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/74_XiaomiBTLESens.pm | 12 +++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 39ddd82ce..d584e2bcb 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 code - feature: 98_Verkehrsinfo.pm: add attribut disable - feature: allowed: multi-allowed changes (Forum #92423) - feature: 93_DbRep: V8.4.0, reduceLog from DbLog integrated into DbRep, diff --git a/fhem/FHEM/74_XiaomiBTLESens.pm b/fhem/FHEM/74_XiaomiBTLESens.pm index ebaea1e1d..23b693744 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.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 ); @@ -888,13 +888,7 @@ sub ThermoHygroSensHandle0x10($$) { $notification =~ s/\s+//g; $readings{'temperature'} = pack( 'H*', substr( $notification, 4, 8 ) ); - - if ( scalar(@numberOfHex) < 14 ) { - $readings{'humidity'} = pack( 'H*', substr( $notification, 18, 8 ) ); - } - else { - $readings{'humidity'} = pack( 'H*', substr( $notification, 16, 8 ) ); - } + $readings{'humidity'} = pack( 'H*', substr( $notification, 18, 8 ) ); $hash->{helper}{CallBattery} = 0; return \%readings;