Skip to content

Commit

Permalink
Merge pull request #1145 from RFD-FHEM/master-criticPrototypes
Browse files Browse the repository at this point in the history
Removed prototypes
  • Loading branch information
sidey79 committed Jan 9, 2023
2 parents 0691346 + 7503449 commit 1a32f75
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 53 deletions.
29 changes: 14 additions & 15 deletions FHEM/00_SIGNALduino.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $Id: 00_SIGNALduino.pm 3.5.5 2023-01-07 16:05:33Z sidey79 $
# $Id: 00_SIGNALduino.pm 3.5.5 2023-01-09 19:54:08Z sidey79 $
# v3.5.5 - https://github.com/RFD-FHEM/RFFHEM/tree/master
# The module is inspired by the FHEMduino project and modified in serval ways for processing the incoming messages
# see http://www.fhemwiki.de/wiki/SIGNALDuino
Expand Down Expand Up @@ -41,7 +41,7 @@ use List::Util qw(first);


use constant {
SDUINO_VERSION => '3.5.5+20230107', # Datum wird automatisch bei jedem pull request aktualisiert
SDUINO_VERSION => '3.5.5+20230109', # Datum wird automatisch bei jedem pull request aktualisiert
SDUINO_INIT_WAIT_XQ => 1.5, # wait disable device
SDUINO_INIT_WAIT => 2,
SDUINO_INIT_MAXRETRY => 3,
Expand Down Expand Up @@ -644,7 +644,7 @@ sub SIGNALduino_RemoveLaCrossePair {
}

############################# package main, test exists
sub SIGNALduino_Set($$@) {
sub SIGNALduino_Set {
my ($hash,$name, @a) = @_;

return "\"set SIGNALduino\" needs at least one parameter" if(@a < 1);
Expand Down Expand Up @@ -1007,9 +1007,8 @@ sub SIGNALduino_Set_LaCrossePairForSec {
}

############################# package main, test exists
sub SIGNALduino_Get($@) {
sub SIGNALduino_Get {
my ($hash,$name, @a) = @_;
#my $type = $hash->{TYPE};

return "\"get SIGNALduino\" needs at least one parameter" if(@a < 1);

Expand Down Expand Up @@ -2102,7 +2101,7 @@ sub SIGNALduino_PatternExists {

############################# package main
#SIGNALduino_MatchSignalPattern{$hash,@array, %hash, @array, $scalar}; not used >v3.1.3
sub SIGNALduino_MatchSignalPattern($\@\%\@$){
sub SIGNALduino_MatchSignalPattern {
my ( $hash, $signalpattern, $patternList, $data_array, $idx) = @_;
my $name = $hash->{NAME};
#print Dumper($patternList);
Expand Down Expand Up @@ -2527,7 +2526,7 @@ sub SIGNALduino_Parse_MS {
############################# package main
## //Todo: check list as reference
# // Todo: Make this sub robust and use it
sub SIGNALduino_padbits(\@$) {
sub SIGNALduino_padbits {
my $i=@{$_[0]} % $_[1];
while (@{$_[0]} % $_[1] > 0) ## will pad up full nibbles per default or full byte if specified in protocol
{
Expand Down Expand Up @@ -2966,7 +2965,7 @@ sub SIGNALduino_Parse_MN {
}

############################# package main
sub SIGNALduino_Parse($$$$@) {
sub SIGNALduino_Parse {
my ($hash, $iohash, $name, $rmsg, $initstr) = @_;

#print Dumper(\%ProtocolListSIGNALduino);
Expand Down Expand Up @@ -3069,7 +3068,7 @@ sub SIGNALduino_WriteInit {
}

############################# package main
sub SIGNALduino_SimpleWrite(@) {
sub SIGNALduino_SimpleWrite {
my ($hash, $msg, $nonl) = @_;
return if(!$hash);
if($hash->{TYPE} eq 'SIGNALduino_RFR') {
Expand All @@ -3091,7 +3090,7 @@ sub SIGNALduino_SimpleWrite(@) {
}

############################# package main
sub SIGNALduino_Attr(@) {
sub SIGNALduino_Attr {
my ($cmd,$name,$aName,$aVal) = @_;
my $hash = $defs{$name};
my $debug = AttrVal($name,'debug',0);
Expand Down Expand Up @@ -3229,7 +3228,7 @@ sub SIGNALduino_Attr(@) {
}

############################# package main
sub SIGNALduino_FW_Detail($@) {
sub SIGNALduino_FW_Detail {
my ($FW_wname, $name, $room, $pageHash) = @_;

my $hash = $defs{$name};
Expand Down Expand Up @@ -3342,7 +3341,7 @@ sub SIGNALduino_FW_saveWhitelist {
}

############################# package main - test is missing
sub SIGNALduino_IdList($@) {
sub SIGNALduino_IdList {
my ($param, $aVal, $blacklist, $develop0) = @_;
my (undef,$name) = split(':', $param);

Expand Down Expand Up @@ -3545,7 +3544,7 @@ sub SIGNALduino_callsub {
# Will return $count of ???, modified $rawData , modified %patternListRaw,
# =cut
############################# package main
sub SIGNALduino_filterMC($$$%) {
sub SIGNALduino_filterMC {
## Warema Implementierung : Todo variabel gestalten
my ($name,$id,$rawData,%patternListRaw) = @_;
my $hash=$defs{$name};
Expand Down Expand Up @@ -3614,7 +3613,7 @@ sub SIGNALduino_filterMC($$$%) {
# Will return $count of combined values, modified $rawData , modified %patternListRaw,
# =cut
############################# package main
sub SIGNALduino_filterSign($$$%) {
sub SIGNALduino_filterSign {
my ($name,$id,$rawData,%patternListRaw) = @_;
my $debug = AttrVal($name,'debug',0);

Expand Down Expand Up @@ -3683,7 +3682,7 @@ sub SIGNALduino_filterSign($$$%) {
# Will return $count of combined values, modified $rawData , modified %patternListRaw,
# =cut
############################# package main
sub SIGNALduino_compPattern($$$%) {
sub SIGNALduino_compPattern {
my ($name,$id,$rawData,%patternListRaw) = @_;
my $debug = AttrVal($name,'debug',0);

Expand Down
12 changes: 6 additions & 6 deletions FHEM/14_SD_AS.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##############################################
# $Id: 14_SD_AS.pm 350 2022-12-29 23:35:50Z sidey79 $
# $Id: 14_SD_AS.pm 350 2023-01-09 19:54:08Z sidey79 $
# The file is part of the SIGNALduino project
# see http://www.fhemwiki.de/wiki/SIGNALduino
# and was created to provide support for self build sensors.
Expand All @@ -18,7 +18,7 @@ use FHEM::Meta;

#####################################
sub
SD_AS_Initialize($)
SD_AS_Initialize
{
my ($hash) = @_;

Expand Down Expand Up @@ -65,7 +65,7 @@ SD_AS_Initialize($)

#####################################
sub
SD_AS_Define($$)
SD_AS_Define
{
my ($hash, $def) = @_;
my @a = split("[ \t][ \t]*", $def);
Expand All @@ -85,7 +85,7 @@ SD_AS_Define($$)

#####################################
sub
SD_AS_Undef($$)
SD_AS_Undef
{
my ($hash, $name) = @_;
delete($modules{AS}{defptr}{$hash->{CODE}}) if($hash && $hash->{CODE});
Expand All @@ -94,7 +94,7 @@ SD_AS_Undef($$)

#####################################
sub
SD_AS_Parse($$)
SD_AS_Parse
{
my ($iohash,$msg) = @_;
my (undef ,$rawData) = split("#",$msg);
Expand Down Expand Up @@ -275,7 +275,7 @@ SD_AS_Parse($$)
#Initial value: 0x0
#See http://www.maxim-ic.com/appnotes.cfm/appnote_number/27

sub SD_AS_crc($$)
sub SD_AS_crc
{
my ($lcrc,$ldata) = @_;
my $i;
Expand Down
8 changes: 4 additions & 4 deletions FHEM/14_SD_WS07.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##############################################
# $Id: 14_SD_WS07.pm 26981 2023-01-06 12:07:45Z sidey79 $
# $Id: 14_SD_WS07.pm 26981 2023-01-09 19:54:08Z sidey79 $
#
# The purpose of this module is to support serval eurochron
# weather sensors like eas8007 which use the same protocol
Expand Down Expand Up @@ -57,7 +57,7 @@ sub SD_WS07_Initialize

#############################
sub
SD_WS07_Define($$)
SD_WS07_Define
{
my ($hash, $def) = @_;
my @a = split("[ \t][ \t]*", $def);
Expand All @@ -78,7 +78,7 @@ SD_WS07_Define($$)

#####################################
sub
SD_WS07_Undef($$)
SD_WS07_Undef
{
my ($hash, $name) = @_;
delete($modules{SD_WS07}{defptr}{$hash->{CODE}})
Expand All @@ -90,7 +90,7 @@ SD_WS07_Undef($$)

###################################
sub
SD_WS07_Parse($$)
SD_WS07_Parse
{
my ($iohash, $msg) = @_;
my (undef ,$rawData) = split("#",$msg);
Expand Down
20 changes: 10 additions & 10 deletions FHEM/14_SD_WS09.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##############################################
# $Id: 14_SD_WS09.pm 26980 2023-01-06 12:07:45Z sidey79 $
# $Id: 14_SD_WS09.pm 26980 2023-01-09 19:54:08Z sidey79 $
#
# The purpose of this module is to support serval
# weather sensors like WS-0101 (Sender 868MHz ASK Epmfänger RX868SH-DV elv)
Expand Down Expand Up @@ -50,7 +50,7 @@ sub SD_WS09_Initialize {
}

#############################
sub SD_WS09_Define($$) {
sub SD_WS09_Define {
my ($hash, $def) = @_;
my @a = split("[ \t][ \t]*", $def);

Expand All @@ -72,7 +72,7 @@ sub SD_WS09_Define($$) {
}

#####################################
sub SD_WS09_Undef($$) {
sub SD_WS09_Undef {
my ($hash, $name) = @_;

delete($modules{SD_WS09}{defptr}{$hash->{CODE}})
Expand All @@ -82,7 +82,7 @@ sub SD_WS09_Undef($$) {
}

###################################
sub SD_WS09_Parse($$) {
sub SD_WS09_Parse {
my ($iohash, $msg) = @_;
my $name = $iohash->{NAME};
my (undef ,$rawData) = split("#",$msg);
Expand Down Expand Up @@ -477,7 +477,7 @@ sub SD_WS09_Parse($$) {
}

###################################
sub SD_WS09_Attr(@) {
sub SD_WS09_Attr {
my @a = @_;
# Make possible to use the same code for different logical devices when they
# are received through different physical devices.
Expand Down Expand Up @@ -633,14 +633,14 @@ sub SD_WS09_WindDirAverage {
}

###################################
sub SD_WS09_bin2dec($) {
sub SD_WS09_bin2dec {
my $h = shift;
my $int = unpack("N", pack("B32",substr("0" x 32 . $h, -32)));
return sprintf("%d", $int);
}

###################################
sub SD_WS09_binflip($) {
sub SD_WS09_binflip {
my $h = shift;
my $hlen = length($h);
my $i = 0;
Expand All @@ -653,15 +653,15 @@ sub SD_WS09_binflip($) {
}

###################################
sub SD_WS09_BCD2bin($) {
sub SD_WS09_BCD2bin {
my $binary = shift;
my $int = unpack("N", pack("B32", substr("0" x 32 . $binary, -32)));
my $BCD = sprintf("%x", $int );
return $BCD;
}

###################################
sub SD_WS09_SHIFT($$){
sub SD_WS09_SHIFT{
my ($hash, $rawData) = @_;
my $name = $hash->{NAME};
my $hlen = length($rawData);
Expand All @@ -679,7 +679,7 @@ sub SD_WS09_SHIFT($$){
}

###################################
sub SD_WS09_CRCCHECK($) {
sub SD_WS09_CRCCHECK {
my $rawData = shift;
my $datacheck1 = pack( 'H*', substr($rawData,2,length($rawData)-2) );
my $crcmein1 = Digest::CRC->new(width => 8, poly => 0x31);
Expand Down
14 changes: 7 additions & 7 deletions FHEM/14_SD_WS_Maverick.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##############################################
# $Id: 14_SD_WS_Maverick.pm 26979 2023-01-06 12:07:45Z sidey79 $
# $Id: 14_SD_WS_Maverick.pm 26979 2023-01-09 19:54:08Z sidey79 $
#
# The purpose of this module is to support Maverick sensors
# Sidey79 & Cruizer 2016
Expand Down Expand Up @@ -47,7 +47,7 @@ sub SD_WS_Maverick_Initialize

#############################
sub
SD_WS_Maverick_Define($$)
SD_WS_Maverick_Define
{
my ($hash, $def) = @_;
my @a = split("[ \t][ \t]*", $def);
Expand Down Expand Up @@ -80,7 +80,7 @@ sub SD_WS_Maverick_Undef

###################################
sub
SD_WS_Maverick_Parse($$)
SD_WS_Maverick_Parse
{
my ($iohash, $msg) = @_;
#my $rawData = substr($msg, 2);
Expand Down Expand Up @@ -244,7 +244,7 @@ SD_WS_Maverick_Parse($$)
return $name;
}

sub SD_WS_Maverick_Attr(@)
sub SD_WS_Maverick_Attr
{
my ($cmd,$name,$attr_name,$attr_value) = @_;
my $hash = $defs{$name};
Expand All @@ -259,23 +259,23 @@ sub SD_WS_Maverick_Attr(@)
return undef;
}

sub SD_WS_Maverick_SetSensor1Inactive($){
sub SD_WS_Maverick_SetSensor1Inactive {
my ($hash) = @_;
my $name = $hash->{NAME};
Log3 $hash, 5, "$name SD_WS_Maverick_SetSensor1Inactive";
readingsSingleUpdate($hash, "Sensor-1-food_state", "inactive", 1);
SD_WS_Maverick_UpdateState($hash);
}

sub SD_WS_Maverick_SetSensor2Inactive($){
sub SD_WS_Maverick_SetSensor2Inactive {
my ($hash) = @_;
my $name = $hash->{NAME};
Log3 $hash, 5, "$name SD_WS_Maverick_SetSensor2Inactive";
readingsSingleUpdate($hash, "Sensor-2-bbq_state", "inactive", 1);
SD_WS_Maverick_UpdateState($hash);
}

sub SD_WS_Maverick_UpdateState($) {
sub SD_WS_Maverick_UpdateState {
my ($hash) = @_;
my $name = $hash->{NAME};
Log3 $hash, 5, "$name SD_WS_Maverick_UpdateState";
Expand Down
9 changes: 4 additions & 5 deletions FHEM/41_OREGON.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#################################################################################
# $Id: 41_OREGON.pm 26978 2023-01-06 12:07:45Z sidey79 $
# $Id: 41_OREGON.pm 26978 2023-01-09 19:54:08Z sidey79 $
#
# Module for FHEM to decode Oregon sensor messages
#
Expand Down Expand Up @@ -64,7 +64,7 @@ sub OREGON_Initialize

#####################################
sub
OREGON_Define($$)
OREGON_Define
{
my ($hash, $def) = @_;
my @a = split("[ \t][ \t]*", $def);
Expand All @@ -86,7 +86,7 @@ OREGON_Define($$)

#####################################
sub
OREGON_Undef($$)
OREGON_Undef
{
my ($hash, $name) = @_;
delete($modules{OREGON}{defptr}{$name});
Expand Down Expand Up @@ -894,8 +894,7 @@ sub OREGON_raw {


# -----------------------------
sub
OREGON_Parse($$)
sub OREGON_Parse
{
my ($iohash, $msg) = @_;

Expand Down
Loading

0 comments on commit 1a32f75

Please sign in to comment.