2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

added readingFnAttributes

git-svn-id: https://svn.fhem.de/fhem/trunk@2754 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
fladdy 2013-02-17 18:15:37 +00:00
parent c35ebdb81e
commit 22003cba26

View File

@ -38,7 +38,7 @@ sub GPIO4_Initialize($) {
$hash->{UndefFn} = "GPIO4_Undef"; $hash->{UndefFn} = "GPIO4_Undef";
$hash->{NotifyFn} = "GPIO4_Notify"; $hash->{NotifyFn} = "GPIO4_Notify";
$hash->{GetFn} = "GPIO4_Get"; $hash->{GetFn} = "GPIO4_Get";
$hash->{AttrList} = "tempOffset pollingInterval model loglevel:0,1,2,3,4,5,6"; $hash->{AttrList} = "tempOffset pollingInterval model loglevel:0,1,2,3,4,5,6 ".$readingFnAttributes;
} }
sub GPIO4_Notify($$) { sub GPIO4_Notify($$) {
@ -135,10 +135,9 @@ sub GPIO4_Get($) {
if ($attr{$hash->{NAME}}{tempOffset}) { if ($attr{$hash->{NAME}}{tempOffset}) {
$temp+=$attr{$hash->{NAME}}{tempOffset}; $temp+=$attr{$hash->{NAME}}{tempOffset};
} }
my $tempstr = sprintf("%.1f",$temp);
readingsBeginUpdate($hash); readingsBeginUpdate($hash);
readingsBulkUpdate($hash,"state","T: $tempstr"); readingsBulkUpdate($hash,"state","T: $temp");
readingsBulkUpdate($hash,"temperature",$tempstr); readingsBulkUpdate($hash,"temperature",$temp);
readingsEndUpdate($hash,1); readingsEndUpdate($hash,1);
} }
else { else {
@ -187,6 +186,7 @@ sub GPIO4_Undef($) {
<ul> <ul>
<li><a href="#pollingInterval">pollingInterval</a></li> <li><a href="#pollingInterval">pollingInterval</a></li>
<li><a href="#tempOffest">tempOffset</a></li> <li><a href="#tempOffest">tempOffset</a></li>
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
</ul> </ul>
<br> <br>
</ul> </ul>
@ -221,6 +221,7 @@ sub GPIO4_Undef($) {
<ul> <ul>
<li><a href="#pollingInterval">pollingInterval</a></li> <li><a href="#pollingInterval">pollingInterval</a></li>
<li><a href="#tempOffest">tempOffset</a></li> <li><a href="#tempOffest">tempOffset</a></li>
<li><a href="#readingFnAttributes">readingFnAttributes</a></li>
</ul> </ul>
<br> <br>
</ul> </ul>