From 56c5b5aa68fbaccb23e5648d7c0eb8267e9b16b2 Mon Sep 17 00:00:00 2001
From: Marko Oldenburg <leongaultier@gmail.com>
Date: Mon, 5 Feb 2018 09:07:31 +0100
Subject: [PATCH] change [1] for

---
 74_XiaomiBTLESens.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/74_XiaomiBTLESens.pm b/74_XiaomiBTLESens.pm
index 752bf65..6b880ea 100644
--- a/74_XiaomiBTLESens.pm
+++ b/74_XiaomiBTLESens.pm
@@ -47,7 +47,7 @@ use JSON;
 use Blocking;
 
 
-my $version = "2.0.6debug7";
+my $version = "2.0.6debug10";
 
 
 
@@ -474,11 +474,13 @@ sub XiaomiBTLESens_ExecGatttool_Run($) {
         do {
             
             Log3 $name, 5, "XiaomiBTLESens ($name) - ExecGatttool_Run: call gatttool with command $cmd and loop $loop";
-            @gtResult = split(": ",qx($cmd)) unless( AttrVal($name,"model","none") eq 'thermoHygroSens' and $gattCmd eq 'write' and $handle eq '0x10');
-            @gtResult = split(",",qx($cmd)) if( AttrVal($name,"model","none") eq 'thermoHygroSens' and $gattCmd eq 'write' and $handle eq '0x10');
+            @gtResult = split(": ",qx($cmd)); # unless( AttrVal($name,"model","none") eq 'thermoHygroSens' and $gattCmd eq 'write' and $handle eq '0x10');
+            #@gtResult = split(",",qx($cmd)) if( AttrVal($name,"model","none") eq 'thermoHygroSens' and $gattCmd eq 'write' and $handle eq '0x10');
             Log3 $name, 5, "XiaomiBTLESens ($name) - ExecGatttool_Run: gatttool loop result ".join(",", @gtResult);
             $loop++;
             
+            $gtResult[1] = split("\n",$gtResult[1]) if( AttrVal($name,"model","none") eq 'thermoHygroSens' and $gattCmd eq 'write' and $handle eq '0x10');
+            
             $gtResult[0] = 'connect error'
             unless( defined($gtResult[0]) );