Open milindpatel63 opened 2 years ago
I'm no longer have a device to test and fix. You can fix it and make a PR.
Issue was, I was using the router in access point mode with 5Ghz in Client Mode....
So the 5Ghz page looked like this in HTML
Operation Mode : AP-Client
WPHY Mode : 11n/ac
Channel Main : 36
AP-Client Connection
----------------------------------------
BSSID PhyMode BW MCS SGI LDPC STBC TRate RSSI
The PSM and Connect Time Columns were missing....
So I modified the code by separating the two pages HTML output and in 5ghz, removed those 2 values... Like this
self.last_results = []
debug = []
res2gh = r_2g['text']
res5gh = r_5g['text']
for line in res2gh.split('\n'):
m = re.match("^((.{2}:){5}.{2}) ", line)
if m:
values = line.split()
rssi = int(values[8])
debug.append({'mac': values[0], 'rssi': rssi, 'psm': values[9], 'time': values[10],
'bw': values[2], 'mcs': values[3], })
if self.rssi_min and rssi < self.rssi_min:
continue
self.last_results.append(m.group(1))
for line in res5gh.split('\n'):
m = re.match("^((.{2}:){5}.{2}) ", line)
if m:
values = line.split()
rssi = int(values[8])
debug.append({'mac': values[0], 'rssi': rssi,
'bw': values[2], 'mcs': values[3], })
if self.rssi_min and rssi < self.rssi_min:
continue
self.last_results.append(m.group(1))
_LOGGER.info('results %s', str(debug))
But this won't work for other people....
I'm not that good in coding....you could modify it to work better.... Or if someone has similar issue, they might find this comment helpful.