Getting motor temp in Celsius in Python

I’m using Python to program our robot and I’m trying to print the motor temperatures to the brain screen in Celsius. I know there’s a formula to convert from percent to Celsius: V5 Motor Temp in Percent? - #4 by jpearman, but is there a command in Python that returns the temperature directly in Celsius? I found how to do it in C++ but couldn’t figure out how to do it in Python.

The default is Celsius

>>> m=Motor(Ports.PORT1)
>>> m.temperature()
30.0
>>> m.temperature(TemperatureUnits.CELSIUS)
30.0
>>> m.temperature(TemperatureUnits.FAHRENHEIT)
86.0
>>> 
4 Likes