From 1ec69459a51a880155551e85c197afcbcbe44e5c Mon Sep 17 00:00:00 2001 From: moises <> Date: Fri, 5 Oct 2018 22:29:21 +0000 Subject: [PATCH] 72_XiaomiDevice: set incorrect fan speed to 0 git-svn-id: https://svn.fhem.de/fhem/trunk@17464 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/72_XiaomiDevice.pm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 18569f2c2..b0f4fd8ef 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: 72_XiaomiDevice: set incorrect fan speed to 0 - bugfix: 38_netatmo: increased timeouts to counter server issues, logging - bugfix: 88_HMCCU: Detection of non standard addresses - feature: 93_Log2Syslog: TCP-Server in Collector-mode / SSL-support and a diff --git a/fhem/FHEM/72_XiaomiDevice.pm b/fhem/FHEM/72_XiaomiDevice.pm index 5aeceb59f..ef22f89e5 100755 --- a/fhem/FHEM/72_XiaomiDevice.pm +++ b/fhem/FHEM/72_XiaomiDevice.pm @@ -2158,7 +2158,7 @@ sub XiaomiDevice_ParseJSON($$) readingsBulkUpdate( $hash, "child_lock", $json->{result}[11], 1 ) if(defined($json->{result}[11])); readingsBulkUpdate( $hash, "temperature", $json->{result}[12]/10, 1 ) if(defined($json->{result}[12]) && $json->{result}[12] ne "null"); readingsBulkUpdate( $hash, "humidity", $json->{result}[13], 1 ) if(defined($json->{result}[13]) && $json->{result}[13] ne "null"); - readingsBulkUpdate( $hash, "speed", $json->{result}[14], 1 ) if(defined($json->{result}[14])); + readingsBulkUpdate( $hash, "speed", (($json->{result}[2] eq "off")?"0":$json->{result}[14]), 1 ) if(defined($json->{result}[14])); readingsBulkUpdate( $hash, "button_pressed", $json->{result}[15], 1 ) if(defined($json->{result}[15]) && $json->{result}[15] ne "null"); readingsEndUpdate($hash,1); return undef; @@ -2176,7 +2176,7 @@ sub XiaomiDevice_ParseJSON($$) $fanspeed = 0 if($json->{result}[0] eq "off"); readingsBulkUpdate( $hash, "level", $fanspeed, 1 ) if(defined($json->{result}[2])); readingsBulkUpdate( $hash, "mode", (int($json->{result}[2])>0)?"natural":"straight", 1 ) if(defined($json->{result}[2])); - readingsBulkUpdate( $hash, "speed", $json->{result}[3], 1 ) if(defined($json->{result}[3])); + readingsBulkUpdate( $hash, "speed", (($json->{result}[0] eq "off")?"0":$json->{result}[3]), 1 ) if(defined($json->{result}[3])); readingsEndUpdate($hash,1); return undef; }