export const celsiusToFahrenheit = (t) => (typeof t === 'number' ? (t * 9) / 5 + 32 : t);
export const fahrenheitToCelsius = (t) => (typeof t === 'number' ? (t - 32) * (5 / 9) : t);
export const getCoolingSetPointCelsius = (variables, device) => {
    if (variables.cooling_set_point_celsius != null) {
        return variables.cooling_set_point_celsius;
    }
    if (variables.cooling_set_point_fahrenheit != null) {
        return fahrenheitToCelsius(variables.cooling_set_point_fahrenheit);
    }
    return (device.properties.current_climate_setting?.cooling_set_point_celsius ??
        undefined);
};
export const getCoolingSetPointFahrenheit = (variables, device) => {
    if (variables.cooling_set_point_fahrenheit != null) {
        return variables.cooling_set_point_fahrenheit;
    }
    if (variables.cooling_set_point_celsius != null) {
        return celsiusToFahrenheit(variables.cooling_set_point_celsius);
    }
    return (device.properties.current_climate_setting?.cooling_set_point_fahrenheit ??
        undefined);
};
export const getHeatingSetPointCelsius = (variables, device) => {
    if (variables.heating_set_point_celsius != null) {
        return variables.heating_set_point_celsius;
    }
    if (variables.heating_set_point_fahrenheit != null) {
        return fahrenheitToCelsius(variables.heating_set_point_fahrenheit);
    }
    return (device.properties.current_climate_setting?.heating_set_point_celsius ??
        undefined);
};
export const getHeatingSetPointFahrenheit = (variables, device) => {
    if (variables.heating_set_point_fahrenheit != null) {
        return variables.heating_set_point_fahrenheit;
    }
    if (variables.heating_set_point_celsius != null) {
        return celsiusToFahrenheit(variables.heating_set_point_celsius);
    }
    return (device.properties.current_climate_setting?.heating_set_point_fahrenheit ??
        undefined);
};
export function getTemperatureUnitSymbol(type) {
    return type === 'fahrenheit' ? '°F' : '°C';
}
//# sourceMappingURL=unit-conversion.js.map