piview.CPU

Module Contents

Classes

CPU

class piview.CPU.CPU[source]
static speed()[source]

Get the CPU frequency using the vcgencmd on Linux based systems

If frequency cannot be determined, returns -1

Return type

integer

Returns

The CPU frequency in MHz

static max_load(random=False)[source]

This function returns the maximum “CPU load” across all CPU cores, or -1 if no value determined.

Providing a random=True parameter value will return a random value if the actual CPU load can’t be determined.

Parameters

random – boolean default False

Return type

float

Returns

The maximum CPU Load in range 0-100

static temperature()[source]

Requests the CPU temperature from the vcgencmd returning the result to the caller as a floating point value to 2DP

If no value can be determined, uses -999.99 as the returned “error” value.

Return type

float

Returns

The CPU temperature in degrees Celsius

static temperature_k()[source]

Provide temperature of the CPU in degrees Kelvin

Returns

CPU Temperature in Kelvin