commit
487aee60dd
@ -326,7 +326,6 @@ sub _ProcessingRetrieveData($$) {
|
|||||||
{
|
{
|
||||||
if ( $response =~ m/^\{.*\}$/ ) {
|
if ( $response =~ m/^\{.*\}$/ ) {
|
||||||
my $data = eval { decode_json( encode_utf8($response) ) };
|
my $data = eval { decode_json( encode_utf8($response) ) };
|
||||||
|
|
||||||
if ($@) {
|
if ($@) {
|
||||||
_ErrorHandling( $self,
|
_ErrorHandling( $self,
|
||||||
'Weather Underground decode JSON err ' . $@ );
|
'Weather Underground decode JSON err ' . $@ );
|
||||||
@ -425,15 +424,20 @@ sub _ProcessingRetrieveData($$) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ref( $data->{daily} ) eq "HASH"
|
if (
|
||||||
and scalar keys %{ $data->{daily} } > 0
|
(
|
||||||
and ref( $data->{daily}{temperatureMin} ) eq "ARRAY"
|
ref( $data->{temperatureMin} ) eq "ARRAY"
|
||||||
and scalar @{ $data->{daily}{temperatureMin} } > 0 )
|
and scalar @{ $data->{temperatureMin} } > 0
|
||||||
|
)
|
||||||
|
|| ( ref( $data->{daily}{temperatureMin} ) eq "ARRAY"
|
||||||
|
and scalar @{ $data->{daily}{temperatureMin} } > 0 )
|
||||||
|
)
|
||||||
{
|
{
|
||||||
### löschen des alten Datensatzes
|
### löschen des alten Datensatzes
|
||||||
delete $self->{cached}{forecast};
|
delete $self->{cached}{forecast};
|
||||||
|
|
||||||
my $data = $data->{daily};
|
my $data =
|
||||||
|
exists( $data->{daily} ) ? $data->{daily} : $data;
|
||||||
my $days = scalar @{ $data->{temperatureMin} };
|
my $days = scalar @{ $data->{temperatureMin} };
|
||||||
|
|
||||||
my $i = 0;
|
my $i = 0;
|
||||||
@ -614,10 +618,7 @@ sub _ProcessingRetrieveData($$) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
push(
|
push(
|
||||||
@{
|
@{ $self->{cached}{forecast}{hourly} },
|
||||||
$self->{cached}{forecast}{daypart}[$day]
|
|
||||||
{$part}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'cloudCover' => $data->{cloudCover}[$i],
|
'cloudCover' => $data->{cloudCover}[$i],
|
||||||
'dayOrNight' => $data->{dayOrNight}[$i],
|
'dayOrNight' => $data->{dayOrNight}[$i],
|
||||||
@ -658,7 +659,7 @@ sub _ProcessingRetrieveData($$) {
|
|||||||
'wxPhraseShort' =>
|
'wxPhraseShort' =>
|
||||||
$data->{wxPhraseShort}[$i],
|
$data->{wxPhraseShort}[$i],
|
||||||
}
|
}
|
||||||
);
|
) if ( defined( $data->{temperature}[$i] ) );
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
$day++ if ( $part eq 'night' );
|
$day++ if ( $part eq 'night' );
|
||||||
@ -743,8 +744,7 @@ sub strftimeWrapper(@) {
|
|||||||
"abstract": "Wetter API für Weather Underground"
|
"abstract": "Wetter API für Weather Underground"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": "v0.0.3",
|
"version": "v1.0.0",
|
||||||
"release_status": "testing",
|
|
||||||
"author": [
|
"author": [
|
||||||
"Julian Pawlowski <julian.pawlowski@gmail.com>"
|
"Julian Pawlowski <julian.pawlowski@gmail.com>"
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user