From fc0a7943b5fca3c06dc34039876e4e77fab627f2 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 6 Jan 2018 14:30:17 -0800 Subject: [PATCH] Pull out the list of device data --- example.py | 2 +- wideq.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example.py b/example.py index 04b42ce..efc2e22 100644 --- a/example.py +++ b/example.py @@ -61,7 +61,7 @@ def example(): # Request a list of devices. devices = wideq.get_devices(api_root, access_token, session_id) - print(devices) + print_devices(devices) if __name__ == '__main__': diff --git a/wideq.py b/wideq.py index 422f94f..2d9a8c1 100644 --- a/wideq.py +++ b/wideq.py @@ -91,4 +91,4 @@ def get_devices(api_root, access_token, session_id): 'Accept': 'application/json', } res = requests.post(url, json=req_data, headers=headers) - return res.json()[DATA_ROOT] + return res.json()[DATA_ROOT]['item']