From ef2b5cac14fa36de9e2c45c241b2d4ac510e7286 Mon Sep 17 00:00:00 2001 From: viegener <> Date: Sun, 14 Apr 2024 10:18:22 +0000 Subject: [PATCH] 10_SOMFY.pm: Signalduino modif and doc cleanup - msg1298875 git-svn-id: https://svn.fhem.de/fhem/trunk@28792 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/10_SOMFY.pm | 59 ++++++++++++++++++++++--------------------- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 3f079e992..7da153223 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it + - change: 10_SOMFY.pm: Signalduino modif and doc cleanup - msg1298875 - feature: 74_AutomowerConnect.pm: reduce spikes in border region after a hull polygon is set to attribut. - feature: 14_CUL_TCM97001.pm: NX7674, Kuehl- & Gefrierschrank-Thermometer diff --git a/fhem/FHEM/10_SOMFY.pm b/fhem/FHEM/10_SOMFY.pm index 786178997..935cec52a 100644 --- a/fhem/FHEM/10_SOMFY.pm +++ b/fhem/FHEM/10_SOMFY.pm @@ -258,12 +258,12 @@ sub SOMFY_Initialize($) { # allow also matches for longer commands of newer devices --> $hash->{Match} = "^Ys.............."; #msg1224029 - $hash->{SetFn} = "SOMFY_Set"; + $hash->{SetFn} = \&SOMFY_Set; #$hash->{StateFn} = "SOMFY_SetState"; - $hash->{DefFn} = "SOMFY_Define"; - $hash->{UndefFn} = "SOMFY_Undef"; - $hash->{ParseFn} = "SOMFY_Parse"; - $hash->{AttrFn} = "SOMFY_Attr"; + $hash->{DefFn} = \&SOMFY_Define; + $hash->{UndefFn} = \&SOMFY_Undef; + $hash->{ParseFn} = \&SOMFY_Parse; + $hash->{AttrFn} = \&SOMFY_Attr; $hash->{AttrList} = " drive-down-time-to-100" . " drive-down-time-to-close" @@ -556,7 +556,7 @@ sub SOMFY_Parse($$) { # return "IODev unsupported" if ((my $ioType = $hash->{TYPE}) !~ m/^(CUL|SIGNALduino)$/); # preprocessing if IODev is SIGNALduino - if ($ioType eq "SIGNALduino") { + if ($ioType =~ m/^SIGNALduino/) { my $encData = substr($msg, 2); $ret = "Somfy RTS message format error (length must be 14 or 20)! :".$encData.":" if ( (length($encData) != 14) && (length($encData) != 20)); $ret = "Somfy RTS message format error! :".$encData.":" if ( ( ! $ret ) && ($encData !~ m/^[0-9A-F]+$/) ); @@ -1676,7 +1676,7 @@ sub SOMFY_SendCommand($@) } # CUL specifics - if ($ioType ne "SIGNALduino") { + if ($ioType !~ m/SIGNALduino/) { ## Do we need to change RFMode to SlowRF? if ( defined( $attr{ $name } ) && defined( $attr{ $name }{"switch_rfmode"} ) ) @@ -1745,7 +1745,7 @@ sub SOMFY_SendCommand($@) Log3 $hash, 5, "SOMFY_send $name enc key : ". $new_enc_key." rolling code : ".$new_rolling_code; ## Send Message to IODev using IOWrite - if ($ioType eq "SIGNALduino") { + if ($ioType =~ m/SIGNALduino/) { my $SignalRepeats = AttrVal($name,'repetition', '6'); # swap address, remove leading s my $decData = substr($message, 1, 8) . substr($message, 13, 2) . substr($message, 11, 2) . substr($message, 9, 2); @@ -1771,7 +1771,7 @@ sub SOMFY_SendCommand($@) # SOMFY_updateDef( $hash, $new_enc_key, $new_rolling_code ); # CUL specifics - if ($ioType ne "SIGNALduino") { + if ($ioType !~ m/SIGNALduino/) { ## Do we need to change symbol length back? if ( defined( $attr{ $name } ) && defined( $attr{ $name }{"symbol-length"} ) ) @@ -1837,7 +1837,7 @@ sub SOMFY_SendCommand($@) =item summary_DE für Geräte, die das SOMFY RTS protocol unterstützen - Rolläden =begin html - +
define <name> SOMFY <address> [<encryption-key>] [<rolling-code>]
@@ -1894,7 +1894,7 @@ sub SOMFY_SendCommand($@)
set <name> <value> [<time>]
@@ -1963,44 +1963,45 @@ sub SOMFY_SendCommand($@)
Get pos
as numeric value.
Additionally this attribute might specify a name for an additional reading to be updated with the same value than the pos.