mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-09 20:57:11 +00:00
74_XiaomiBTLESens: fix corrupt character for temperature
git-svn-id: https://svn.fhem.de/fhem/trunk@16154 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
29ea99d96a
commit
03500cbfa3
@ -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 corrupt character for temperature
|
||||
- bugfix: 74_XiaomiBTLESens: fix humidity bug than temperature is lower 10
|
||||
- feature: 88_xs1Bridge: automatic Logfile after define | feature extension
|
||||
- changed: 98_weekprofile: send values for on/off instead of "on"/"off"
|
||||
|
@ -47,7 +47,7 @@ use JSON;
|
||||
use Blocking;
|
||||
|
||||
|
||||
my $version = "2.0.8";
|
||||
my $version = "2.0.9";
|
||||
|
||||
|
||||
|
||||
@ -409,14 +409,14 @@ sub XiaomiBTLESens_CreateParamGatttool($@) {
|
||||
Log3 $name, 4, "XiaomiBTLESens ($name) - Run CreateParamGatttool with mod: $mod";
|
||||
|
||||
if( $mod eq 'read' ) {
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("XiaomiBTLESens_ExecGatttool_Run", $name."|".$mac."|".$mod."|".$handle, "XiaomiBTLESens_ExecGatttool_Done", 60, "XiaomiBTLESens_ExecGatttool_Aborted", $hash) unless( exists($hash->{helper}{RUNNING_PID}) );
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("XiaomiBTLESens_ExecGatttool_Run", $name."|".$mac."|".$mod."|".$handle, "XiaomiBTLESens_ExecGatttool_Done", 90, "XiaomiBTLESens_ExecGatttool_Aborted", $hash) unless( exists($hash->{helper}{RUNNING_PID}) );
|
||||
|
||||
readingsSingleUpdate($hash,"state","read sensor data",1);
|
||||
|
||||
Log3 $name, 5, "XiaomiBTLESens ($name) - Read XiaomiBTLESens_ExecGatttool_Run $name|$mac|$mod|$handle";
|
||||
|
||||
} elsif( $mod eq 'write' ) {
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("XiaomiBTLESens_ExecGatttool_Run", $name."|".$mac."|".$mod."|".$handle."|".$value."|".$XiaomiModels{AttrVal($name,'model','')}{wdatalisten}, "XiaomiBTLESens_ExecGatttool_Done", 60, "XiaomiBTLESens_ExecGatttool_Aborted", $hash) unless( exists($hash->{helper}{RUNNING_PID}) );
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("XiaomiBTLESens_ExecGatttool_Run", $name."|".$mac."|".$mod."|".$handle."|".$value."|".$XiaomiModels{AttrVal($name,'model','')}{wdatalisten}, "XiaomiBTLESens_ExecGatttool_Done", 90, "XiaomiBTLESens_ExecGatttool_Aborted", $hash) unless( exists($hash->{helper}{RUNNING_PID}) );
|
||||
|
||||
readingsSingleUpdate($hash,"state","write sensor data",1);
|
||||
|
||||
@ -448,7 +448,7 @@ sub XiaomiBTLESens_ExecGatttool_Run($) {
|
||||
my $hci = AttrVal($name,"hciDevice","hci0");
|
||||
|
||||
$cmd = "ssh $sshHost '" if($sshHost ne 'none');
|
||||
$cmd .= "timeout 5 " if($listen);
|
||||
$cmd .= "timeout 10 " if($listen);
|
||||
$cmd .= "gatttool -i $hci -b $mac ";
|
||||
$cmd .= "--char-read -a $handle" if($gattCmd eq 'read');
|
||||
$cmd .= "--char-write-req -a $handle -n $value" if($gattCmd eq 'write');
|
||||
@ -707,6 +707,9 @@ sub XiaomiBTLESens_ThermoHygroSensHandle0x10($$) {
|
||||
|
||||
Log3 $name, 4, "XiaomiBTLESens ($name) - Thermo/Hygro Sens Handle0x10";
|
||||
|
||||
return XiaomiBTLESens_stateRequest($hash)
|
||||
unless($notification =~ /^([0-9a-f]{2}(\s?))*$/);
|
||||
|
||||
my @numberOfHex = split(' ',$notification);
|
||||
|
||||
$notification =~ s/\s+//g;
|
||||
|
Loading…
x
Reference in New Issue
Block a user