gluon-core: ignore is_outdoor_device() value on devices without 5GHz radio
This commit is contained in:
parent
5ec08d841d
commit
f4fe58cfd7
@ -1,7 +1,7 @@
|
|||||||
return function(form, uci)
|
return function(form, uci)
|
||||||
local platform = require 'gluon.platform'
|
local platform = require 'gluon.platform'
|
||||||
|
|
||||||
if not platform.is_outdoor_device() then
|
if not (platform.is_outdoor_device() and platform.device_uses_11a(uci)) then
|
||||||
-- only visible on wizard for outdoor devices
|
-- only visible on wizard for outdoor devices
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -22,7 +22,7 @@ if sysconfig.gluon_version then
|
|||||||
outdoor = false
|
outdoor = false
|
||||||
elseif config == 'preset' then
|
elseif config == 'preset' then
|
||||||
-- enable outdoor mode through presets on new installs
|
-- enable outdoor mode through presets on new installs
|
||||||
outdoor = platform.is_outdoor_device()
|
outdoor = platform.is_outdoor_device() and platform.device_uses_11a(uci)
|
||||||
else
|
else
|
||||||
-- enable/disable outdoor mode unconditionally on new installs
|
-- enable/disable outdoor mode unconditionally on new installs
|
||||||
outdoor = config
|
outdoor = config
|
||||||
|
@ -85,4 +85,17 @@ function M.device_supports_mfp(uci)
|
|||||||
return supports_mfp
|
return supports_mfp
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.device_uses_11a(uci)
|
||||||
|
local ret = false
|
||||||
|
|
||||||
|
uci:foreach('wireless', 'wifi-device', function(radio)
|
||||||
|
if radio.hwmode == '11a' or radio.hwmode == '11na' then
|
||||||
|
ret = true
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
return ret
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
Loading…
Reference in New Issue
Block a user