Skip to content

Commit c513a35

Browse files
committed
Key the disks by disk number
1 parent 2dc1665 commit c513a35

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

qnapstats/qnap_stats.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ def get_smart_disk_health(self):
178178
if resp is None:
179179
return None
180180

181-
disks = []
181+
disks = {}
182182
for disk in resp["Disk_Info"]["entry"]:
183-
disks.append({
183+
disks[disk["HDNo"]] = {
184184
"drive_number": disk["HDNo"],
185185
"health": disk["Health"],
186186
"temp_c": int(disk["Temperature"]["oC"]),
@@ -189,7 +189,7 @@ def get_smart_disk_health(self):
189189
"model": disk["Model"],
190190
"serial": disk["Serial"],
191191
"type": "hdd" if int(disk["hd_is_ssd"]) == 0 else "ssd",
192-
})
192+
}
193193

194194
return disks
195195

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
name='qnapstats',
1010
description='Python API for obtaining QNAP NAS system stats',
1111
long_description=io.open('README.rst', encoding='utf-8').read(),
12-
version='0.2.0',
12+
version='0.2.1',
1313
license='MIT',
1414
author='Colin O\'Dell',
1515
author_email='[email protected]',

0 commit comments

Comments
 (0)