Skip to content

Commit

Permalink
Add support for TL-WDR4900
Browse files Browse the repository at this point in the history
and probably other old dual band routers as well.
  • Loading branch information
mdagbro committed Aug 26, 2020
1 parent 8a1fe19 commit eb2d434
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion custom_components/tplink_router/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,20 @@ def _update_info(self):
"""
_LOGGER.info("[Original] Loading wireless clients...")

# Check 2.4GHz band
url = 'http:https://{}/userRpm/WlanStationRpm.htm'.format(self.host)
referer = 'http:https://{}'.format(self.host)
page = requests.get(
url, auth=(self.username, self.password),
headers={REFERER: referer}, timeout=4)

# Check 5Ghz band (if available)
url = 'http:https://{}/userRpm/WlanStationRpm_5g.htm'.format(self.host)
page2 = requests.get(
url, auth=(self.username, self.password),
headers={REFERER: referer}, timeout=4)

result = self.parse_macs_hyphens.findall(page.text)
result = self.parse_macs_hyphens.findall(page.text + ' ' + page2.text)

if result:
self.last_results = [mac.replace("-", ":") for mac in result]
Expand Down

0 comments on commit eb2d434

Please sign in to comment.