Where Does convertTemperatureIfNeeded() Live?

One can “guess” at the API, but where is this function documented? Where does it live, code-wise?

Plenty of code references that use it, but I can’t find it in any API reference! @Jim @slagle ???

Thanks, guys…

Bueller? @Jim? Anyone? :grin:

Sigh…

Crickets: Chirp! Chirp!

It’s defined in a base class of the Device Type Handler. The definition is String convertTemperatureIfNeeded(BigDecimal degrees, String currentScale, int precision = 2). It will convert from Celsius to Fahrenheit or vice versa if the currentScale is different than the location temperature scale. The precision argument defines the number of significant digits in the result. Looking at the code I see there is a bug in that it doesn’t look at the precision if it doesn’t need to do a temperature conversion. I’ll create a ticket for that issue.

2 Likes

Thanks so much @tpmanley! Appreciate the response! :+1::sunglasses:

1 Like