From bdf2369bdb91bb2a22d620affedcb7c87268a16c Mon Sep 17 00:00:00 2001 From: Udo Date: Mon, 7 Mar 2022 17:35:38 +0100 Subject: [PATCH 1/2] WS2000 - prevents perl warning --- FHEM/lib/SD_ProtocolData.pm | 1 + FHEM/lib/SD_Protocols.pm | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/FHEM/lib/SD_ProtocolData.pm b/FHEM/lib/SD_ProtocolData.pm index 97c669618..a615ac1ae 100644 --- a/FHEM/lib/SD_ProtocolData.pm +++ b/FHEM/lib/SD_ProtocolData.pm @@ -1739,6 +1739,7 @@ package lib::SD_ProtocolData; one => [3,-7], zero => [7,-3], clockabs => 122, + reconstructBit => '1', preamble => 'K', postamble => '', clientmodule => 'CUL_WS', diff --git a/FHEM/lib/SD_Protocols.pm b/FHEM/lib/SD_Protocols.pm index 8d51e6981..6ad29e790 100644 --- a/FHEM/lib/SD_Protocols.pm +++ b/FHEM/lib/SD_Protocols.pm @@ -1433,6 +1433,11 @@ sub postDemo_WS2000 { return (0, undef); } $dataindex = $index + $datastart + 1; + my $rest = $protolength - $dataindex; + if ($rest < 4) { + $self->_logging(qq[lib/postDemo_WS2000, Sensortyp $typ - ERROR rest of message < 4 ($rest)],4); + return (0, undef); + } $data = oct( '0b'.(join '', reverse @bit_msg[$dataindex .. $dataindex + 3])); if ($index == 5) {$adr = ($data & 0x07)} # Sensoradresse if ($datalength == 45 || $datalength == 46) { # Typ 1 ohne Summe From c65c746db16733edad94d3814a12b76103b24962 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 7 Mar 2022 16:36:19 +0000 Subject: [PATCH 2/2] Automatic updated controls and CHANGED --- controls_signalduino.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controls_signalduino.txt b/controls_signalduino.txt index 76f92a9da..e746b43a2 100644 --- a/controls_signalduino.txt +++ b/controls_signalduino.txt @@ -14,5 +14,5 @@ UPD 2021-08-11_21:38:30 35313 FHEM/14_SD_WS09.pm UPD 2020-04-13_23:15:56 14325 FHEM/14_SD_WS_Maverick.pm UPD 2021-08-11_21:38:30 37904 FHEM/41_OREGON.pm UPD 2020-12-17_23:16:30 15582 FHEM/90_SIGNALduino_un.pm -UPD 2022-03-06_20:47:38 228506 FHEM/lib/SD_ProtocolData.pm -UPD 2022-02-02_17:39:43 75787 FHEM/lib/SD_Protocols.pm +UPD 2022-03-07_17:35:38 228539 FHEM/lib/SD_ProtocolData.pm +UPD 2022-03-07_17:35:38 75991 FHEM/lib/SD_Protocols.pm