Align temperature conversion with other converters (#79521)
* Align temperature conversion with other converters * Add comments and docstring * Align tests
This commit is contained in:
parent
47b40e1e61
commit
825f9502ad
4 changed files with 48 additions and 63 deletions
|
@ -819,7 +819,9 @@ def temperature_from_object(hass, temp_obj, interval=False):
|
|||
# convert to Celsius if absolute temperature
|
||||
temp -= 273.15
|
||||
|
||||
return TemperatureConverter.convert(temp, from_unit, to_unit, interval=interval)
|
||||
if interval:
|
||||
return TemperatureConverter.convert_interval(temp, from_unit, to_unit)
|
||||
return TemperatureConverter.convert(temp, from_unit, to_unit)
|
||||
|
||||
|
||||
@HANDLERS.register(("Alexa.ThermostatController", "SetTargetTemperature"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue