diff --git a/FHEM/59_Weather.pm b/FHEM/59_Weather.pm
index 1f956e7..d87bb5f 100755
--- a/FHEM/59_Weather.pm
+++ b/FHEM/59_Weather.pm
@@ -1204,7 +1204,10 @@ sub Weather_CheckOptions {
location | <latitude,longitude>
geographic coordinates in degrees of the location for which the
weather is forecast; if missing, the values of the attributes
@@ -1398,11 +1401,16 @@ sub Weather_CheckOptions {
API | OpenWeatherMapAPI |
- apioptions | cachemaxage:<cachemaxage> Zeitdauer in
+ |
+ apioptions | cachemaxage:<cachemaxage> Zeitdauer in
Sekunden, innerhalb derer die Wettervorhersage nicht neu abgerufen
sondern aus dem Cache zurück geliefert wird. |
version:<version> API Version welche verwendet werden soll.
- Per Default 2.5, möglich ist noch 3.0 aber nur mit Zusatzsubscription |
+ Per Default 2.5, möglich ist noch 3.0 aber nur mit Zusatzsubscription
+ endpoint:onecall nur zum testen ob der API Key welcher nicht
+ offiziell für onecall ist nicht doch onecall über die API Version 2.5 unterstützt. WICHTIG!!!
+ apioption version darf nicht auf 3.0 gesetzt werden |
+
location | <latitude,longitude> Geographische Breite
und Länge des Ortes in Grad, für den das Wetter vorhergesagt wird.
Bei fehlender Angabe werden die Werte aus den gleichnamigen Attributen
@@ -1542,7 +1550,7 @@ sub Weather_CheckOptions {
],
"release_status": "stable",
"license": "GPL_2",
- "version": "v2.2.11",
+ "version": "v2.2.15",
"author": [
"Marko Oldenburg "
],
diff --git a/controls_Weather.txt b/controls_Weather.txt
index f4de39e..7e6e317 100644
--- a/controls_Weather.txt
+++ b/controls_Weather.txt
@@ -1,4 +1,4 @@
-UPD 2022-12-30_12:22:17 54815 FHEM/59_Weather.pm
-UPD 2022-12-30_12:22:17 49883 lib/FHEM/APIs/Weather/DarkSkyAPI.pm
-UPD 2022-12-30_12:22:17 32101 lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm
-UPD 2023-01-02_09:25:12 36090 lib/FHEM/APIs/Weather/wundergroundAPI.pm
+UPD 2023-01-05_08:17:10 55320 FHEM/59_Weather.pm
+UPD 2023-01-04_16:37:24 49883 lib/FHEM/APIs/Weather/DarkSkyAPI.pm
+UPD 2023-01-05_08:05:28 32255 lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm
+UPD 2023-01-04_16:37:24 36090 lib/FHEM/APIs/Weather/wundergroundAPI.pm
diff --git a/hooks/pre-commit b/hooks/pre-commit
new file mode 100755
index 0000000..4fc1c9a
--- /dev/null
+++ b/hooks/pre-commit
@@ -0,0 +1,41 @@
+#!/usr/bin/perl -w
+
+use File::Basename;
+use POSIX qw(strftime);
+use strict;
+
+my @filenames = ( 'FHEM/59_Weather.pm',
+ 'lib/FHEM/APIs/Weather/DarkSkyAPI.pm',
+ 'lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm',
+ 'lib/FHEM/APIs/Weather/wundergroundAPI.pm',
+ );
+
+my $controlsfile = 'controls_Weather.txt';
+
+open(FH, ">$controlsfile") || return("Can't open $controlsfile: $!");
+
+for my $filename (@filenames) {
+ my @statOutput = stat($filename);
+
+ if (scalar @statOutput != 13) {
+ printf 'error: stat has unexpected return value for ' . $filename . "\n";
+ next;
+ }
+
+ my $mtime = $statOutput[9];
+ my $date = POSIX::strftime("%Y-%m-%d", localtime($mtime));
+ my $time = POSIX::strftime("%H:%M:%S", localtime($mtime));
+ my $filetime = $date."_".$time;
+
+ my $filesize = $statOutput[7];
+
+ printf FH 'UPD ' . $filetime . ' ' . $filesize . ' ' .$filename . "\n";
+}
+
+close(FH);
+
+system("git add $controlsfile");
+
+print 'Create controls File succesfully' . "\n";
+
+exit 0;
diff --git a/lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm b/lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm
index 1514290..d5dc975 100644
--- a/lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm
+++ b/lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm
@@ -213,6 +213,8 @@ sub new {
$self->{apiversion} =
( $apioptions->{version} ? $apioptions->{version} : '2.5' );
+ $self->{endpointType} =
+ ( $apioptions->{endpoint} ? $apioptions->{endpoint} : 'forecast' );
$self->{cached} = _CreateForecastRef($self);
@@ -316,7 +318,8 @@ sub _RetrieveDataFromOpenWeatherMap {
timeout => 15,
self => $self,
endpoint => $self->{endpoint} eq 'none'
- ? ( $self->{apiversion} == 3.0 ? 'onecall' : 'weather' )
+ ? ( $self->{apiversion} == 3.0
+ || $self->{endpointType} eq 'onecall' ? 'onecall' : 'weather' )
: 'forecast',
callback => \&_RetrieveDataFinished,
};
@@ -989,7 +992,7 @@ sub _strftimeWrapper {
"abstract": "Wetter API für OpenWeatherMap"
}
},
- "version": "v3.0.12",
+ "version": "v3.0.15",
"author": [
"Marko Oldenburg "
],
| |