Skip to content

Feature request: add to Device a method that returns a dictionary of SMART attributes #92

@f18m

Description

@f18m

Hi @ralequi ,
In this comment: #86 (comment)
you mentioned that it should already be possible to access the properties of the Device class as a dictionary via dict.
However using e.g.

sudo python3 -c 'import pySMART, pprint; pprint.pprint(pySMART.Device("/dev/sda").__dict__)'

I noticed that the Device class dictionary does not contain any "temperature" key, just an empty "temperatures" (plural) key.
Instead the output of

sudo python3 -c 'import pySMART, pprint; pprint.pprint(pySMART.Device("/dev/sda").__getstate__())'

does include the "temperature" attribute (populated with valid data). However using a non-documented getstate() function from 3rd party programs does not seem a stable/solid solution.

Thus my question is: would you consider adding to Device() class a method that returns all SMART attributes as a dictionary?
I think this would simplify usage from other utilities. Thanks!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions