From 047b4abd822e8ad65b45d2fa66d531bcc254d221 Mon Sep 17 00:00:00 2001 From: Nolan Gilley Date: Tue, 25 Aug 2015 09:39:00 -0400 Subject: [PATCH] Fix get_device_name and get_actiontec_data --- homeassistant/components/device_tracker/actiontec.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/device_tracker/actiontec.py b/homeassistant/components/device_tracker/actiontec.py index d9e89ab7157..bbf20b09232 100644 --- a/homeassistant/components/device_tracker/actiontec.py +++ b/homeassistant/components/device_tracker/actiontec.py @@ -95,8 +95,8 @@ class ActiontecDeviceScanner(object): if not self.last_results: return None for client in self.last_results: - if client == device: - return client + if client['mac'] == device: + return client['ip'] return None @Throttle(MIN_TIME_BETWEEN_SCANS) @@ -130,14 +130,13 @@ class ActiontecDeviceScanner(object): telnet.read_until(prompt) leases_result = telnet.read_until(prompt).split(b'\n')[1:-1] telnet.write('exit\n'.encode('ascii')) - return None except EOFError: _LOGGER.exception("Unexpected response from router") return except ConnectionRefusedError: _LOGGER.exception("Connection refused by router," + " is telnet enabled?") - return + return None devices = {} for lease in leases_result: