Skip to content

Commit 29b8c76

Browse files
committed
_noloc
1 parent 8e119a9 commit 29b8c76

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mozloc.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from time import sleep
1717

1818
URL='https://location.services.mozilla.com/v1/geolocate?key=test'
19-
NMCMD = ['nmcli','-fields','BSSID,FREQ,SIGNAL','device','wifi']
19+
NMCMD = ['nmcli','-fields','SSID,BSSID,FREQ,SIGNAL','device','wifi']
2020
NMSCAN = ['nmcli','device','wifi','rescan']
2121

2222

@@ -31,8 +31,10 @@ def get_nmcli():
3131
print('consider slowing scan cadence. {}'.format(e))
3232

3333
dat = pandas.read_csv(BytesIO(ret), sep='\s+', index_col=False,
34-
header=0,usecols=[0,1,3],
35-
names=['macAddress','frequency','signalStrength'])
34+
header=0,usecols=[0,1,2,4], encoding='utf8',
35+
names=['ssid','macAddress','frequency','signalStrength'])
36+
# %% optout
37+
dat = dat[~dat['ssid'].str.endswith('_nomap')]
3638
# %% JSON
3739
jdat = dat.to_json(orient='records')
3840
jdat = '{ "wifiAccessPoints":' + jdat + '}'

0 commit comments

Comments
 (0)