diff --git a/FHEM/lib/SD_ProtocolData.pm b/FHEM/lib/SD_ProtocolData.pm index d6327103d..fab8e728f 100644 --- a/FHEM/lib/SD_ProtocolData.pm +++ b/FHEM/lib/SD_ProtocolData.pm @@ -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 !!! # -------------------- @@ -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 #### #### diff --git a/controls_signalduino.txt b/controls_signalduino.txt index eabbdd33b..04a29d2ec 100644 --- a/controls_signalduino.txt +++ b/controls_signalduino.txt @@ -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 diff --git a/t/FHEM/90_SIGNALduino_un/09_parseData.t b/t/FHEM/90_SIGNALduino_un/09_parseData.t new file mode 100644 index 000000000..258fa540b --- /dev/null +++ b/t/FHEM/90_SIGNALduino_un/09_parseData.t @@ -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; \ No newline at end of file diff --git a/t/FHEM/90_SIGNALduino_un/fhem.cfg b/t/FHEM/90_SIGNALduino_un/fhem.cfg index 8b1378917..bd31945ab 100644 --- a/t/FHEM/90_SIGNALduino_un/fhem.cfg +++ b/t/FHEM/90_SIGNALduino_un/fhem.cfg @@ -1 +1,2 @@ - +define dummyDuino SIGNALduino none +attr dummyDuino dummy 1 \ No newline at end of file diff --git a/t/FHEM/90_SIGNALduino_un/testData.json b/t/FHEM/90_SIGNALduino_un/testData.json new file mode 100644 index 000000000..611e799ab --- /dev/null +++ b/t/FHEM/90_SIGNALduino_un/testData.json @@ -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" + } +]