Plugin/Wttr: add sunHour and uvIndex to -sun; decrease cache timeout from 1hr to 15m

This commit is contained in:
Pragmatic Software 2023-01-21 23:32:14 -08:00
parent d8803a4c29
commit d29ec9b6b9
1 changed files with 2 additions and 3 deletions

View File

@ -109,7 +109,7 @@ sub get_wttr {
my %cache_opt = (
'namespace' => 'wttr',
'default_expires_in' => 3600
'default_expires_in' => 900
);
my $location_uri = uri_escape_utf8 $location;
@ -287,8 +287,7 @@ sub get_wttr {
when ('sun') {
my $a = $w->{'astronomy'}->[0];
$result .= "Sun: rise: $a->{'sunrise'}, set: $a->{'sunset'};\n";
}
$result .= "Sun: rise: $a->{'sunrise'}, set: $a->{'sunset'}; hours: $w->{'sunHour'}; UV Index: $c->{'uvIndex'};\n";}
when ('sunhours') { $result .= "Hours of sun: $w->{'sunHour'};\n"; }