INNER CODE UNIT · Python
non_idle_sum
evilsocket/pwnagotchi · pwnagotchi/__init__.py:96
non_idle_sum = user + nice + sys + irq + softirq + steal
total = idle_sum + non_idle_sum
return non_idle_sum / total
def temperature(celsius=True):
with open('/sys/class/thermal/thermal_zone0/temp', 'rt') as fp:
temp = int(fp.read().strip())
c = int(temp / 1000)
return c if celsius else ((c * (9 / 5)) + 32)
def shutdown():
logging.warning("shutting down ...")
from pwnagotchi.ui import view
if view.ROOT:
view.ROOT.on_shutdown()