2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

59_Weather.pm: fix typo in commandref, DarkSkyAPI and OpenWeatherMapAPI: expand error handling

git-svn-id: https://svn.fhem.de/fhem/trunk@18229 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
LeonGaultier 2019-01-13 08:27:18 +00:00
parent 22f626ccd1
commit 5127ae5371
4 changed files with 478 additions and 470 deletions

View File

@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: OpenWeatherMapAPI: DarkSkyAPI: expand error handling
- bugfix: 59_Weather: fix typo in commandref
- feature: 39_alexa.pm: added support autostart of alexa-fhem
added support for pubic FHEM Connector skill
- change: 59_Weather completely reworked

View File

@ -811,7 +811,7 @@ sub WeatherAsHtmlD($;$)
Beispiele:
<pre>
define Forecast Weather apikey=987498ghjgf864
define MyWeather Weather api=OpenWeatherMapAPI,cachemaxage:600 apikey=09878945fdskv876 location=52.4545,13.4545 interval=3600 language=de
define MyWeather Weather API=OpenWeatherMapAPI,cachemaxage:600 apikey=09878945fdskv876 location=52.4545,13.4545 interval=3600 language=de
</pre>
Es folgt die API-spezifische Dokumentation.<p>

View File

@ -189,6 +189,7 @@ sub _ProcessingRetrieveData($$) {
and defined($response)
and $response )
{
if ( $response =~ m/^{.*}$/ ) {
my $data = eval { decode_json($response) };
if ($@) {
@ -483,6 +484,8 @@ sub _ProcessingRetrieveData($$) {
}
}
}
else { _ErrorHandling( $self, 'DarkSky Weather ' . $response ); }
}
## Aufruf der callbackFn
_CallWeatherCallbackFn($self);

View File

@ -243,6 +243,7 @@ sub _ProcessingRetrieveData($$) {
and defined($response)
and $response )
{
if ( $response =~ m/^{.*}$/ ) {
my $data = eval { decode_json($response) };
if ($@) {
@ -438,6 +439,8 @@ sub _ProcessingRetrieveData($$) {
}
}
}
else { _ErrorHandling( $self, 'OpenWeatherMap ' . $response ); }
}
$self->{endpoint} = 'none' if ( $self->{endpoint} eq 'forecast' );