From 24c5afbc411afe05730fb082e961f0a884379dfd Mon Sep 17 00:00:00 2001 From: risiko79 <> Date: Sun, 24 Apr 2016 17:03:16 +0000 Subject: [PATCH] 30_pilight_switch: new attribute sendCount git-svn-id: https://svn.fhem.de/fhem/trunk@11306 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/30_pilight_switch.pm | 23 +++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 3c115a5d6..199bf5b27 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # 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. + - feature: 30_pilight_switch: new attribute 'sendCount' to send the + command n times. - feature: 98_rssFeed: creating some readings containing ticker data. This can be enabled via new attribute rfDisplayTickerReadings. - change: FB_CALLLIST: delete also corresponding readings if a call gets diff --git a/fhem/FHEM/30_pilight_switch.pm b/fhem/FHEM/30_pilight_switch.pm index 463ed4331..edeecb4da 100644 --- a/fhem/FHEM/30_pilight_switch.pm +++ b/fhem/FHEM/30_pilight_switch.pm @@ -14,6 +14,7 @@ # V 0.14 2015-07-27 - NEW: SetExtensions on-for-timer # V 0.15 2015-12-17 - NEW: Attribut IODev to switch IO-Device # V 0.16 2016-03-28 - NEW: protocol daycom with three id's (id, systemcode, unit) +# V 0.17 2016-04-24 - NEW: Attribut sendCount ############################################## package main; @@ -40,7 +41,7 @@ sub pilight_switch_Initialize($) $hash->{ParseFn} = "pilight_switch_Parse"; $hash->{SetFn} = "pilight_switch_Set"; $hash->{StateFn} = "pilight_switch_State"; - $hash->{AttrList} = "IODev ".$readingFnAttributes; + $hash->{AttrList} = "IODev sendCount:1,2,3,4,5 ".$readingFnAttributes; } ##################################### @@ -132,10 +133,13 @@ sub pilight_switch_Set($$) return "$cmd expects $sets{$match[0]} parameters" unless (@a eq $sets{$match[0]}); my $v = join(" ", @a); - Log3 $me, 4, "$me(Set): $cmd $v"; - my $msg = "$me,$cmd"; - IOWrite($hash, $msg); + + my $sndCount = AttrVal($me,"sendCount",1); + for (my $i = 0; $i < $sndCount; $i++) { + Log3 $me, 5, "$me(Set): $cmd $v".($i+1)." of $sndCount"; + IOWrite($hash, $msg); + } #keinen Trigger bei Set auslösen #Aktualisierung erfolgt in Parse @@ -192,6 +196,17 @@ sub pilight_switch_Set($$) state of the switch on or off + + Attributs +