commit 75dd3bbcc2dafdb6bf6f18916ba45a6893149060 parent 2ccd045ba0441a7cb7c803a5a0bf30e64aa411e5 Author: Demonstrandum <moi@knutsen.co> Date: Wed, 2 Dec 2020 23:54:26 +0000 Array.prototype.reverse is in-place. Sigh. Diffstat:
M | lib/commands/weather.ts | | | 8 | ++++---- |
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/commands/weather.ts b/lib/commands/weather.ts @@ -65,12 +65,12 @@ export default async (home_scope: HomeScope) => { .Address .country_code; - const lon_lat = geo_object.Point.pos.split(' '); - tz = tzlookup(...lon_lat.reverse()) + const [lon, lat] = geo_object.Point.pos.split(' '); + tz = tzlookup(lat, lon) weather_info = await fetch( - `${WEATHER_URL}?lat=${lon_lat[1]}&lon=${lon_lat[0]}`); + `${WEATHER_URL}?lat=${lat}&lon=${lon}`); openweather_info = await fetch( - `${OPENWEATHER_URL}?lat=${lon_lat[1]}&lon=${lon_lat[0]}` + `${OPENWEATHER_URL}?lat=${lat}&lon=${lon}` + `&units=metric&appid=${SECRETS.openweather.key}`); } catch (e) { return error(e);