2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

74_XiaomiFlowerSens: fix Problems with sshHost Methode

git-svn-id: https://svn.fhem.de/fhem/trunk@15750 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
LeonGaultier 2018-01-02 10:38:42 +00:00
parent 503185ffed
commit 6d3abab701
2 changed files with 10 additions and 2 deletions

View File

@ -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.
- change: 74_XiaomiFlowerSens: fix Problems with sshHost Methode
- change: 73_GardenaSmartBridge/74_GardenaSmartDevice: add NotifyFn Support
change AttrFn Routine
- feature: 93_DbRep: V7.2.0, new attributes "seqDoubletsVariance",

View File

@ -47,7 +47,7 @@ use JSON;
use Blocking;
my $version = "1.2.4";
my $version = "1.4.0";
my %CallBatteryFirmwareAge = ( '8h' => 28800,
'16h' => 57600,
'24h' => 86400,
@ -438,6 +438,7 @@ sub XiaomiFlowerSens_ExecGatttool_Run($) {
$cmd .= "--char-write-req -a $handle -n $value" if($gattCmd eq 'write');
$cmd .= " 2>&1 /dev/null";
$cmd .= "'" if($sshHost ne 'none');
$cmd = "ssh $sshHost 'gatttool -i $hci -b $mac --char-write-req -a 0x33 -n A01F && gatttool -i $hci -b $mac --char-read -a 0x35 2>&1 /dev/null'" if($sshHost ne 'none' and $gattCmd eq 'write');
$loop = 0;
do {
@ -451,6 +452,9 @@ sub XiaomiFlowerSens_ExecGatttool_Run($) {
Log3 $name, 4, "XiaomiFlowerSens ($name) - ExecGatttool_Run: gatttool result ".join(",", @gtResult);
$handle = '0x35' if($sshHost ne 'none' and $gattCmd eq 'write');
$gattCmd = 'read' if($sshHost ne 'none' and $gattCmd eq 'write');
$gtResult[1] = 'no data response'
unless( defined($gtResult[1]) );
@ -663,7 +667,10 @@ sub XiaomiFlowerSens_ProcessingErrors($$) {
sub XiaomiFlowerSens_encodeJSON($) {
my $gtResult = shift;
chomp($gtResult);
my %response = (
'gtResult' => $gtResult
);