A comment on my pictures/post of my installation from mrburns42 regarding temperature extremes prompted me to add some code to the interval program home page to display the CPU temp as a just-in-case/visibility measure. This is the first time I’ve ever touched Python so forgive any amateurishness and please post any improvements.
Added to ospi.py under Function Definitions:
def getCPUtemperature():
res = os.popen('vcgencmd measure_temp').readline()
return(res.replace("temp=","").replace("'Cn",""))
Added to ospi.py under Class definitions, home, Get(self):
homepg += 'n'
Modified home.js:
w("Device Time: "+datestr(devt*1000)+"
");
w("CPU Temp: "+(cputemp)+"
");
This displays the temp in Fahrenheit (you can see the calculation above converting from Celcius). A potential expansion/improvement would be to add a setting in options F or C and then of course, display the temp value based on that setting.