Improve loops and lists (#113269)
* Enable PERF * Enable PERF rule * Enable PERF rule * Don't enable flag yet
This commit is contained in:
parent
8a98fb7cfd
commit
05172d8e4d
30 changed files with 125 additions and 172 deletions
|
@ -89,10 +89,7 @@ class SigfoxAPI:
|
|||
"""Get a list of device types."""
|
||||
url = urljoin(API_URL, "devicetypes")
|
||||
response = requests.get(url, auth=self._auth, timeout=10)
|
||||
device_types = []
|
||||
for device in json.loads(response.text)["data"]:
|
||||
device_types.append(device["id"])
|
||||
return device_types
|
||||
return [device["id"] for device in json.loads(response.text)["data"]]
|
||||
|
||||
def get_devices(self, device_types):
|
||||
"""Get the device_id of each device registered."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue