From 89d70020f3fd8b35657e4108235346dbea0d37f1 Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Mon, 11 Nov 2019 20:25:02 +0100 Subject: [PATCH 1/3] 00_SIGNALduino.pm Fix cc1101 detection Detection of cc1101 command was broken. (fixes #688) --- FHEM/00_SIGNALduino.pm | 3 +-- .../test_sub_CheckCmdResp-definition.txt | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/FHEM/00_SIGNALduino.pm b/FHEM/00_SIGNALduino.pm index 51e949d42..79eb74d82 100644 --- a/FHEM/00_SIGNALduino.pm +++ b/FHEM/00_SIGNALduino.pm @@ -1201,14 +1201,13 @@ sub SIGNALduino_CheckCmdResp($) $hash->{DevState} = 'initialized'; delete($hash->{initResetFlag}) if defined($hash->{initResetFlag}); SIGNALduino_SimpleWrite($hash, "XE"); # Enable receiver - #DevIo_SimpleWrite($hash, "XE\n",2); $hash->{logMethod}->($hash, 3, "$name/init: enable receiver (XE)"); delete($hash->{initretry}); # initialize keepalive $hash->{keepalive}{ok} = 0; $hash->{keepalive}{retry} = 0; InternalTimer(gettimeofday() + SDUINO_KEEPALIVE_TIMEOUT, "SIGNALduino_KeepAlive", $hash, 0); - $hash->{hasCC1101} = 1 if ($ver !~ m/cc1101/); + $hash->{hasCC1101} = 1 if ($ver =~ m/cc1101/); } } else { diff --git a/UnitTest/tests/test_sub_CheckCmdResp-definition.txt b/UnitTest/tests/test_sub_CheckCmdResp-definition.txt index e9047126c..2c9e054fb 100644 --- a/UnitTest/tests/test_sub_CheckCmdResp-definition.txt +++ b/UnitTest/tests/test_sub_CheckCmdResp-definition.txt @@ -38,9 +38,27 @@ defmod test_sub_CheckCmdResp UnitTest dummyDuino ( is($targetHash->{getcmd}->{cmd},"version","getcmd not removed"); is($targetHash->{DevState},"INACTIVE","check DevState"); }; + + subtest 'Test with good version without cc1101' => sub { + plan tests => 5; + + my $mock = Mock::Sub->new; + my $SD_SimpleWrite = $mock->mock('SIGNALduino_SimpleWrite'); + + $targetHash->{version} = "V 3.3.1 SIGNALduino - compiled at Sep 22 2019 22:53:27"; + $targetHash->{getcmd}->{cmd} = "version"; + my $ret=SIGNALduino_CheckCmdResp($targetHash); + is(ReadingsVal($target,"state",undef),"opened","SIGNALDuino firmware version ok"); + is($SD_SimpleWrite->called,1,"SIGNALduino_SimpleWrite called"); + + is($targetHash->{getcmd}->{cmd},"version","getcmd not removed"); + is($targetHash->{DevState},"initialized","check DevState"); + is($targetHash->{hasCC1101},undef,"check internal hasCC1101"); + $SD_SimpleWrite->unmock; + }; subtest 'Test with good version' => sub { - plan tests => 4; + plan tests => 5; my $mock = Mock::Sub->new; my $SD_SimpleWrite = $mock->mock('SIGNALduino_SimpleWrite'); @@ -53,6 +71,7 @@ defmod test_sub_CheckCmdResp UnitTest dummyDuino ( is($targetHash->{getcmd}->{cmd},"version","getcmd not removed"); is($targetHash->{DevState},"initialized","check DevState"); + is($targetHash->{hasCC1101},1,"check internal hasCC1101"); $SD_SimpleWrite->unmock; }; From 86c7e07a4a86d4afc3e6a1dbc0dd36f9118566c8 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Mon, 11 Nov 2019 19:29:20 +0000 Subject: [PATCH 2/3] Travis automatic update controls file. Build (1927) [skip ci] --- controls_signalduino.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controls_signalduino.txt b/controls_signalduino.txt index d044ba8af..050a78331 100644 --- a/controls_signalduino.txt +++ b/controls_signalduino.txt @@ -1,4 +1,4 @@ -UPD 2019-11-10_20:22:39 206470 FHEM/00_SIGNALduino.pm +UPD 2019-11-11_20:25:02 206430 FHEM/00_SIGNALduino.pm UPD 2017-06-23_17:43:38 14541 FHEM/10_FS10.pm UPD 2016-09-18_21:22:06 10111 FHEM/14_BresserTemeo.pm UPD 2018-11-11_22:35:33 13616 FHEM/14_FLAMINGO.pm From 39ce21ff0050239048b8eef9fd8b05b65ad56916 Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Mon, 11 Nov 2019 20:34:17 +0100 Subject: [PATCH 3/3] Added CHANGED --- CHANGED | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGED b/CHANGED index 7ffd4c6d8..9c0df4c66 100644 --- a/CHANGED +++ b/CHANGED @@ -1,3 +1,5 @@ +11.11.2019 + 00_SIGNALduino.pm: fix missing cc1101 get commands 09.11.2019 14_SD_WS.pm: new protocol 53 for weatherstation Lidl AURIOL AHFL 433 B2 IAN 314695 05.11.2019