Skip to content

Commit 2ec518e

Browse files
authored
Merge pull request #66 from chadrockey/rescan
Add rescan parameter to nmcli device wifi
2 parents e45f070 + 796c849 commit 2ec518e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nmcli/_device.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,13 @@ def delete(self, ifname: str, wait: int = None) -> None:
145145
wait) + ['device', 'delete', ifname]
146146
self._syscmd.nmcli(cmd)
147147

148-
def wifi(self, ifname: str = None) -> List[DeviceWifi]:
148+
def wifi(self, ifname: str = None, rescan: bool = None) -> List[DeviceWifi]:
149149
cmd = ['-t', '-f', 'IN-USE,SSID,BSSID,MODE,CHAN,FREQ,RATE,SIGNAL,SECURITY',
150150
'device', 'wifi', 'list']
151151
if ifname is not None:
152152
cmd += ['ifname', ifname]
153+
if rescan is not None:
154+
cmd += ['--rescan', 'yes' if rescan else 'no']
153155
r = self._syscmd.nmcli(cmd)
154156
results = []
155157
rows = r.split('\n')

0 commit comments

Comments
 (0)