mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 01:14:19 +00:00
GetHttpFile now uses new Timeout Parameter
git-svn-id: https://svn.fhem.de/fhem/trunk@1432 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c247150e39
commit
5330211f52
@ -7,7 +7,6 @@
|
|||||||
package main;
|
package main;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Switch;
|
|
||||||
use POSIX;
|
use POSIX;
|
||||||
|
|
||||||
sub dayofyear {
|
sub dayofyear {
|
||||||
@ -266,13 +265,17 @@ sub Twilight_getWeatherHorizon{
|
|||||||
my @a_current = (25,25,25,25,20,10,10,10,10,10,10,7,7,7,5,10,10,6,6,6,10,6,6,6,6,6,6,5,5,3,3,0,0,0,0,7,0,15,15,15,9,15,8,5,12,6,8,8);
|
my @a_current = (25,25,25,25,20,10,10,10,10,10,10,7,7,7,5,10,10,6,6,6,10,6,6,6,6,6,6,5,5,3,3,0,0,0,0,7,0,15,15,15,9,15,8,5,12,6,8,8);
|
||||||
#condition codes are described in FHEM wiki and in the documentation of the yahoo weather API
|
#condition codes are described in FHEM wiki and in the documentation of the yahoo weather API
|
||||||
my $location=shift;
|
my $location=shift;
|
||||||
my $xml = GetHttpFile("weather.yahooapis.com:80","/forecastrss?w=".$location."&u=c");
|
my $xml = GetHttpFile("weather.yahooapis.com:80","/forecastrss?w=".$location."&u=c",4.0);
|
||||||
$xml=~/code="(.*)"(\ *)temp/;
|
my $current;
|
||||||
my $current=$1;
|
if($xml=~/code="(.*)"(\ *)temp/){
|
||||||
if(($current>=0) && ($current <=47)) {
|
$current=$1;
|
||||||
return $a_current[$current];
|
if(($current>=0) && ($current <=47)) {
|
||||||
} else {
|
return $a_current[$current];
|
||||||
return 1;
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user