gluon-core: ignore is_outdoor_device() value on devices without 5GHz radio

This commit is contained in:
Matthias Schiffer 2020-05-07 00:19:33 +02:00
parent 5ec08d841d
commit f4fe58cfd7
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
3 changed files with 15 additions and 2 deletions

View File

@ -1,7 +1,7 @@
return function(form, uci)
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
return
end

View File

@ -22,7 +22,7 @@ if sysconfig.gluon_version then
outdoor = false
elseif config == 'preset' then
-- 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
-- enable/disable outdoor mode unconditionally on new installs
outdoor = config

View File

@ -85,4 +85,17 @@ function M.device_supports_mfp(uci)
return supports_mfp
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