export const getHeatBounds = ({ mode, minHeat, maxHeat, maxCool, delta, }) => {
    const actualMaxHeat = mode === 'heat_cool' ? Math.min(maxHeat - delta, maxCool - delta) : maxHeat;
    return { min: minHeat, max: actualMaxHeat };
};
export const getCoolBounds = ({ mode, minHeat, minCool, maxCool, delta, }) => {
    const actualMinCool = mode === 'heat_cool' ? Math.max(minCool + delta, minHeat + delta) : minCool;
    return { min: actualMinCool, max: maxCool };
};
export const getTemperatureBounds = (controlBounds) => ({
    heat: getHeatBounds(controlBounds),
    cool: getCoolBounds(controlBounds),
});
export const getSupportedThermostatModes = (device) => {
    const allModes = ['heat', 'cool', 'heat_cool', 'off'];
    return allModes.filter((mode) => {
        switch (mode) {
            case 'cool':
                return device.properties.is_cooling_available;
            case 'heat':
                return device.properties.is_heating_available;
            case 'heat_cool':
                return (device.properties.is_heating_available &&
                    device.properties.is_cooling_available);
            default:
                return true;
        }
    });
};
//# sourceMappingURL=temperature-bounds.js.map