Skip to content

Commit 2493170

Browse files
committed
14_SD_Keeloq.pm - fix WARNINGS
* fix uninitialized value WARNINGS #20 (comment)
1 parent ed4cdf1 commit 2493170

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

FHEM/14_SD_Keeloq.pm

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use warnings;
2222
use POSIX;
2323
use Data::Dumper qw (Dumper);
2424

25-
our $VERSION = '2021-01-13';
25+
our $VERSION = '2021-01-18';
2626

2727
my %models = (
2828
'enjoy_motors_HS' => { Button => { 'stop' => '1000',
@@ -672,11 +672,14 @@ sub Set($$$@) {
672672
Log3 $name, 5, "$ioname: SD_Keeloq_Set - Counter = $counter_send";
673673
Log3 $name, 5, "$ioname: SD_Keeloq_Set - encoded (encrypt) = ".sprintf("%032b", $encoded)."\n";
674674

675-
my $binsplit = SD_Keeloq_binsplit_JaroLift($bits) if (AttrVal($name, "verbose", "3") eq "5");
676-
677675
Log3 $name, 5, "$ioname: SD_Keeloq_Set encoded <- | -> decrypts";
678676
Log3 $name, 5, "$ioname: SD_Keeloq_Set Grp 0-7 |digitS/N| counter | ch | serial | bt |Grp 8-15";
679-
Log3 $name, 5, "$ioname: SD_Keeloq_Set - bits (send split) = $binsplit";
677+
678+
if (AttrVal($name, "verbose", "3") eq "5") {
679+
my $binsplit = SD_Keeloq_binsplit_JaroLift($bits);
680+
Log3 $name, 5, "$ioname: SD_Keeloq_Set - bits (send split) = $binsplit";
681+
}
682+
680683
Log3 $name, 5, "$ioname: SD_Keeloq_Set - bits (send) = $bits";
681684
Log3 $name, 4, "$ioname: SD_Keeloq_Set - sendMSG = $msg";
682685
Log3 $name, 4, "######## DEBUG SET - END ########";
@@ -980,12 +983,15 @@ sub Parse($$) {
980983
($bit8to15) = @_ = ( reverse (substr ($bitData , 8 , 8)) , "encrypted" )[$encrypted]; # without MasterMSB | MasterLSB encrypted
981984
$bit64to71 = reverse (substr ($bitData , 64 , 8));
982985

983-
$binsplit = SD_Keeloq_binsplit_JaroLift($bitData) if (AttrVal($name, "verbose", "3") eq "5");
984-
985986
Log3 $name, 5, "$ioname: SD_Keeloq_Parse - typ = $model";
986987
Log3 $name, 5, "$ioname: SD_Keeloq_Parse encoded <- | -> decrypts";
987988
Log3 $name, 5, "$ioname: SD_Keeloq_Parse Grp 0-7 |digitS/N| counter | ch | serial | bt |Grp 8-15";
988-
Log3 $name, 5, "$ioname: SD_Keeloq_Parse - bitData = $binsplit";
989+
990+
if (AttrVal($name, "verbose", "3") eq "5") {
991+
$binsplit = SD_Keeloq_binsplit_JaroLift($bitData);
992+
Log3 $name, 5, "$ioname: SD_Keeloq_Parse - bitData = $binsplit";
993+
}
994+
989995
Log3 $name, 5, "$ioname: SD_Keeloq_Parse - bitData = |-> must be calculated! <-| ".reverse (substr ($bitData , 32 , 4)) ." ". reverse (substr ($bitData , 36 , 24)) ." ".$button ." ". $bit64to71;
990996

991997
my @groups8_15 = split //, reverse $bit64to71;

0 commit comments

Comments
 (0)