From a1aef654abaab179f81bcd904467414dd8eaae09 Mon Sep 17 00:00:00 2001 From: pahenning Date: Wed, 11 Jul 2012 18:02:40 +0000 Subject: [PATCH] Bugfix git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@1722 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/1-Wire/21_OWTHERM.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fhem/contrib/1-Wire/21_OWTHERM.pm b/fhem/contrib/1-Wire/21_OWTHERM.pm index b03a17090..9f5ffcb39 100755 --- a/fhem/contrib/1-Wire/21_OWTHERM.pm +++ b/fhem/contrib/1-Wire/21_OWTHERM.pm @@ -15,7 +15,7 @@ # Prof. Dr. Peter A. Henning, 2012 # Martin Fischer, 2011 # -# Version 2.1 - July, 2012 +# Version 2.12 - July, 2012 # # Setup bus device in fhem.cfg as # @@ -214,7 +214,7 @@ sub OWTHERM_Define ($$) { Log 3, "OWTHERM: Device $name defined."; #-- Start timer for initialization in a few seconds - InternalTimer(time()+1, "OWTHERM_InitializeDevice", $hash, 0); + InternalTimer(time()+10, "OWTHERM_InitializeDevice", $hash, 0); #-- Start timer for updates InternalTimer(time()+$hash->{INTERVAL}, "OWTHERM_GetValues", $hash, 0); @@ -234,6 +234,7 @@ sub OWTHERM_InitializeDevice($) { my ($hash) = @_; my $name = $hash->{NAME}; + my @args; $stateal = defined($attr{$name}{stateAL}) ? $attr{$name}{stateAL} : ""; $stateah = defined($attr{$name}{stateAH}) ? $attr{$name}{stateAH} : ""; @@ -244,11 +245,16 @@ sub OWTHERM_InitializeDevice($) { #-- Initial readings temperature sensor $owg_temp = 0.0; - $owg_tl = -15.0; - $owg_th = 70.0; - + $owg_tl = defined($attr{$name}{"tempLow"}) ? $attr{$name}{"tempLow"} : 0.0; + $owg_th = defined($attr{$name}{"tempHigh"}) ? $attr{$name}{"tempHigh"} : 100.0; #-- Initialize all the display stuff OWTHERM_FormatValues($hash); + #-- alarm + @args = ($name,"tempLow",$owg_tl); + OWTHERM_Set($hash,@args); + @args = ($name,"tempHigh",$owg_th); + OWTHERM_Set($hash,@args); + } ########################################################################################