From a81a0d42c2f6bd2ac4e08e5815319c001f5ea1aa Mon Sep 17 00:00:00 2001 From: LeonGaultier Date: Wed, 9 Jun 2021 18:49:19 +0000 Subject: [PATCH] OpenWeatherMapAPI: add wind_gust git-svn-id: https://svn.fhem.de/fhem/trunk@24604 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/OpenWeatherMapAPI.pm | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 09f92a4c8..577b402c6 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # 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: add wind_gust - bugfix: 50_HP1000: change time format for Internal SYSTEMTIME_UTC - bugfix: 73_AutoShuttersControl: add multiple Condition for fixing shutter drives diff --git a/fhem/FHEM/OpenWeatherMapAPI.pm b/fhem/FHEM/OpenWeatherMapAPI.pm index 834b2e360..36c82122d 100644 --- a/fhem/FHEM/OpenWeatherMapAPI.pm +++ b/fhem/FHEM/OpenWeatherMapAPI.pm @@ -423,6 +423,10 @@ sub _ProcessingRetrieveData { sprintf( "%.1f", ( $data->{wind}->{speed} * 3.6 ) ) + 0.5 ), + 'wind_gust' => int( + sprintf( "%.1f", ( $data->{wind}->{gust} * 3.6 ) ) + + 0.5 + ), 'wind_direction' => $data->{wind}->{deg}, 'cloudCover' => $data->{clouds}->{all}, 'code' => $codes{ $data->{weather}->[0]->{id} }, @@ -553,6 +557,15 @@ sub _ProcessingRetrieveData { ) ) + 0.5 ), + 'wind_gust' => int( + sprintf( + "%.1f", + ( + $data->{list}->[$i]->{wind} + ->{gust} * 3.6 + ) + ) + 0.5 + ), 'cloudCover' => $data->{list}->[$i]->{clouds}->{all}, 'code' => $codes{ @@ -660,7 +673,7 @@ sub strftimeWrapper { "abstract": "Wetter API für OpenWeatherMap" } }, - "version": "v1.0.2", + "version": "v1.0.3", "author": [ "Marko Oldenburg " ],