From 5425dd97e6f2e773664687d4e89a107b8f3ffc6c 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: https://svn.fhem.de/fhem/trunk/fhem@2754 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- contrib/58_GPIO4.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/58_GPIO4.pm b/contrib/58_GPIO4.pm index 9cc0227ad..171459efd 100644 --- a/contrib/58_GPIO4.pm +++ b/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($) {