INNER CODE UNIT · Python

idle_sum

evilsocket/pwnagotchi · pwnagotchi/__init__.py:95

    idle_sum = idle + iowait
    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 source record →

📰 Research Paper
Loading…
⏳ Fetching content…