def _convert_for_display(self, temp):
        if temp is None:
            return None

        value = convert(temp, self.unit_of_measurement,
                        self.hass.config.temperature_unit)

        if self.hass.config.temperature_unit is TEMP_CELSIUS:
            decimal_count = 1
        else:
            # Users of fahrenheit generally expect integer units.
            decimal_count = 0

        return round(value, decimal_count)
Convert temperature into preferred units for display purposes.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/thermostat/__init__.py/ThermostatDevice._convert_for_display