Added a skip for hostnames/mac addresses on whitelist

This commit is contained in:
Jeroen Oudshoorn
2024-01-17 18:22:42 +01:00
parent 8a64918b55
commit 63f0a761c1

View File

@ -184,13 +184,15 @@ class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer):
for ap in s['wifi']['aps']:
if ap['encryption'] == '' or ap['encryption'] == 'OPEN':
continue
elif ap['hostname'] in whitelist or ap['mac'].lower() in whitelist:
continue
elif ap['hostname'] not in whitelist \
and ap['mac'].lower() not in whitelist \
and ap['mac'][:8].lower() not in whitelist:
if self._filter_included(ap):
aps.append(ap)
except Exception as e:
logging.exception("Error while getting acces points (%s)", e)
logging.exception("Error while getting access points (%s)", e)
aps.sort(key=lambda ap: ap['channel'])
return self.set_access_points(aps)