diff --git a/src/espmega_iot_core.cpp b/src/espmega_iot_core.cpp index 30f53b1..cfece8d 100644 --- a/src/espmega_iot_core.cpp +++ b/src/espmega_iot_core.cpp @@ -699,10 +699,10 @@ void ac_set_state(int mode, int temperature, int fan_speed) { ac_mode = mode; ac_temperature = temperature; - if (ac_temperatureAC_MAX_TEMPERATURE) - ac_temperature=AC_MAX_TEMPERATURE; + if (ac_temperature < AC_MIN_TEMPERATURE) + ac_temperature = AC_MIN_TEMPERATURE; + else if (ac_temperature > AC_MAX_TEMPERATURE) + ac_temperature = AC_MAX_TEMPERATURE; ac_fan_speed = fan_speed; temperature -= AC_MIN_TEMPERATURE;