diff options
Diffstat (limited to 'weather-widget')
-rw-r--r-- | weather-widget/README.md | 1 | ||||
-rw-r--r-- | weather-widget/weather.lua | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/weather-widget/README.md b/weather-widget/README.md index 7410ae0..e573bd4 100644 --- a/weather-widget/README.md +++ b/weather-widget/README.md @@ -30,6 +30,7 @@ It is possible to customize widget by providing a table with all or some of the | show_daily_forecast | false | Show daily forecast section | | icon_pack_name | weather-underground-icons | Name of the icon pack, could be `weather-underground-icon` or `VitalyGorbachev` or create your own, more details below | | icons_extension | `.svg` | File extension of icons in the pack | +| timeout | 120 | How often in seconds the widget refreshes | ### Icons: diff --git a/weather-widget/weather.lua b/weather-widget/weather.lua index ba5b4f3..3d3b8e0 100644 --- a/weather-widget/weather.lua +++ b/weather-widget/weather.lua @@ -137,6 +137,7 @@ local function worker(args) local show_daily_forecast = args.show_daily_forecast local icon_pack_name = args.icons or 'weather-underground-icons' local icons_extension = args.icons_extension or '.png' + local timeout = args.timeout or 120 local owm_one_cal_api = ('https://api.openweathermap.org/data/2.5/onecall' .. @@ -457,7 +458,7 @@ local function worker(args) watch( string.format(GET_FORECAST_CMD, owm_one_cal_api), - 120, -- API limit is 1k req/day; day has 1440 min; every 2 min is good + timeout, -- API limit is 1k req/day; day has 1440 min; every 2 min is good update_widget, weather_widget ) |