dev #23
| @@ -1204,7 +1204,10 @@ sub Weather_CheckOptions { | |||||||
|         <tr><td>apioptions</td><td><code>cachemaxage:<cachemaxage></code><br>duration |         <tr><td>apioptions</td><td><code>cachemaxage:<cachemaxage></code><br>duration | ||||||
|           in seconds to retrieve the forecast from the cache instead from the API</td> |           in seconds to retrieve the forecast from the cache instead from the API</td> | ||||||
|           <td><code>version:<version></code> API version which should be used. |           <td><code>version:<version></code> API version which should be used. | ||||||
|           2.5 by default, 3.0 is still possible but only with an additional subscription</td></tr> |           2.5 by default, 3.0 is still possible but only with an additional subscription</td> | ||||||
|  |           <td><code>endpoint:onecall</code> only to test whether the API key which not | ||||||
|  |           officially for onecall is not supported yet onecall via API version 2.5. IMPORTANT!!! | ||||||
|  |           apioption version must not be set to 3.0</td></tr> | ||||||
|         <tr><td>location</td><td><code><latitude,longitude></code><br> |         <tr><td>location</td><td><code><latitude,longitude></code><br> | ||||||
|           geographic coordinates in degrees of the location for which the |           geographic coordinates in degrees of the location for which the | ||||||
|           weather is forecast; if missing, the values of the attributes |           weather is forecast; if missing, the values of the attributes | ||||||
| @@ -1398,11 +1401,16 @@ sub Weather_CheckOptions { | |||||||
|  |  | ||||||
|     <table> |     <table> | ||||||
|     <tr><td>API</td><td><code>OpenWeatherMapAPI</code></td></tr> |     <tr><td>API</td><td><code>OpenWeatherMapAPI</code></td></tr> | ||||||
|     <tr><td>apioptions</td><td><code>cachemaxage:<cachemaxage></code> Zeitdauer in |     <tr> | ||||||
|  |       <td>apioptions</td><td><code>cachemaxage:<cachemaxage></code> Zeitdauer in | ||||||
|       Sekunden, innerhalb derer die Wettervorhersage nicht neu abgerufen |       Sekunden, innerhalb derer die Wettervorhersage nicht neu abgerufen | ||||||
|       sondern aus dem Cache zurück geliefert wird.</td> |       sondern aus dem Cache zurück geliefert wird.</td> | ||||||
|       <td><code>version:<version></code> API Version welche verwendet werden soll. |       <td><code>version:<version></code> API Version welche verwendet werden soll. | ||||||
|       Per Default 2.5, möglich ist noch 3.0 aber nur mit Zusatzsubscription</td></tr> |       Per Default 2.5, möglich ist noch 3.0 aber nur mit Zusatzsubscription</td> | ||||||
|  |       <td><code>endpoint:onecall</code> 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</td> | ||||||
|  |     </tr> | ||||||
|     <tr><td>location</td><td><code><latitude,longitude></code> Geographische Breite |     <tr><td>location</td><td><code><latitude,longitude></code> Geographische Breite | ||||||
|       und Länge des Ortes in Grad, für den das Wetter vorhergesagt wird. |       und Länge des Ortes in Grad, für den das Wetter vorhergesagt wird. | ||||||
|       Bei fehlender Angabe werden die Werte aus den gleichnamigen Attributen |       Bei fehlender Angabe werden die Werte aus den gleichnamigen Attributen | ||||||
| @@ -1542,7 +1550,7 @@ sub Weather_CheckOptions { | |||||||
|   ], |   ], | ||||||
|   "release_status": "stable", |   "release_status": "stable", | ||||||
|   "license": "GPL_2", |   "license": "GPL_2", | ||||||
|   "version": "v2.2.11", |   "version": "v2.2.15", | ||||||
|   "author": [ |   "author": [ | ||||||
|     "Marko Oldenburg <fhemdevelopment@cooltux.net>" |     "Marko Oldenburg <fhemdevelopment@cooltux.net>" | ||||||
|   ], |   ], | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| UPD 2022-12-30_12:22:17 54815 FHEM/59_Weather.pm | UPD 2023-01-05_08:17:10 55320 FHEM/59_Weather.pm | ||||||
| UPD 2022-12-30_12:22:17 49883 lib/FHEM/APIs/Weather/DarkSkyAPI.pm | UPD 2023-01-04_16:37:24 49883 lib/FHEM/APIs/Weather/DarkSkyAPI.pm | ||||||
| UPD 2022-12-30_12:22:17 32101 lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm | UPD 2023-01-05_08:05:28 32255 lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm | ||||||
| UPD 2023-01-02_09:25:12 36090 lib/FHEM/APIs/Weather/wundergroundAPI.pm | UPD 2023-01-04_16:37:24 36090 lib/FHEM/APIs/Weather/wundergroundAPI.pm | ||||||
|   | |||||||
							
								
								
									
										41
									
								
								hooks/pre-commit
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										41
									
								
								hooks/pre-commit
									
									
									
									
									
										Executable file
									
								
							| @@ -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; | ||||||
| @@ -213,6 +213,8 @@ sub new { | |||||||
|  |  | ||||||
|     $self->{apiversion} = |     $self->{apiversion} = | ||||||
|       ( $apioptions->{version} ? $apioptions->{version} : '2.5' ); |       ( $apioptions->{version} ? $apioptions->{version} : '2.5' ); | ||||||
|  |     $self->{endpointType} = | ||||||
|  |       ( $apioptions->{endpoint} ? $apioptions->{endpoint} : 'forecast' ); | ||||||
|  |  | ||||||
|     $self->{cached} = _CreateForecastRef($self); |     $self->{cached} = _CreateForecastRef($self); | ||||||
|  |  | ||||||
| @@ -316,7 +318,8 @@ sub _RetrieveDataFromOpenWeatherMap { | |||||||
|         timeout  => 15, |         timeout  => 15, | ||||||
|         self     => $self, |         self     => $self, | ||||||
|         endpoint => $self->{endpoint} eq 'none' |         endpoint => $self->{endpoint} eq 'none' | ||||||
|         ? ( $self->{apiversion} == 3.0 ? 'onecall' : 'weather' ) |         ? ( $self->{apiversion} == 3.0 | ||||||
|  |               || $self->{endpointType} eq 'onecall' ? 'onecall' : 'weather' ) | ||||||
|         : 'forecast', |         : 'forecast', | ||||||
|         callback => \&_RetrieveDataFinished, |         callback => \&_RetrieveDataFinished, | ||||||
|     }; |     }; | ||||||
| @@ -989,7 +992,7 @@ sub _strftimeWrapper { | |||||||
|       "abstract": "Wetter API für OpenWeatherMap" |       "abstract": "Wetter API für OpenWeatherMap" | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   "version": "v3.0.12", |   "version": "v3.0.15", | ||||||
|   "author": [ |   "author": [ | ||||||
|     "Marko Oldenburg <fhemdevelopment@cooltux.net>" |     "Marko Oldenburg <fhemdevelopment@cooltux.net>" | ||||||
|   ], |   ], | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user