Skip to content

Commit

Permalink
Merge branch 'master' into fix-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sidey79 committed Aug 14, 2021
2 parents 823ff5f + 32f966a commit dd030c2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
10 changes: 10 additions & 0 deletions CHANGED
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2021-08-14 - SIGNALduino_calcRSSI check input parameter (#1007)

* 02_SIGNALduino_calcRSSI.t:

- Test extended
- Bug reproduced

* 00_SIGNALduino.pm

- SIGNALduino_calcRSSI Check input parameters
2021-08-13 - Fixes perlcritic return undef in 14_SD_WS (#1006)
2021-08-11 - Fixes perlcritic return undef; (#979)

Expand Down
6 changes: 3 additions & 3 deletions FHEM/00_SIGNALduino.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $Id: 00_SIGNALduino.pm v3.5.2 2021-08-08 16:56:40Z HomeAutoUser $
# $Id: 00_SIGNALduino.pm v3.5.2 2021-08-13 20:19:26Z sidey79 $
#
# v3.5.2 - https://github.com/RFD-FHEM/RFFHEM/tree/master
# The module is inspired by the FHEMduino project and modified in serval ways for processing the incoming messages
Expand Down Expand Up @@ -39,7 +39,7 @@ use List::Util qw(first);


use constant {
SDUINO_VERSION => '3.5.2+20210808', # Datum wird automatisch bei jedem pull request aktualisiert
SDUINO_VERSION => '3.5.2+20210813', # Datum wird automatisch bei jedem pull request aktualisiert
SDUINO_INIT_WAIT_XQ => 1.5, # wait disable device
SDUINO_INIT_WAIT => 2,
SDUINO_INIT_MAXRETRY => 3,
Expand Down Expand Up @@ -2292,7 +2292,7 @@ sub SIGNALduino_moduleMatch {
############################# package main, test exists
# calculated RSSI and RSSI value and RSSI string (-77,'RSSI = -77')
sub SIGNALduino_calcRSSI {
my $rssi = shift;
my $rssi = shift // return ;
my $rssiStr = '';
$rssi = ($rssi>=128 ? (($rssi-256)/2-74) : ($rssi/2-74));
$rssiStr = "RSSI = $rssi";
Expand Down
2 changes: 1 addition & 1 deletion controls_signalduino.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
UPD 2021-08-08_19:14:43 228763 FHEM/00_SIGNALduino.pm
UPD 2021-08-14_10:14:35 228769 FHEM/00_SIGNALduino.pm
UPD 2020-06-15_17:41:39 17876 FHEM/10_FS10.pm
UPD 2020-05-26_11:51:12 20465 FHEM/10_SD_GT.pm
UPD 2021-08-11_21:38:30 10096 FHEM/14_BresserTemeo.pm
Expand Down
12 changes: 11 additions & 1 deletion t/FHEM/00_SIGNALduino/02_SIGNALduino_calcRSSI.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Test2::Tools::Compare qw{is};
our %defs;

InternalTimer(time()+1, sub {
plan(2);
plan(3);
my $targetHash = $defs{dummyDuino};

subtest 'Test SIGNALduino_calcRSSI with fixed values' => sub {
Expand Down Expand Up @@ -48,6 +48,16 @@ InternalTimer(time()+1, sub {
is($rssi,-36.5,'check return value -36.5 for input '.$signal_parts{rssi});
is($rssiStr,'RSSI = -36.5','check return string RSSI = -36.5 for input '.$signal_parts{rssi});
};


subtest 'Test SIGNALduino_calcRSSI with undef' => sub {
plan(2);

my ($rssi,$rssiStr)=SIGNALduino_calcRSSI(undef);
is($rssi,undef,'check if return is undef');
is($rssiStr,undef,'check if return is undef');
};

exit(0);

}, 0);
Expand Down

0 comments on commit dd030c2

Please sign in to comment.