From c77dbaa67b3222a6444af5137206bc425b0976ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Wed, 17 Jun 2015 23:32:33 +0200 Subject: [PATCH] Fix code guidelines --- homeassistant/components/device_tracker/tplink.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/device_tracker/tplink.py b/homeassistant/components/device_tracker/tplink.py index 61771e718a7..49d31a2aefd 100755 --- a/homeassistant/components/device_tracker/tplink.py +++ b/homeassistant/components/device_tracker/tplink.py @@ -69,7 +69,8 @@ class TplinkDeviceScanner(object): host = config[CONF_HOST] username, password = config[CONF_USERNAME], config[CONF_PASSWORD] - self.parse_macs = re.compile('[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}') + self.parse_macs = re.compile('[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-'+ + '[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}') self.host = host self.username = username @@ -89,7 +90,7 @@ class TplinkDeviceScanner(object): def get_device_name(self, device): """ The TP-Link firmware doesn't save the name of the wireless - device. """ + device. """ return None @@ -103,10 +104,11 @@ class TplinkDeviceScanner(object): url = 'http://{}/userRpm/WlanStationRpm.htm'.format(self.host) referer = 'http://{}'.format(self.host) - page = requests.get(url, auth=(self.username, self.password), headers={'referer': referer}) - + page = requests.get(url, auth=(self.username, self.password), + headers={'referer': referer}) + result = self.parse_macs.findall(page.text) - + if result: self.last_results = [] for device_entry in result: