From b7124ea978c5145b5333fe5c6abc8479be2798db Mon Sep 17 00:00:00 2001 From: Jan-Tarek Butt <buttjantarek@googlemail.com> Date: Sun, 9 Aug 2015 22:33:08 +0200 Subject: [PATCH] convert string to number --- .../lib/gluon/config-mode/wizard/0400-geo-location.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ffnw-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua b/ffnw-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua index 8c5edb8..0d95f5c 100644 --- a/ffnw-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua +++ b/ffnw-config-mode-geo-location/files/lib/gluon/config-mode/wizard/0400-geo-location.lua @@ -55,14 +55,14 @@ function M.handle(data) uci:set("gluon-node-info", sname, "auto_location", data._autolocation) uci:set("gluon-node-info", sname, "static_location", data._staticlocation) - if data._autolocation == '1' then - if data._interval ~= nil and data._interval >= '1' and data._interval <= '43200' then + if tonumber(data._autolocation) == 1 then + if data._interval ~= nil and tonumber(data._interval) >= 1 and tonumber(data._interval) <= 43200 then uci:set("gluon-node-info", sname, "refresh_interval", data._interval) - elseif data._interval > '43200' then + elseif tonumber(data._interval) > 43200 then uci:set("gluon-node-info", sname, "refresh_interval", 43200) end end - if data._staticlocation == '1' and data._latitude ~= nil and data._longitude ~= nil then + if tonumber(data._staticlocation) == 1 and data._latitude ~= nil and data._longitude ~= nil then uci:set("gluon-node-info", sname, "share_location", data._staticlocation) uci:set("gluon-node-info", sname, "latitude", data._latitude) uci:set("gluon-node-info", sname, "longitude", data._longitude) @@ -78,4 +78,4 @@ function M.handle(data) uci:commit("gluon-node-info") end -return M \ No newline at end of file +return M -- GitLab