mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-12 16:46:35 +00:00
*** empty log message ***
git-svn-id: https://svn.fhem.de/fhem/trunk@1048 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2d6cda02ea
commit
83bb4a94e9
@ -4,12 +4,13 @@
|
||||
- feature: TCM120/TCM310 + EnOcean parser added
|
||||
- feature: eventMap enhanced
|
||||
- bugfix: enabled logging for 59_Weather.pm (Boris)
|
||||
- feature: language selection for 59_Weather.pm (Erwin)
|
||||
- feature: .gplot files renamed from type to content
|
||||
- bugfix: FS20 on-for-timer error reporting only in the logfile
|
||||
- bugfix: FHEM2FHEM should work with CUL again, after syntax change
|
||||
- feature: CUL directio mode (No Device::SerialPort needed)
|
||||
- feature: FritzBox 7270 ZIP file
|
||||
|
||||
|
||||
- 2011-07-08 (5.1)
|
||||
- feature: smallscreen optimizations for iPhone
|
||||
- feature: FHT8V rewrite (and moved from contrib into the FHEM directory).
|
||||
|
@ -32,7 +32,6 @@ sub Weather_Initialize($) {
|
||||
sub f_to_c($) {
|
||||
|
||||
my ($f)= @_;
|
||||
|
||||
return int(($f-32)*5/9+0.5);
|
||||
}
|
||||
|
||||
@ -42,17 +41,16 @@ sub Weather_UpdateReading($$$$$$) {
|
||||
my ($hash,$prefix,$key,$tn,$value,$n)= @_;
|
||||
|
||||
return 0 if(!defined($value) || $value eq "");
|
||||
return 0 if($key eq "unit_system");
|
||||
|
||||
|
||||
if($key eq "temp") {
|
||||
$key= "temp_c";
|
||||
$value= f_to_c($value);
|
||||
$value= f_to_c($value) if($hash->{READINGS}{unit_system}{VAL} ne "SI"); # assume F to C conversion required
|
||||
} elsif($key eq "low") {
|
||||
$key= "low_c";
|
||||
$value= f_to_c($value);
|
||||
$value= f_to_c($value) if($hash->{READINGS}{unit_system}{VAL} ne "SI");
|
||||
} elsif($key eq "high") {
|
||||
$key= "high_c";
|
||||
$value= f_to_c($value);
|
||||
$key= "high_c";
|
||||
$value= f_to_c($value) if($hash->{READINGS}{unit_system}{VAL} ne "SI");
|
||||
}
|
||||
|
||||
my $reading= $prefix . $key;
|
||||
@ -93,10 +91,11 @@ sub Weather_GetUpdate($)
|
||||
# see http://search.cpan.org/~possum/Weather-Google-0.03/lib/Weather/Google.pm
|
||||
|
||||
my $location= $hash->{LOCATION};
|
||||
my $lang= $hash->{LANG};
|
||||
my $WeatherObj;
|
||||
Log 4, "$name: Updating weather information for $location.";
|
||||
Log 4, "$name: Updating weather information for $location, language $lang.";
|
||||
eval {
|
||||
$WeatherObj= new Weather::Google($location);
|
||||
$WeatherObj= new Weather::Google($location, {language => $lang});
|
||||
};
|
||||
if($@) {
|
||||
Log 1, "$name: Could not retrieve weather information.";
|
||||
@ -165,18 +164,21 @@ sub Weather_Define($$) {
|
||||
|
||||
my @a = split("[ \t][ \t]*", $def);
|
||||
|
||||
return "syntax: define <name> Weather <location> [interval]"
|
||||
if(int(@a) < 3 && int(@a) > 4);
|
||||
return "syntax: define <name> Weather <location> [interval [en|de|fr|es]]"
|
||||
if(int(@a) < 3 && int(@a) > 5);
|
||||
|
||||
$hash->{STATE} = "Initialized";
|
||||
|
||||
my $name = $a[0];
|
||||
my $location = $a[2];
|
||||
my $interval = 3600;
|
||||
if(int(@a)==4) { $interval= $a[3]; }
|
||||
my $lang = "en";
|
||||
if(int(@a)>=4) { $interval= $a[3]; }
|
||||
if(int(@a)==5) { $lang= $a[4]; }
|
||||
|
||||
$hash->{LOCATION} = $location;
|
||||
$hash->{INTERVAL} = $interval;
|
||||
$hash->{LANG} = $lang;
|
||||
$hash->{READINGS}{current_date_time}{TIME}= TimeNow();
|
||||
$hash->{READINGS}{current_date_time}{VAL}= "none";
|
||||
|
||||
|
@ -3729,7 +3729,7 @@ A line ending with \ will be concatenated with the next one, so long lines
|
||||
<a name="Weatherdefine"></a>
|
||||
<b>Define</b>
|
||||
<ul>
|
||||
<code>define <name> Weather <location> [<interval>]</code><br>
|
||||
<code>define <name> Weather <location> [<interval> [en|de|fr|es]]</code><br>
|
||||
<br>
|
||||
Defines a virtual device for weather forecasts. You need to have the perl
|
||||
module Weather::Google installed to use this device. If you do not have it,
|
||||
@ -3743,14 +3743,18 @@ A line ending with \ will be concatenated with the next one, so long lines
|
||||
<code>http://www.google.de/ig/api?weather=location&hl=en</code>
|
||||
to see the raw output for your location.<br><br>
|
||||
|
||||
The parameter <code>interval</code> is the time between subsequent updates
|
||||
The optional parameter <code>interval</code> is the time between subsequent updates
|
||||
in seconds. It defaults to 3600 (1 hour).<br><br>
|
||||
|
||||
The optional language parameter may be one of <code>en</code>, <code>de</code>, <code>fr</code>,
|
||||
<code>es</code>. It determines the natural language in which the forecast information appears.
|
||||
It defaults to en. If you want to set the language you also have to set the interval.<br><br>
|
||||
|
||||
Examples:
|
||||
<pre>
|
||||
define MyWeather Weather "Frankfurt,HE"
|
||||
define Forecast Weather "Amsterdam,NL" 1800
|
||||
define weather Weather "30000,France"
|
||||
define weather Weather "30000,France" 3600 fr
|
||||
</pre>
|
||||
</ul>
|
||||
<br>
|
||||
|
Loading…
x
Reference in New Issue
Block a user