2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

74_XiaomiBTLESens: fix humidity bug

git-svn-id: https://svn.fhem.de/fhem/trunk@17828 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
LeonGaultier 2018-11-23 21:51:15 +00:00
parent 6aecce45af
commit ea5c428120
2 changed files with 3 additions and 10 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # 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: 88_HMCCU: Some minor bugs fixed
- bugfix: 42_XiaomiBTLESens: bugfix humidity reading - bugfix: 42_XiaomiBTLESens: bugfix humidity reading
- feature: 42_AptToDate: add new get command getDistribution to fetch - feature: 42_AptToDate: add new get command getDistribution to fetch

View File

@ -35,7 +35,7 @@ package main;
use strict; use strict;
use warnings; use warnings;
my $version = "2.4.5"; my $version = "2.4.6";
sub XiaomiBTLESens_Initialize($) { sub XiaomiBTLESens_Initialize($) {
@ -889,16 +889,8 @@ sub ThermoHygroSensHandle0x10($$) {
$notification =~ s/\s+//g; $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{'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, ( (scalar(@numberOfHex) == 14 or (scalar(@numberOfHex) == 13 and $readings{'temperature'} > 9)) ? 18 : 16 ), 8 ) );
#$readings{'humidity'} = pack( 'H*', substr( $notification, 18, 8 ) );
$hash->{helper}{CallBattery} = 0; $hash->{helper}{CallBattery} = 0;
return \%readings; return \%readings;