30_pilight_raw: NEW: Attribut sendCount

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@12478 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
risiko79 2016-10-31 13:20:55 +00:00
parent 4dbcefe019
commit 8ecef173e8
2 changed files with 14 additions and 2 deletions

View File

@ -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.
- new: 30_pilight_raw.pm: New Attribut sendCount
- bugfix: 10_SOMFY: wrong attribute reference ...-up-time-to-close removed
- new: 42_Nextion.pm: New module to connect Nextion displays
- changed: YahooWeatherAPI: react on wrong units

View File

@ -10,6 +10,7 @@
# V 0.10 2015-07-21 - initial beta version
# V 0.11 2015-07-27 - SetExtensions on-for-timer
# V 0.12 2015-12-17 - NEW: Attribut IODev to switch IO-Device
# V 0.13 2016-10-31 - NEW: Attribut sendCount
##############################################
package main;
@ -32,7 +33,7 @@ sub pilight_raw_Initialize($)
$hash->{DefFn} = "pilight_raw_Define";
$hash->{Match} = "^PIRAW";
$hash->{SetFn} = "pilight_raw_Set";
$hash->{AttrList} = "onCode:textField-long offCode:textField-long IODev ".$readingFnAttributes;
$hash->{AttrList} = "onCode:textField-long offCode:textField-long IODev sendCount:1,2,3,4,5 ".$readingFnAttributes;
}
#####################################
@ -88,7 +89,11 @@ sub pilight_raw_Set($$)
}
my $msg = "$me,$code";
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);
}
readingsSingleUpdate($hash,"state",$cmd,1) if($updateReading == 1);
return undef;
@ -98,6 +103,8 @@ sub pilight_raw_Set($$)
1;
=pod
=item summary Sending pilight raw codes
=item summary_DE Send pilight Raw-Codes
=begin html
<a name="pilight_raw"></a>
@ -150,6 +157,10 @@ sub pilight_raw_Set($$)
<li><a name="offCode">onCode</a><br>
raw code for state off
</li>
<li>
sendCount<br>
How many times the command is send. Default: 1
</li>
</ul>
</ul>