diff options
-rwxr-xr-x | bin/hornet/weather | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/hornet/weather b/bin/hornet/weather index c47301c..1cbbffb 100755 --- a/bin/hornet/weather +++ b/bin/hornet/weather @@ -19,8 +19,10 @@ if (length($location) == 5) { $location = zip_location($location); } (my $lat, my $lon) = split ',', $location; +my $tz = readlink("/etc/localtime"); +$tz =~ s{^/usr/share/zoneinfo/}{}; -my $data = slurp_http("https://api.open-meteo.com/v1/forecast?latitude=$lat&longitude=$lon¤t_weather=true&hourly=temperature_2m,apparent_temperature,precipitation_probability"); +my $data = slurp_http("https://api.open-meteo.com/v1/forecast?latitude=$lat&longitude=$lon&timezone=$tz¤t_weather=true&hourly=temperature_2m,apparent_temperature,precipitation_probability"); my $time = $data->{current_weather}{time}; my $hourly = $data->{hourly}; my @forecast; |