-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 4806d2e Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Jun 7 22:21:10 2022 +0200 Bump fhem/fhem-controls-actions from 2.0.3 to 2.1.0 (#1105) Bumps [fhem/fhem-controls-actions](https://github.com/fhem/fhem-controls-actions) from 2.0.3 to 2.1.0. - [Release notes](https://github.com/fhem/fhem-controls-actions/releases) - [Commits](fhem/fhem-controls-actions@v2.0.3...v2.1.0) --- updated-dependencies: - dependency-name: fhem/fhem-controls-actions dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 6bb37f9 Author: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Tue May 31 17:12:21 2022 +0200 Basic funkbus support (#1102) * SD_ProtocolData.pm added funkbus protocol 119 from forum https://forum.fhem.de/index.php/topic,19065.msg1217972.html#msg1217972 * SD_Protocols.pm - sub mcBit2Funkbus added - sub mc2dmc added - Tests added
- Loading branch information
1 parent
192fe7b
commit 9bbf715
Showing
8 changed files
with
228 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
|
||
use Test2::V0; | ||
use lib::SD_Protocols; | ||
use Test2::Tools::Compare qw{is}; | ||
|
||
plan(3); | ||
|
||
my ($rcode,$bitresult); | ||
my $Protocols = | ||
new lib::SD_Protocols( filetype => 'json', filename => './t/SD_Protocols/test_protocolData.json' ); | ||
|
||
|
||
|
||
subtest 'mc2dmc without arguments' => sub { | ||
plan(1); | ||
|
||
my $bitData='110010'; | ||
$bitresult=$Protocols->mc2dmc(); | ||
is($bitresult,q[no bitData provided],q[check result mc2dmc]); | ||
}; | ||
|
||
subtest 'mc2dmc 1001 => 010' => sub { | ||
plan(1); | ||
|
||
my $bitData='1001'; | ||
$bitresult=$Protocols->mc2dmc($bitData); | ||
is($bitresult,q[010],q[check result mc2dmc]); | ||
}; | ||
|
||
|
||
subtest 'mc2dmc 110010 => 10100' => sub { | ||
plan(1); | ||
|
||
my $bitData='110010'; | ||
$bitresult=$Protocols->mc2dmc($bitData); | ||
is($bitresult,q[10100],q[check result mc2dmc]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
|
||
use Test2::V0; | ||
use lib::SD_Protocols; | ||
use Test2::Tools::Compare qw{is}; | ||
|
||
plan(3); | ||
|
||
my $id=119; | ||
my ($rcode,$hexresult); | ||
my $Protocols = | ||
new lib::SD_Protocols( filetype => 'json', filename => './t/SD_Protocols/test_protocolData.json' ); | ||
|
||
# Mock protocol for this test | ||
$Protocols->{_protocols}->{119}{length_min} = 47; | ||
$Protocols->{_protocols}->{119}{length_max} = 52; | ||
|
||
subtest 'mcBit2Funkbus good message' => sub { | ||
plan(2); | ||
|
||
my $bitData='1001110101001111001111110111010101010101101000000000'; | ||
($rcode,$hexresult)=$Protocols->mcBit2Funkbus(q[some_name],$bitData,$id,length $bitData); | ||
is($rcode,1,q[check returncode for mcBit2Funkbus]); | ||
is($hexresult,q[2C175F30008F],q[check result mcBit2Funkbus]); | ||
}; | ||
|
||
subtest 'mcBit2Funkbus wrong parity' => sub { | ||
plan(2); | ||
|
||
my $bitData='100111010100111100111111011101010101010110110000000'; | ||
($rcode,$hexresult)=$Protocols->mcBit2Funkbus(q[some_name],$bitData,$id,length $bitData); | ||
is($rcode,-1,q[check returncode for mcBit2Funkbus]); | ||
is($hexresult,q[parity error],q[check result mcBit2Funkbus]); | ||
}; | ||
|
||
subtest 'mcBit2Funkbus wrong checksum' => sub { | ||
plan(2); | ||
|
||
my $bitData='1001110101001111101111110111010101010101101000000000'; | ||
($rcode,$hexresult)=$Protocols->mcBit2Funkbus(q[some_name],$bitData,$id,length $bitData); | ||
is($rcode,-1,q[check returncode for mcBit2Funkbus]); | ||
is($hexresult,q[checksum error],q[check result mcBit2Funkbus]); | ||
}; |