From 58131ff01c962ded3bd4bef1f52ff66745c81d10 Mon Sep 17 00:00:00 2001 From: fladdy Date: Sun, 17 Feb 2013 18:15:37 +0000 Subject: [PATCH] added readingFnAttributes git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@2754 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/58_GPIO4.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fhem/contrib/58_GPIO4.pm b/fhem/contrib/58_GPIO4.pm index 9cc0227ad..171459efd 100644 --- a/fhem/contrib/58_GPIO4.pm +++ b/fhem/contrib/58_GPIO4.pm @@ -38,7 +38,7 @@ sub GPIO4_Initialize($) { $hash->{UndefFn} = "GPIO4_Undef"; $hash->{NotifyFn} = "GPIO4_Notify"; $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($$) { @@ -135,10 +135,9 @@ sub GPIO4_Get($) { if ($attr{$hash->{NAME}}{tempOffset}) { $temp+=$attr{$hash->{NAME}}{tempOffset}; } - my $tempstr = sprintf("%.1f",$temp); readingsBeginUpdate($hash); - readingsBulkUpdate($hash,"state","T: $tempstr"); - readingsBulkUpdate($hash,"temperature",$tempstr); + readingsBulkUpdate($hash,"state","T: $temp"); + readingsBulkUpdate($hash,"temperature",$temp); readingsEndUpdate($hash,1); } else { @@ -187,6 +186,7 @@ sub GPIO4_Undef($) {
@@ -221,6 +221,7 @@ sub GPIO4_Undef($) {