2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 04:36:02 +00:00

10_ZWave.pm: revert previous patch, proposing a new one (Forum #79659)

git-svn-id: https://svn.fhem.de/fhem/trunk@15440 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-11-17 10:57:56 +00:00
parent ebaf24f8d1
commit 5d94b511b9

View File

@ -1481,12 +1481,13 @@ ZWave_thermostatSetpointParse ($$)
my $scale = (((hex($2) & 0x18)>>3) == 1) ? "F": "C";
my $size = (hex($2) & 0x07);
my $sp = hex($3);
if(length($3) != $size*2) {
$sp = ($sp & 0xfff0000) >> 16; #79659, Temporary?
} else {
$sp -= (2 ** ($size*8)) if($sp >= (2 ** ($size*8-1)));
if (length($3) < $size*2) {
Log3 $name, 1, "$name: THERMOSTAT_SETPOINT_REPORT "
."wrong number of bytes received";
return;
}
my $sp = hex(substr($3,0,$size*2)); # 79659
$sp -= (2 ** ($size*8)) if $sp >= (2 ** ($size*8-1));
$sp = $sp / (10 ** $prec);
# output temperature with variable decimals as reported (according to $prec)