summaryrefslogtreecommitdiff
path: root/weather-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2020-09-21 20:53:22 -0400
committerGitHub <noreply@github.com>2020-09-21 20:53:22 -0400
commit31213af0082bef8344475dbeb84205f1a7e31c7d (patch)
tree2a8b4cad8363c5a0019466edf86d8ef99941d2f4 /weather-widget
parenta127ffe8efc8ccb91b7a8495c23f67278609df25 (diff)
parent21150bd640f086f617c61b32cde5e45ecfb5158f (diff)
Merge pull request #188 from brucec5/widget-tweaks
Add customizable refresh timeouts to most widgets
Diffstat (limited to 'weather-widget')
-rw-r--r--weather-widget/README.md1
-rw-r--r--weather-widget/weather.lua3
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
)