summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2023-07-16 01:25:29 -0400
committerJesse Luehrs <doy@tozt.net>2023-07-16 01:25:29 -0400
commit7772131ad274692d7fb71bd8f69241df661835e8 (patch)
tree183b022fe3bcb6d8454fed1d2098edd815aa36bf /bin
parente1d8526040f9bb6b4e84059145e0548f80929165 (diff)
downloadconf-7772131ad274692d7fb71bd8f69241df661835e8.tar.gz
conf-7772131ad274692d7fb71bd8f69241df661835e8.zip
fix weather time zone
Diffstat (limited to 'bin')
-rwxr-xr-xbin/hornet/weather4
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&current_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&current_weather=true&hourly=temperature_2m,apparent_temperature,precipitation_probability");
my $time = $data->{current_weather}{time};
my $hourly = $data->{hourly};
my @forecast;