Skip to content

Commit

Permalink
feat: albe protocol and test added
Browse files Browse the repository at this point in the history
  • Loading branch information
sidey79 committed Sep 21, 2024
1 parent 1f378a7 commit 107b5dc
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 2 deletions.
26 changes: 24 additions & 2 deletions FHEM/lib/SD_ProtocolData.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# All protocol definitions are contained in this file.
#
# 2016-2019 S.Butzek, Ralf9
# 2019-2023 S.Butzek, HomeAutoUser, elektron-bbs
# 2019-2024 S.Butzek, HomeAutoUser, elektron-bbs
#
# !!! useful hints !!!
# --------------------
Expand Down Expand Up @@ -3578,7 +3578,29 @@ package lib::SD_ProtocolData;
clientmodule => 'WMBUS',
#regexMatch => qr/^b/, # ToDo, check! fuer eine regexp Pruefung am Anfang vor dem method Aufruf
},

"135" =>
# albe shutter motor
# MS;P1=467;P2=-1995;P3=-1024;P4=-4007;D=14121212131213121313131312131313131212131313121313121212121312131312121312;CP=1;SP=4;R=218;
# MS;P0=482;P1=-1017;P2=-1990;P3=-4008;D=03020202010201020101010102010101010202010101020101020202020102010102020102;CP=0;SP=3;R=219;
#
{
name => 'albe',
comment => 'shutter motor',
id => '135',
knownFreqs => '433.92',
one => [1,-2],
zero => [1,-4],
sync => [1,-8],
clockabs => 490,
format => 'twostate', # not used now
preamble => 'u',
#postamble => '',
clientmodule => 'SIGNALduino_un',
#modulematch => '^s[A-Fa-f0-9]+',
#length_min => '56',
#length_max => '56',
#paddingbits => '8', # pad up to 8 bits, default is 4
},
########################################################################
#### ### register informations from other hardware protocols #### ####

Expand Down
51 changes: 51 additions & 0 deletions t/FHEM/90_SIGNALduino_un/09_parseData.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env perl
use strict;
use warnings;

use Test2::V0;
use File::Basename;

# Testtool which supports DMSG Tests from SIGNALDuino_tool
use Test2::SIGNALduino::RDmsg;

our %defs;
our $init_done;

my $module = basename (dirname(__FILE__));


sub runTest {
my $ioName = shift;
my $ioHash = $defs{$ioName};
#use Data::Dumper;
#print Dumper(@Test::RDmsg::JSONTestList);
my $filepath = dirname(__FILE__);
push @Test2::SIGNALduino::RDmsg::JSONTestList, {
testname => qq[Testdata with $module data],
url => qq[$filepath/testData.json],
};

plan( scalar @Test2::SIGNALduino::RDmsg::JSONTestList);
for my $maintest (@Test2::SIGNALduino::RDmsg::JSONTestList)
{
subtest $maintest->{testname} => sub {
Test2::SIGNALduino::RDmsg::dmsgCheck($maintest,$module,$ioHash);
};
}
exit(0);
}

sub waitDone {

if ($init_done)
{
runTest(@_);
} else {
InternalTimer(time()+0.2, &waitDone,@_);
}

}

waitDone('dummyDuino');

1;
23 changes: 23 additions & 0 deletions t/FHEM/90_SIGNALduino_un/testData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"data" : [
{
"comment" : "test for albe motor",
"dmsg" : "u15EF3B0B2",
"internals" : {
},
"readings" : {
},
"rmsg" : "MS;P0=482;P1=-1017;P2=-1990;P3=-4008;D=03020202010201020101010102010101010202010101020101020202020102010102020102;CP=0;SP=3;R=219;",
"tests" : [
{
"comment" : "#0"
}
]
}
],
"id" : "135",
"module" : "SIGNALduino_un",
"name" : "SIGNALduino UNKNOWN"
}
]

0 comments on commit 107b5dc

Please sign in to comment.