function weather.forecast_update()
local cmd = string.format(forecast_call, city_id, units, lang, APPID) -- needs refactoring
helpers.async(cmd, function(f)
local err
weather_now, _, err = json.decode(f, 1, nil)
if not err and type(weather_now) == "table" and tonumber(weather_now["cod"]) == 200 then
weather.notification_text = ""
for i = 1, weather_now["cnt"], weather_now["cnt"]//cnt do
weather.notification_text = weather.notification_text ..
notification_text_fun(weather_now["list"][i])
if i < weather_now["cnt"] then
weather.notification_text = weather.notification_text .. "\n"
end
end
end
end)
end