Add print temperature to CPUTemperature example and add temperature property to docs

This commit is contained in:
Ben Nuttall
2017-07-16 12:21:09 +01:00
parent 6115c78730
commit 319169e9da
2 changed files with 5 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ CPUTemperature
==============
.. autoclass:: CPUTemperature
:members: temperature, is_active
Base Classes
============
@@ -50,4 +51,3 @@ InternalDevice
.. autoclass:: InternalDevice()
:members:

View File

@@ -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()