Skip to content

Commit

Permalink
Key the disks by disk number
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Jan 29, 2017
1 parent 2dc1665 commit c513a35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions qnapstats/qnap_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def get_smart_disk_health(self):
if resp is None:
return None

disks = []
disks = {}
for disk in resp["Disk_Info"]["entry"]:
disks.append({
disks[disk["HDNo"]] = {
"drive_number": disk["HDNo"],
"health": disk["Health"],
"temp_c": int(disk["Temperature"]["oC"]),
Expand All @@ -189,7 +189,7 @@ def get_smart_disk_health(self):
"model": disk["Model"],
"serial": disk["Serial"],
"type": "hdd" if int(disk["hd_is_ssd"]) == 0 else "ssd",
})
}

return disks

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name='qnapstats',
description='Python API for obtaining QNAP NAS system stats',
long_description=io.open('README.rst', encoding='utf-8').read(),
version='0.2.0',
version='0.2.1',
license='MIT',
author='Colin O\'Dell',
author_email='colinodell@gmail.com',
Expand Down

0 comments on commit c513a35

Please sign in to comment.