gluon-web-wifi-config: make the code a bit nicer

simple-uci will now delete an option when nil is passed.
This commit is contained in:
Matthias Schiffer 2017-08-08 04:20:39 +02:00
parent 0fee6cc707
commit 73ad23936e
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
1 changed files with 2 additions and 3 deletions

View File

@ -92,10 +92,9 @@ uci:foreach('wireless', 'wifi-device', function(config)
function tp:write(data)
if data == 'default' then
uci:delete('wireless', radio, 'txpower')
else
uci:set('wireless', radio, 'txpower', data)
data = nil
end
uci:set('wireless', radio, 'txpower', data)
end
end)