From 7ce4ce3785682f7c33dc5c809d4db99941e304e0 Mon Sep 17 00:00:00 2001 From: dietmar63 Date: Fri, 16 Aug 2013 18:26:49 +0000 Subject: [PATCH] - bug in Twilight_Get repaired - longitude and latitude now taken from TW definition git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@3718 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/59_Twilight.pm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/fhem/FHEM/59_Twilight.pm b/fhem/FHEM/59_Twilight.pm index e1b1498c7..239859b3c 100644 --- a/fhem/FHEM/59_Twilight.pm +++ b/fhem/FHEM/59_Twilight.pm @@ -37,7 +37,6 @@ use Math::Trig; sub Twilight_calc($$$$$$$); sub Twilight_getWeatherHorizon($); -sub Twilight_GetUpdate($); sub Twilight_my_gmt_offset(); sub Twilight_midnight_seconds(); @@ -84,9 +83,9 @@ sub Twilight_Get($@) my ($hash, @a) = @_; return "argument is missing" if(int(@a) != 2); - $hash->{LOCAL} = 1; - Twilight_GetUpdate($hash); - delete $hash->{LOCAL}; + #$hash->{LOCAL} = 1; + #Twilight_GetUpdate($hash); + #delete $hash->{LOCAL}; my $reading= $a[1]; my $value; @@ -451,11 +450,8 @@ sub Twilight_sunpos($) $dSeconds = 0; ############################ - # If set in global, use longitude/latitude - # from global, otherwise set Frankfurt/Germany as - # default - my $dLongitude = AttrVal("global", "longitude", "8.686"); - my $dLatitude = AttrVal("global", "latitude", "50.112"); + my $dLongitude = $hash->{LONGITUDE}; + my $dLatitude = $hash->{LATITUDE}; Log 5, "Compute sunpos for latitude $dLatitude , longitude $dLongitude"; my $pi=3.14159265358979323846;