aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/moduleapi.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index fdd2ef30..8710b243 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -295,10 +295,16 @@ function api:get_option_period(name, default_value, min, max)
return math.huge;
end
+ if type(min) == "string" then
+ min = human_io.parse_duration(min);
+ end
if min and ret < min then
self:log("warn", "Config option '%s' out of bounds %g < %g", name, ret, min);
return min;
end
+ if type(max) == "string" then
+ max = human_io.parse_duration(max);
+ end
if max and ret > max then
self:log("warn", "Config option '%s' out of bounds %g > %g", name, ret, max);
return max;