Skip to content

Commit a16a91f

Browse files
committed
[fix] Fixed parsing wifi interface boolean typecasting
1 parent 226c983 commit a16a91f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

netjsonconfig/backends/openwrt/converters/wireless.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ def __netjson_wifi_typecast(self, wifi):
209209
'ft_psk_generate_local',
210210
'ieee80211r',
211211
'rsn_preauth',
212+
'isolate',
213+
'doth',
214+
'wmm',
215+
'short_preamble',
216+
'start_disabled',
217+
'default_disabled',
212218
]:
213219
if attr in wifi:
214220
wifi[attr] = wifi[attr] == '1'
@@ -255,7 +261,7 @@ def __netjson_wifi_typecast(self, wifi):
255261
'wps_pin',
256262
]
257263

258-
def __netjson_encryption(self, wifi): # noqa: max-complexity: 11
264+
def __netjson_encryption(self, wifi): # noqa: C901
259265
if 'encryption' not in wifi:
260266
return
261267
settings = {}

tests/openwrt/test_wireless.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class TestWireless(unittest.TestCase, _TabsMixin):
3030
"ack_distance": 300,
3131
"rts_threshold": 1300,
3232
"frag_threshold": 1500,
33+
"isolate": True,
3334
},
3435
}
3536
]
@@ -53,6 +54,7 @@ class TestWireless(unittest.TestCase, _TabsMixin):
5354
option frag '1500'
5455
option hidden '1'
5556
option ifname 'wlan0'
57+
option isolate '1'
5658
option mode 'ap'
5759
option network 'wlan0'
5860
option rts '1300'

0 commit comments

Comments
 (0)