mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 19:32:42 +00:00
10_ZWave.pm: Handling extra bytes for the new UZB firmware (Forum #79659)
git-svn-id: https://svn.fhem.de/fhem/trunk@15445 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
cbbc6b0f60
commit
21bfd25bae
@ -1481,12 +1481,12 @@ ZWave_thermostatSetpointParse ($$)
|
|||||||
my $scale = (((hex($2) & 0x18)>>3) == 1) ? "F": "C";
|
my $scale = (((hex($2) & 0x18)>>3) == 1) ? "F": "C";
|
||||||
my $size = (hex($2) & 0x07);
|
my $size = (hex($2) & 0x07);
|
||||||
|
|
||||||
if (length($3) < $size*2) {
|
if (length($3) != $size*2) {
|
||||||
Log3 $name, 1, "$name: THERMOSTAT_SETPOINT_REPORT "
|
Log3 $name, 1, "$name: THERMOSTAT_SETPOINT_REPORT "
|
||||||
."wrong number of bytes received";
|
."wrong number of bytes received";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
my $sp = hex(substr($3,0,$size*2)); # 79659
|
my $sp = hex($3);
|
||||||
$sp -= (2 ** ($size*8)) if $sp >= (2 ** ($size*8-1));
|
$sp -= (2 ** ($size*8)) if $sp >= (2 ** ($size*8-1));
|
||||||
$sp = $sp / (10 ** $prec);
|
$sp = $sp / (10 ** $prec);
|
||||||
|
|
||||||
@ -4821,6 +4821,16 @@ ZWave_Parse($$@)
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($arg =~ m/^(..)(.*)/) {
|
||||||
|
my $l1 = hex($1);
|
||||||
|
my $l2 = length($2)/2;
|
||||||
|
if($l1 > $l2) {
|
||||||
|
Log3 $ioName, $2, "Packet with short length ($arg)";
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
$arg = substr($arg, 0, ($l1+1)*2) if($l1 < $l2); #79659
|
||||||
|
}
|
||||||
|
|
||||||
if($arg =~ m/^(..)(..)(.*)/ && $2 eq "c6") { # Danfoss Living Strangeness
|
if($arg =~ m/^(..)(..)(.*)/ && $2 eq "c6") { # Danfoss Living Strangeness
|
||||||
Log3 $ioName, 4, "Class mod for Danfoss ($2)";
|
Log3 $ioName, 4, "Class mod for Danfoss ($2)";
|
||||||
$arg = sprintf("%s%02x%s", $1, hex($2) & 0x7f, $3);
|
$arg = sprintf("%s%02x%s", $1, hex($2) & 0x7f, $3);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user