From c9f1dce6a2e6b0669f9775fd6973d1b886f2b6b1 Mon Sep 17 00:00:00 2001 From: Krzysztof Koziarek Date: Mon, 26 Oct 2015 11:32:00 +0100 Subject: [PATCH] Coding style fixes --- homeassistant/components/device_tracker/ubus.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/device_tracker/ubus.py b/homeassistant/components/device_tracker/ubus.py index a231af02be7..3135993e91b 100644 --- a/homeassistant/components/device_tracker/ubus.py +++ b/homeassistant/components/device_tracker/ubus.py @@ -124,8 +124,7 @@ class UbusDeviceScanner(object): if not self.hostapd: hostapd = _req_json_rpc(self.url, self.session_id, 'list', 'hostapd.*', '') - for key in hostapd.keys(): - self.hostapd.append(key) + self.hostapd.extend(hostapd.keys()) self.last_results = [] results = 0 @@ -135,14 +134,9 @@ class UbusDeviceScanner(object): if result: results = results + 1 - for key in result["clients"].keys(): - self.last_results.append(key) - - if results: - return True - else: - return False + self.last_results.extend(result['clients'].keys()) + return bool(results) def _req_json_rpc(url, session_id, rpcmethod, subsystem, method, **params): """ Perform one JSON RPC operation. """