diff --git a/docs/api_other.rst b/docs/api_other.rst index ea78c07..7193b7e 100644 --- a/docs/api_other.rst +++ b/docs/api_other.rst @@ -31,6 +31,7 @@ CPUTemperature ============== .. autoclass:: CPUTemperature + :members: temperature, is_active Base Classes ============ @@ -50,4 +51,3 @@ InternalDevice .. autoclass:: InternalDevice() :members: - diff --git a/gpiozero/other_devices.py b/gpiozero/other_devices.py index 1f51f7e..ea31802 100644 --- a/gpiozero/other_devices.py +++ b/gpiozero/other_devices.py @@ -87,10 +87,12 @@ class CPUTemperature(InternalDevice): # Use minimums and maximums that are closer to "normal" usage so the # bar graph is a bit more "lively" - temp = CPUTemperature(min_temp=50, max_temp=90) + cpu = CPUTemperature(min_temp=50, max_temp=90) + + print('Initial temperature: {}C'.format(cpu.temperature)) graph = LEDBarGraph(5, 6, 13, 19, 25, pwm=True) - graph.source = temp.values + graph.source = cpu.values pause()