From 107b5dcab05163960190c4283ab0514a0a42f81d Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Sat, 21 Sep 2024 22:49:49 +0200 Subject: [PATCH 1/4] feat: albe protocol and test added --- FHEM/lib/SD_ProtocolData.pm | 26 ++++++++++++- t/FHEM/90_SIGNALduino_un/09_parseData.t | 51 +++++++++++++++++++++++++ t/FHEM/90_SIGNALduino_un/testData.json | 23 +++++++++++ 3 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 t/FHEM/90_SIGNALduino_un/09_parseData.t create mode 100644 t/FHEM/90_SIGNALduino_un/testData.json diff --git a/FHEM/lib/SD_ProtocolData.pm b/FHEM/lib/SD_ProtocolData.pm index d6327103d..a5431518f 100644 --- a/FHEM/lib/SD_ProtocolData.pm +++ b/FHEM/lib/SD_ProtocolData.pm @@ -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 !!! # -------------------- @@ -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 #### #### 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/testData.json b/t/FHEM/90_SIGNALduino_un/testData.json new file mode 100644 index 000000000..cede13d51 --- /dev/null +++ b/t/FHEM/90_SIGNALduino_un/testData.json @@ -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" + } +] From e70abce66504615b387d88758d08e740208e9c7c Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 21 Sep 2024 20:50:38 +0000 Subject: [PATCH 2/4] Automatic updated controls and CHANGED --- controls_signalduino.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controls_signalduino.txt b/controls_signalduino.txt index eabbdd33b..d26a8720e 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_22:49:49 255440 FHEM/lib/SD_ProtocolData.pm UPD 2024-01-06_20:21:35 81862 FHEM/lib/SD_Protocols.pm From 67ab99c276a476b0458aa7e81a1c2bce93495f71 Mon Sep 17 00:00:00 2001 From: sidey79 <7968127+sidey79@users.noreply.github.com> Date: Sat, 21 Sep 2024 23:18:40 +0200 Subject: [PATCH 3/4] fix: tests fixed --- FHEM/lib/SD_ProtocolData.pm | 2 +- t/FHEM/90_SIGNALduino_un/fhem.cfg | 3 ++- t/FHEM/90_SIGNALduino_un/testData.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/FHEM/lib/SD_ProtocolData.pm b/FHEM/lib/SD_ProtocolData.pm index a5431518f..5eb444789 100644 --- a/FHEM/lib/SD_ProtocolData.pm +++ b/FHEM/lib/SD_ProtocolData.pm @@ -3593,7 +3593,7 @@ package lib::SD_ProtocolData; sync => [1,-8], clockabs => 490, format => 'twostate', # not used now - preamble => 'u', + preamble => 'u135#', #postamble => '', clientmodule => 'SIGNALduino_un', #modulematch => '^s[A-Fa-f0-9]+', 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 index cede13d51..611e799ab 100644 --- a/t/FHEM/90_SIGNALduino_un/testData.json +++ b/t/FHEM/90_SIGNALduino_un/testData.json @@ -3,7 +3,7 @@ "data" : [ { "comment" : "test for albe motor", - "dmsg" : "u15EF3B0B2", + "dmsg" : "u135#15EF3B0B2", "internals" : { }, "readings" : { From a94cc59fc8504eb34b57f1842b6536cd82d1b34c Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 21 Sep 2024 21:19:40 +0000 Subject: [PATCH 4/4] Update Versiondate --- FHEM/lib/SD_ProtocolData.pm | 2 +- controls_signalduino.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FHEM/lib/SD_ProtocolData.pm b/FHEM/lib/SD_ProtocolData.pm index 5eb444789..fab8e728f 100644 --- a/FHEM/lib/SD_ProtocolData.pm +++ b/FHEM/lib/SD_ProtocolData.pm @@ -1,4 +1,4 @@ -# $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. # diff --git a/controls_signalduino.txt b/controls_signalduino.txt index d26a8720e..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-21_22:49:49 255440 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