Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Add icon as device properties #22

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions lakeside/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ def get_devices(username, password):
info = r.json()

for item in info['items']:
if item['device'] is not None:
devices.append({
'address': item['device']['wifi']['lan_ip_addr'],
'code': item['device']['local_code'],
'type': item['device']['product']['product_code'],
'name': item['device']['alias_name'],
'id': item['device']['id'],
})
if item['device'] is not None and item['device']['wifi'] is not None:
entry = dict()
entry['address'] = item['device']['wifi']['lan_ip_addr']
entry['code'] = item['device']['local_code']
entry['type'] = item['device']['product']['product_code']
entry['name'] = item['device']['alias_name']
entry['id'] = item['device']['id']
if item['device']['product']['icon_url'] is not None:
entry['icon_url'] = item['device']['product']['icon_url']
devices.append(entry)

return devices

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

setup(
name='lakeside',
version="0.12",
version="0.13",
author='Matthew Garrett',
author_email='[email protected]',
url='http://github.com/google/python-lakeside',
Expand Down