Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Albe protocol #1273

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions FHEM/lib/SD_ProtocolData.pm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# $Id: SD_ProtocolData.pm 26975 2024-09-08 15:09:34Z elektron-bbs $
# $Id: SD_ProtocolData.pm 26975 2024-09-21 21:19:05Z sidey79 $
# The file is part of the SIGNALduino project.
# 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 => 'u135#',
#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
2 changes: 1 addition & 1 deletion controls_signalduino.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ UPD 2023-01-23_21:06:26 38569 FHEM/14_SD_WS09.pm
UPD 2023-01-09_19:54:48 16458 FHEM/14_SD_WS_Maverick.pm
UPD 2023-01-28_20:08:00 40378 FHEM/41_OREGON.pm
UPD 2020-12-17_23:16:30 15582 FHEM/90_SIGNALduino_un.pm
UPD 2024-09-08_18:21:59 254416 FHEM/lib/SD_ProtocolData.pm
UPD 2024-09-21_23:18:40 255439 FHEM/lib/SD_ProtocolData.pm
UPD 2024-01-06_20:21:35 81862 FHEM/lib/SD_Protocols.pm
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;
3 changes: 2 additions & 1 deletion t/FHEM/90_SIGNALduino_un/fhem.cfg
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

define dummyDuino SIGNALduino none
attr dummyDuino dummy 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" : "u135#15EF3B0B2",
"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"
}
]
Loading