-
-
Notifications
You must be signed in to change notification settings - Fork 259
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I want to display the uptime, which is quite a common information to display on such devices.
I tried by myself, adding stuff in library/sensors/sensors.py
and library/stats.py
, but I failed miserably. That sounds quite easy to do if you know the code better than I do.
I couldn't find any pythonish way of getting the current uptime, but this code does the trick on linux:
from datetime import timedelta
with open('/proc/uptime', 'r') as f: uptime_s = float(f.readline().split()[0])
uptime_string = str(timedelta(seconds=uptime_s))
NurNano
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request