Merge pull request 'dev' () from dev into testing

Reviewed-on: 
This commit is contained in:
Marko Oldenburg 2023-01-05 18:36:16 +01:00
commit acdd256e01
2 changed files with 47 additions and 17 deletions

@ -1,4 +1,4 @@
UPD 2023-01-05_08:17:10 55320 FHEM/59_Weather.pm UPD 2023-01-05_08:20:31 55320 FHEM/59_Weather.pm
UPD 2023-01-04_16:37:24 49883 lib/FHEM/APIs/Weather/DarkSkyAPI.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-05_17:01:28 33191 lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm
UPD 2023-01-04_16:37:24 36090 lib/FHEM/APIs/Weather/wundergroundAPI.pm UPD 2023-01-04_16:37:24 36090 lib/FHEM/APIs/Weather/wundergroundAPI.pm

@ -671,10 +671,26 @@ sub _FillSelfHashWithWeatherResponseForForecastHourly {
'cloudCover' => $data->{list}->[$i]->{clouds}->{all}, 'cloudCover' => $data->{list}->[$i]->{clouds}->{all},
'code' => $codes{ $data->{list}->[$i]->{weather}->[0]->{id} }, 'code' => $codes{ $data->{list}->[$i]->{weather}->[0]->{id} },
'iconAPI' => $data->{list}->[$i]->{weather}->[0]->{icon}, 'iconAPI' => $data->{list}->[$i]->{weather}->[0]->{icon},
'rain1h' => $data->{list}->[$i]->{rain}->{'1h'}, 'rain1h' => (
'rain3h' => $data->{list}->[$i]->{rain}->{'3h'}, $data->{list}->[$i]->{rain}->{'1h'}
'snow1h' => $data->{list}->[$i]->{snow}->{'1h'}, ? $data->{list}->[$i]->{rain}->{'1h'}
'snow3h' => $data->{list}->[$i]->{snow}->{'3h'}, : 0
),
'rain3h' => (
$data->{list}->[$i]->{rain}->{'3h'}
? $data->{list}->[$i]->{rain}->{'3h'}
: 0
),
'snow1h' => (
$data->{list}->[$i]->{snow}->{'1h'}
? $data->{list}->[$i]->{snow}->{'1h'}
: 0
),
'snow3h' => (
$data->{list}->[$i]->{snow}->{'3h'}
? $data->{list}->[$i]->{snow}->{'1h'}
: 0
),
} }
); );
@ -711,11 +727,11 @@ sub _FillSelfHashWithWeatherResponseForOnecallCurrent {
sprintf( "%.1f", ( $data->{current}->{wind_gust} * 3.6 ) ) + 0.5 sprintf( "%.1f", ( $data->{current}->{wind_gust} * 3.6 ) ) + 0.5
), ),
'wind_direction' => $data->{current}->{wind_deg}, 'wind_direction' => $data->{current}->{wind_deg},
'rain_1h' => $data->{rain}->{'1h'}, 'rain_1h' => ( $data->{rain}->{'1h'} ? $data->{rain}->{'1h'} : 0 ),
'cloudCover' => $data->{current}->{clouds}, 'cloudCover' => $data->{current}->{clouds},
'code' => $codes{ $data->{current}->{weather}->[0]->{id} }, 'code' => $codes{ $data->{current}->{weather}->[0]->{id} },
'iconAPI' => $data->{current}->{weather}->[0]->{icon}, 'iconAPI' => $data->{current}->{weather}->[0]->{icon},
'condition' => 'condition' =>
encode_utf8( $data->{current}->{weather}->[0]->{description} ), encode_utf8( $data->{current}->{weather}->[0]->{description} ),
'sunsetTime' => _strftimeWrapper( 'sunsetTime' => _strftimeWrapper(
"%a, %e %b %Y %H:%M", "%a, %e %b %Y %H:%M",
@ -836,9 +852,15 @@ sub _FillSelfHashWithWeatherResponseForOnecallDaily {
), ),
'cloudCover' => $data->{daily}->[$i]->{clouds}, 'cloudCover' => $data->{daily}->[$i]->{clouds},
'code' => $codes{ $data->{daily}->[$i]->{weather}->[0]->{id} }, 'code' => $codes{ $data->{daily}->[$i]->{weather}->[0]->{id} },
'rain' => $data->{daily}->[$i]->{rain}, 'rain' => (
'snow' => $data->{daily}->[$i]->{snow}, $data->{daily}->[$i]->{rain} ? $data->{daily}->[$i]->{rain}
'uvi' => $data->{daily}->[$i]->{uvi}, : 0
),
'snow' => (
$data->{daily}->[$i]->{snow} ? $data->{daily}->[$i]->{snow}
: 0
),
'uvi' => $data->{daily}->[$i]->{uvi},
}, },
); );
@ -896,9 +918,17 @@ sub _FillSelfHashWithWeatherResponseForOnecallHourly {
'wind_direction' => $data->{hourly}->[$i]->{wind_deg}, 'wind_direction' => $data->{hourly}->[$i]->{wind_deg},
'cloudCover' => $data->{hourly}->[$i]->{clouds}, 'cloudCover' => $data->{hourly}->[$i]->{clouds},
'code' => $codes{ $data->{hourly}->[$i]->{weather}->[0]->{id} }, 'code' => $codes{ $data->{hourly}->[$i]->{weather}->[0]->{id} },
'iconAPI' => $data->{hourly}->[$i]->{weather}->[0]->{icon}, 'iconAPI' => $data->{hourly}->[$i]->{weather}->[0]->{icon},
'rain1h' => $data->{hourly}->[$i]->{rain}->{'1h'}, 'rain1h' => (
'snow1h' => $data->{hourly}->[$i]->{snow}->{'1h'}, $data->{hourly}->[$i]->{rain}->{'1h'}
? $data->{hourly}->[$i]->{rain}->{'1h'}
: 0
),
'snow1h' => (
$data->{hourly}->[$i]->{snow}->{'1h'}
? $data->{hourly}->[$i]->{snow}->{'1h'}
: 0
),
'uvi' => $data->{hourly}->[$i]->{uvi}, 'uvi' => $data->{hourly}->[$i]->{uvi},
'visibility' => int( 'visibility' => int(
sprintf( "%.1f", $data->{hourly}->[$i]->{visibility} ) + 0.5 sprintf( "%.1f", $data->{hourly}->[$i]->{visibility} ) + 0.5