10_ZWAve.pm: ignore extra length for THERMOSTAT_SETPOINT (Forum #142142)
git-svn-id: https://svn.fhem.de/fhem/trunk@30158 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -1626,12 +1626,12 @@ ZWave_thermostatSetpointParse ($$)
|
||||
my $scale = (((hex($2) & 0x18)>>3) == 1) ? "F": "C";
|
||||
my $size = (hex($2) & 0x07);
|
||||
|
||||
if (length($3) != $size*2) {
|
||||
if (length($3) < $size*2) {
|
||||
Log3 $name, 1, "$name: THERMOSTAT_SETPOINT_REPORT "
|
||||
."wrong number of bytes received";
|
||||
return;
|
||||
}
|
||||
my $sp = hex($3);
|
||||
my $sp = hex(substr($3, 0, $size*2)); # 142142
|
||||
$sp -= (2 ** ($size*8)) if $sp >= (2 ** ($size*8-1));
|
||||
$sp = $sp / (10 ** $prec);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user