diff --git a/src/IRac.cpp b/src/IRac.cpp index 55425a112..8a928b822 100644 --- a/src/IRac.cpp +++ b/src/IRac.cpp @@ -469,19 +469,27 @@ void IRac::amcor(IRAmcorAc *ac, /// @param[in] on The power setting. /// @param[in] mode The operation mode setting. /// @param[in] degrees The temperature setting in degrees. +/// @param[in] sensorTemp The room (iFeel) temperature sensor reading in degrees +/// Celsius. /// @param[in] fan The speed setting for the fan. /// @param[in] swingv The vertical swing setting. +/// @param[in] iFeel Whether to enable iFeel (remote temp) mode on the A/C unit. /// @param[in] turbo Run the device in turbo/powerful mode. /// @param[in] sleep Nr. of minutes for sleep mode. /// @note -1 is Off, >= 0 is on. void IRac::argo(IRArgoAC *ac, const bool on, const stdAc::opmode_t mode, const float degrees, - const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, + const float sensorTemp, const stdAc::fanspeed_t fan, + const stdAc::swingv_t swingv, const bool iFeel, const bool turbo, const int16_t sleep) { ac->begin(); ac->setPower(on); ac->setMode(ac->convertMode(mode)); - ac->setTemp(degrees); + ac->setTemp(static_cast(degrees + 0.5)); + if (sensorTemp != kNoTempValue) { + ac->setSensorTemp(static_cast(sensorTemp + 0.5)); + } + ac->setiFeel(iFeel); ac->setFan(ac->convertFan(fan)); ac->setFlap(ac->convertSwingV(swingv)); // No Quiet setting available. @@ -523,9 +531,9 @@ void IRac::argoWrem3_ACCommand(IRArgoAC_WREM3 *ac, const bool on, if (sensorTemp != kNoTempValue) { ac->setSensorTemp(static_cast(sensorTemp + 0.5)); } + ac->setiFeel(iFeel); ac->setFan(ac->convertFan(fan)); ac->setFlap(ac->convertSwingV(swingv)); - ac->setiFeel(iFeel); ac->setNight(night); ac->setEco(econo); ac->setMax(turbo); @@ -683,9 +691,12 @@ void IRac::carrier64(IRCarrierAc64 *ac, /// @param[in] on The power setting. /// @param[in] mode The operation mode setting. /// @param[in] degrees The temperature setting in degrees. +/// @param[in] sensorTemp The room (iFeel) temperature sensor reading in degrees +/// Celsius. /// @param[in] fan The speed setting for the fan. /// @param[in] swingv The vertical swing setting. /// @param[in] swingh The horizontal swing setting. +/// @param[in] iFeel Whether to enable iFeel (remote temp) mode on the A/C unit. /// @param[in] turbo Run the device in turbo/powerful mode. /// @param[in] light Turn on the LED/Display mode. /// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc @@ -693,10 +704,11 @@ void IRac::carrier64(IRCarrierAc64 *ac, /// @note -1 is Off, >= 0 is on. void IRac::coolix(IRCoolixAC *ac, const bool on, const stdAc::opmode_t mode, - const float degrees, const stdAc::fanspeed_t fan, + const float degrees, const float sensorTemp, + const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, const stdAc::swingh_t swingh, - const bool turbo, const bool light, const bool clean, - const int16_t sleep) { + const bool iFeel, const bool turbo, const bool light, + const bool clean, const int16_t sleep) { ac->begin(); ac->setPower(on); if (!on) { @@ -713,6 +725,12 @@ void IRac::coolix(IRCoolixAC *ac, // No Clock setting available. // No Econo setting available. // No Quiet setting available. + if (sensorTemp != kNoTempValue) { + ac->setSensorTemp(static_cast(sensorTemp + 0.5)); + } else { + ac->clearSensorTemp(); + } + ac->setZoneFollow(iFeel); ac->send(); // Send the state, which will also power on the unit. // The following are all options/settings that create their own special // messages. Often they only make sense to be sent after the unit is turned @@ -1077,13 +1095,16 @@ void IRac::delonghiac(IRDelonghiAc *ac, /// @param[in] on The power setting. /// @param[in] mode The operation mode setting. /// @param[in] degrees The temperature setting in degrees. +/// @param[in] sensorTemp The room (iFeel) temperature sensor reading in degrees +/// Celsius. /// @param[in] fan The speed setting for the fan. /// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on. /// @param[in] clock The time in Nr. of mins since midnight. < 0 is ignore. void IRac::ecoclim(IREcoclimAc *ac, const bool on, const stdAc::opmode_t mode, - const float degrees, const stdAc::fanspeed_t fan, - const int16_t sleep, const int16_t clock) { + const float degrees, const float sensorTemp, + const stdAc::fanspeed_t fan, const int16_t sleep, + const int16_t clock) { ac->begin(); ac->setPower(on); uint8_t new_mode; @@ -1093,8 +1114,13 @@ void IRac::ecoclim(IREcoclimAc *ac, new_mode = ac->convertMode(mode); // Not Sleep, so use the supplied mode. ac->setMode(new_mode); ac->setTemp(degrees); - ac->setSensorTemp(degrees); //< Set to the desired temp until we cab disable. ac->setFan(ac->convertFan(fan)); + if (sensorTemp != kNoTempValue) { + ac->setSensorTemp(static_cast(sensorTemp + 0.5)); + } else { + ac->setSensorTemp(degrees); //< Set to the desired temp + // until we cab disable. + } // No SwingV setting available // No SwingH setting available // No Quiet setting available. @@ -1116,22 +1142,28 @@ void IRac::ecoclim(IREcoclimAc *ac, /// @param[in] on The power setting. /// @param[in] mode The operation mode setting. /// @param[in] degrees The temperature setting in degrees. +/// @param[in] sensorTemp The room (iFeel) temperature sensor reading in degrees +/// Celsius. /// @param[in] fan The speed setting for the fan. /// @param[in] swingv The vertical swing setting. /// @param[in] swingh The horizontal swing setting. +/// @param[in] iFeel Whether to enable iFeel (remote temp) mode on the A/C unit. /// @param[in] turbo Run the device in turbo/powerful mode. /// @param[in] lighttoggle Should we toggle the LED/Display? /// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc void IRac::electra(IRElectraAc *ac, const bool on, const stdAc::opmode_t mode, - const float degrees, const stdAc::fanspeed_t fan, - const stdAc::swingv_t swingv, - const stdAc::swingh_t swingh, const bool turbo, - const bool lighttoggle, const bool clean) { + const float degrees, const float sensorTemp, + const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, + const stdAc::swingh_t swingh, const bool iFeel, + const bool turbo, const bool lighttoggle, const bool clean) { ac->begin(); ac->setPower(on); ac->setMode(ac->convertMode(mode)); ac->setTemp(degrees); + if (sensorTemp != kNoTempValue) { + ac->setSensorTemp(static_cast(sensorTemp + 0.5)); + } ac->setFan(ac->convertFan(fan)); ac->setSwingV(swingv != stdAc::swingv_t::kOff); ac->setSwingH(swingh != stdAc::swingh_t::kOff); @@ -1144,6 +1176,7 @@ void IRac::electra(IRElectraAc *ac, // No Beep setting available. // No Sleep setting available. // No Clock setting available. + ac->setIFeel(iFeel); ac->send(); } #endif // SEND_ELECTRA_AC @@ -1269,6 +1302,7 @@ void IRac::goodweather(IRGoodweatherAc *ac, /// @param[in] fan The speed setting for the fan. /// @param[in] swingv The vertical swing setting. /// @param[in] swingh The horizontal swing setting. +/// @param[in] iFeel Whether to enable iFeel (remote temp) mode on the A/C unit. /// @param[in] turbo Run the device in turbo/powerful mode. /// @param[in] econo Toggle the device's economical mode. /// @param[in] light Turn on the LED/Display mode. @@ -1278,8 +1312,8 @@ void IRac::gree(IRGreeAC *ac, const gree_ac_remote_model_t model, const bool on, const stdAc::opmode_t mode, const bool celsius, const float degrees, const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, const stdAc::swingh_t swingh, - const bool turbo, const bool econo, const bool light, - const bool clean, const int16_t sleep) { + const bool iFeel, const bool turbo, const bool econo, + const bool light, const bool clean, const int16_t sleep) { ac->begin(); ac->setModel(model); ac->setPower(on); @@ -1289,6 +1323,7 @@ void IRac::gree(IRGreeAC *ac, const gree_ac_remote_model_t model, ac->setSwingVertical(swingv == stdAc::swingv_t::kAuto, // Set auto flag. ac->convertSwingV(swingv)); ac->setSwingHorizontal(ac->convertSwingH(swingh)); + ac->setIFeel(iFeel); ac->setLight(light); ac->setTurbo(turbo); ac->setEcono(econo); @@ -1798,8 +1833,11 @@ void IRac::lg(IRLgAc *ac, const lg_ac_remote_model_t model, /// @param[in] mode The operation mode setting. /// @param[in] celsius Temperature units. True is Celsius, False is Fahrenheit. /// @param[in] degrees The temperature setting in degrees. +/// @param[in] sensorTemp The room (iFeel) temperature sensor reading +/// in degrees. /// @param[in] fan The speed setting for the fan. /// @param[in] swingv The vertical swing setting. +/// @param[in] iFeel Whether to enable iFeel (remote temp) mode on the A/C unit. /// @param[in] quiet Run the device in quiet/silent mode. /// @param[in] quiet_prev The device's previous quiet/silent mode. /// @param[in] turbo Toggle the device's turbo/powerful mode. @@ -1810,9 +1848,9 @@ void IRac::lg(IRLgAc *ac, const lg_ac_remote_model_t model, /// @note On Danby A/C units, swingv controls the Ion Filter instead. void IRac::midea(IRMideaAC *ac, const bool on, const stdAc::opmode_t mode, const bool celsius, - const float degrees, const stdAc::fanspeed_t fan, - const stdAc::swingv_t swingv, - const bool quiet, const bool quiet_prev, + const float degrees, const float sensorTemp, + const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, + const bool iFeel, const bool quiet, const bool quiet_prev, const bool turbo, const bool econo, const bool light, const bool clean, const int16_t sleep) { ac->begin(); @@ -1820,6 +1858,10 @@ void IRac::midea(IRMideaAC *ac, ac->setMode(ac->convertMode(mode)); ac->setUseCelsius(celsius); ac->setTemp(degrees, celsius); + if (sensorTemp != kNoTempValue) { + ac->setSensorTemp(sensorTemp, celsius); + } + ac->setEnableSensorTemp(iFeel); ac->setFan(ac->convertFan(fan)); ac->setSwingVToggle(swingv != stdAc::swingv_t::kOff); // No Horizontal swing setting available. @@ -2217,19 +2259,28 @@ void IRac::samsung(IRSamsungAc *ac, /// @param[in] on The power setting. /// @param[in] mode The operation mode setting. /// @param[in] degrees The temperature setting in degrees. +/// @param[in] sensorTemp The room (iFeel) temperature sensor reading in degrees +/// Celsius. /// @param[in] fan The speed setting for the fan. /// @param[in] swingv The vertical swing setting. +/// @param[in] iFeel Whether to enable iFeel (remote temp) mode on the A/C unit. /// @param[in] beep Enable/Disable beeps when receiving IR messages. /// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on. void IRac::sanyo(IRSanyoAc *ac, const bool on, const stdAc::opmode_t mode, - const float degrees, const stdAc::fanspeed_t fan, - const stdAc::swingv_t swingv, const bool beep, - const int16_t sleep) { + const float degrees, const float sensorTemp, + const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, + const bool iFeel, const bool beep, const int16_t sleep) { ac->begin(); ac->setPower(on); ac->setMode(ac->convertMode(mode)); ac->setTemp(degrees); + if (sensorTemp != kNoTempValue) { + ac->setSensorTemp(static_cast(sensorTemp + 0.5)); + } else { + ac->setSensorTemp(degrees); // Set the sensor temp to the desired temp. + } + ac->setSensor(!iFeel); ac->setFan(ac->convertFan(fan)); ac->setSwingV(ac->convertSwingV(swingv)); // No Horizontal swing setting available. @@ -2242,10 +2293,6 @@ void IRac::sanyo(IRSanyoAc *ac, ac->setBeep(beep); ac->setSleep(sleep >= 0); // Sleep is either on/off, so convert to boolean. // No Clock setting available. - - // Extra - ac->setSensor(true); // Set the A/C to use the temp sensor in the Unit/Wall. - ac->setSensorTemp(degrees); // Set the sensor temp to the desired temp. ac->send(); } #endif // SEND_SANYO_AC @@ -3018,8 +3065,8 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) { OUTPUT_DECODE_RESULTS_FOR_UT(ac); } else { IRArgoAC ac(_pin, _inverted, _modulation); - argo(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv, - send.turbo, send.sleep); + argo(&ac, send.power, send.mode, degC, sensorTempC, send.fanspeed, + send.swingv, send.iFeel, send.turbo, send.sleep); OUTPUT_DECODE_RESULTS_FOR_UT(ac); } break; @@ -3046,8 +3093,9 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) { case COOLIX: { IRCoolixAC ac(_pin, _inverted, _modulation); - coolix(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv, - send.swingh, send.turbo, send.light, send.clean, send.sleep); + coolix(&ac, send.power, send.mode, degC, sensorTempC, send.fanspeed, + send.swingv, send.swingh, send.iFeel, send.turbo, send.light, + send.clean, send.sleep); break; } #endif // SEND_COOLIX @@ -3145,7 +3193,8 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) { case ECOCLIM: { IREcoclimAc ac(_pin, _inverted, _modulation); - ecoclim(&ac, send.power, send.mode, degC, send.fanspeed, send.clock); + ecoclim(&ac, send.power, send.mode, degC, sensorTempC, send.fanspeed, + send.iFeel, send.clock); break; } #endif // SEND_ECOCLIM @@ -3153,8 +3202,9 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) { case ELECTRA_AC: { IRElectraAc ac(_pin, _inverted, _modulation); - electra(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv, - send.swingh, send.turbo, send.light, send.clean); + electra(&ac, send.power, send.mode, degC, sensorTempC, send.fanspeed, + send.swingv, send.swingh, send.iFeel, send.turbo, send.light, + send.clean); break; } #endif // SEND_ELECTRA_AC @@ -3322,8 +3372,9 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) { { IRMideaAC ac(_pin, _inverted, _modulation); midea(&ac, send.power, send.mode, send.celsius, send.degrees, - send.fanspeed, send.swingv, send.quiet, prev_quiet, send.turbo, - send.econo, send.light, send.sleep); + send.sensorTemperature, send.fanspeed, send.swingv, send.iFeel, + send.quiet, prev_quiet, send.turbo, send.econo, send.light, + send.sleep); break; } #endif // SEND_MIDEA @@ -3432,8 +3483,8 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) { case SANYO_AC: { IRSanyoAc ac(_pin, _inverted, _modulation); - sanyo(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv, - send.beep, send.sleep); + sanyo(&ac, send.power, send.mode, degC, sensorTempC, send.fanspeed, + send.swingv, send.iFeel, send.beep, send.sleep); break; } #endif // SEND_SANYO_AC diff --git a/src/IRac.h b/src/IRac.h index 147abc7c6..7e0d088df 100644 --- a/src/IRac.h +++ b/src/IRac.h @@ -144,8 +144,9 @@ class IRac { #if SEND_ARGO void argo(IRArgoAC *ac, const bool on, const stdAc::opmode_t mode, const float degrees, - const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, - const bool turbo, const int16_t sleep = -1); + const float sensorTemp, const stdAc::fanspeed_t fan, + const stdAc::swingv_t swingv, const bool iFeel, const bool turbo, + const int16_t sleep = -1); void argoWrem3_ACCommand(IRArgoAC_WREM3 *ac, const bool on, const stdAc::opmode_t mode, const float degrees, const float sensorTemp, const stdAc::fanspeed_t fan, @@ -162,7 +163,7 @@ class IRac { const bool on, const stdAc::opmode_t mode, const float degrees, const stdAc::fanspeed_t fan, const bool quiet); -#endif // SEND_COOLIX +#endif // SEND_BOSCH144 #if SEND_CARRIER_AC64 void carrier64(IRCarrierAc64 *ac, const bool on, const stdAc::opmode_t mode, @@ -172,10 +173,10 @@ void carrier64(IRCarrierAc64 *ac, #if SEND_COOLIX void coolix(IRCoolixAC *ac, const bool on, const stdAc::opmode_t mode, const float degrees, - const stdAc::fanspeed_t fan, + const float sensorTemp, const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, const stdAc::swingh_t swingh, - const bool turbo, const bool light, const bool clean, - const int16_t sleep = -1); + const bool iFeel, const bool turbo, const bool light, + const bool clean, const int16_t sleep = -1); #endif // SEND_COOLIX #if SEND_CORONA_AC void corona(IRCoronaAc *ac, @@ -253,15 +254,16 @@ void daikin216(IRDaikin216 *ac, #if SEND_ECOCLIM void ecoclim(IREcoclimAc *ac, const bool on, const stdAc::opmode_t mode, - const float degrees, const stdAc::fanspeed_t fan, - const int16_t sleep = -1, const int16_t clock = -1); + const float degrees, const float sensorTemp, + const stdAc::fanspeed_t fan, const int16_t sleep = -1, + const int16_t clock = -1); #endif // SEND_ECOCLIM #if SEND_ELECTRA_AC void electra(IRElectraAc *ac, const bool on, const stdAc::opmode_t mode, - const float degrees, const stdAc::fanspeed_t fan, - const stdAc::swingv_t swingv, - const stdAc::swingh_t swingh, const bool turbo, + const float degrees, const float sensorTemp, + const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, + const stdAc::swingh_t swingh, const bool iFeel, const bool turbo, const bool lighttoggle, const bool clean); #endif // SEND_ELECTRA_AC #if SEND_FUJITSU_AC @@ -287,8 +289,8 @@ void electra(IRElectraAc *ac, const bool on, const stdAc::opmode_t mode, const bool celsius, const float degrees, const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, const stdAc::swingh_t swingh, - const bool turbo, const bool econo, const bool light, - const bool clean, const int16_t sleep = -1); + const bool iFeel, const bool turbo, const bool econo, + const bool light, const bool clean, const int16_t sleep = -1); #endif // SEND_GREE #if SEND_HAIER_AC void haier(IRHaierAC *ac, @@ -385,11 +387,11 @@ void electra(IRElectraAc *ac, #if SEND_MIDEA void midea(IRMideaAC *ac, const bool on, const stdAc::opmode_t mode, const bool celsius, - const float degrees, const stdAc::fanspeed_t fan, - const stdAc::swingv_t swingv, - const bool quiet, const bool quiet_prev, const bool turbo, - const bool econo, const bool light, const bool clean, - const int16_t sleep = -1); + const float degrees, const float sensorTemp, + const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, + const bool iFeel, const bool quiet, const bool quiet_prev, + const bool turbo, const bool econo, const bool light, + const bool clean, const int16_t sleep = -1); #endif // SEND_MIDEA #if SEND_MIRAGE void mirage(IRMirageAc *ac, const stdAc::state_t state); @@ -473,8 +475,9 @@ void electra(IRElectraAc *ac, #if SEND_SANYO_AC void sanyo(IRSanyoAc *ac, const bool on, const stdAc::opmode_t mode, const float degrees, - const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv, - const bool beep, const int16_t sleep = -1); + const float sensorTemp, const stdAc::fanspeed_t fan, + const stdAc::swingv_t swingv, const bool iFeel, const bool beep, + const int16_t sleep = -1); #endif // SEND_SANYO_AC #if SEND_SANYO_AC88 void sanyo88(IRSanyoAc88 *ac, diff --git a/src/ir_Coolix.cpp b/src/ir_Coolix.cpp index 755e89190..3fb4e8d0a 100644 --- a/src/ir_Coolix.cpp +++ b/src/ir_Coolix.cpp @@ -548,6 +548,8 @@ stdAc::state_t IRCoolixAC::toCommon(const stdAc::state_t *prev) const { // Back to "normal" stateful messages. result.mode = toCommonMode(getMode()); result.degrees = getTemp(); + result.sensorTemperature = getSensorTemp(); + result.iFeel = getZoneFollow(); result.fanspeed = toCommonFanSpeed(getFan()); return result; } diff --git a/src/ir_Coolix.h b/src/ir_Coolix.h index 2155b54b0..d711367b2 100644 --- a/src/ir_Coolix.h +++ b/src/ir_Coolix.h @@ -165,6 +165,7 @@ class IRCoolixAC { static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed); stdAc::state_t toCommon(const stdAc::state_t *prev = NULL) const; String toString(void) const; + void setZoneFollow(const bool on); #ifndef UNIT_TEST private: @@ -189,7 +190,6 @@ class IRCoolixAC { void setTempRaw(const uint8_t code); uint8_t getTempRaw(void) const; void setSensorTempRaw(const uint8_t code); - void setZoneFollow(const bool on); bool isSpecialState(void) const; bool handleSpecialState(const uint32_t data); void updateAndSaveState(const uint32_t raw_state); diff --git a/src/ir_Ecoclim.cpp b/src/ir_Ecoclim.cpp index 983913d38..e24559b5f 100644 --- a/src/ir_Ecoclim.cpp +++ b/src/ir_Ecoclim.cpp @@ -365,6 +365,7 @@ stdAc::state_t IREcoclimAc::toCommon(void) const { result.mode = toCommonMode(getMode()); result.celsius = true; result.degrees = getTemp(); + result.sensorTemperature = getSensorTemp(); result.fanspeed = toCommonFanSpeed(_.Fan); result.sleep = (getMode() == kEcoclimSleep) ? 0 : -1; result.clock = getClock(); diff --git a/src/ir_Electra.cpp b/src/ir_Electra.cpp index f0882bc6d..f8edf9729 100644 --- a/src/ir_Electra.cpp +++ b/src/ir_Electra.cpp @@ -365,6 +365,7 @@ stdAc::state_t IRElectraAc::toCommon(void) const { result.mode = toCommonMode(_.Mode); result.celsius = true; result.degrees = getTemp(); + result.sensorTemperature = getSensorTemp(); result.fanspeed = toCommonFanSpeed(_.Fan); result.swingv = getSwingV() ? stdAc::swingv_t::kAuto : stdAc::swingv_t::kOff; @@ -373,6 +374,7 @@ stdAc::state_t IRElectraAc::toCommon(void) const { result.light = getLightToggle(); result.turbo = _.Turbo; result.clean = _.Clean; + result.iFeel = getIFeel(); // Not supported. result.model = -1; // No models used. result.quiet = false; diff --git a/src/ir_Gree.cpp b/src/ir_Gree.cpp index ead7178e3..2c44cfe52 100644 --- a/src/ir_Gree.cpp +++ b/src/ir_Gree.cpp @@ -591,6 +591,8 @@ stdAc::state_t IRGreeAC::toCommon(void) { result.mode = toCommonMode(_.Mode); result.celsius = !_.UseFahrenheit; result.degrees = getTemp(); + // no support for Sensor temp. + result.iFeel = getIFeel(); result.fanspeed = toCommonFanSpeed(_.Fan); if (_.SwingAuto) result.swingv = stdAc::swingv_t::kAuto; diff --git a/src/ir_Midea.cpp b/src/ir_Midea.cpp index 4fbc07973..80acfcda3 100644 --- a/src/ir_Midea.cpp +++ b/src/ir_Midea.cpp @@ -679,6 +679,7 @@ stdAc::state_t IRMideaAC::toCommon(const stdAc::state_t *prev) { result.mode = toCommonMode(_.Mode); result.celsius = !_.useFahrenheit; result.degrees = getTemp(result.celsius); + result.sensorTemperature = getSensorTemp(result.celsius); result.fanspeed = toCommonFanSpeed(_.Fan); result.sleep = _.Sleep ? 0 : -1; result.econo = getEconoToggle(); diff --git a/src/ir_Mirage.cpp b/src/ir_Mirage.cpp index e3e7c60d3..b7d6ce42d 100644 --- a/src/ir_Mirage.cpp +++ b/src/ir_Mirage.cpp @@ -740,6 +740,7 @@ stdAc::state_t IRMirageAc::toCommon(void) const { result.mode = toCommonMode(_.Mode); result.celsius = true; result.degrees = getTemp(); + result.sensorTemperature = getSensorTemp(); result.fanspeed = toCommonFanSpeed(getFan(), _model); result.swingv = toCommonSwingV(getSwingV()); result.swingh = getSwingH() ? stdAc::swingh_t::kAuto : stdAc::swingh_t::kOff; @@ -750,6 +751,7 @@ stdAc::state_t IRMirageAc::toCommon(void) const { result.sleep = getSleep() ? 0 : -1; result.quiet = getQuiet(); result.clock = getClock() / 60; + result.iFeel = getIFeel(); // Not supported. result.econo = false; result.beep = false; @@ -775,10 +777,14 @@ void IRMirageAc::fromCommon(const stdAc::state_t state) { setFilter(state.filter); // setClock() expects seconds, not minutes. setClock((state.clock > 0) ? state.clock * 60 : 0); + setIFeel(state.iFeel); + if (state.sensorTemperature != kNoTempValue) { + setSensorTemp(state.celsius ? state.sensorTemperature + : fahrenheitToCelsius(state.sensorTemperature)); + } // Non-common settings. setOnTimer(0); setOffTimer(0); - setIFeel(false); } /// Convert the internal state into a human readable string. diff --git a/src/ir_Sanyo.cpp b/src/ir_Sanyo.cpp index bed0e7bc2..4b99d0492 100644 --- a/src/ir_Sanyo.cpp +++ b/src/ir_Sanyo.cpp @@ -622,10 +622,12 @@ stdAc::state_t IRSanyoAc::toCommon(void) const { result.mode = toCommonMode(_.Mode); result.celsius = true; result.degrees = getTemp(); + result.sensorTemperature = getSensorTemp(); result.fanspeed = toCommonFanSpeed(_.Fan); result.sleep = _.Sleep ? 0 : -1; result.swingv = toCommonSwingV(_.SwingV); result.beep = _.Beep; + result.iFeel = !getSensor(); // Not supported. result.swingh = stdAc::swingh_t::kOff; result.turbo = false; diff --git a/test/IRac_test.cpp b/test/IRac_test.cpp index d0d6c5b42..b40c5f489 100644 --- a/test/IRac_test.cpp +++ b/test/IRac_test.cpp @@ -133,8 +133,10 @@ TEST(TestIRac, Argo) { true, // Power stdAc::opmode_t::kHeat, // Mode 21, // Celsius + 22, // Sensor Temp. stdAc::fanspeed_t::kHigh, // Fan speed stdAc::swingv_t::kOff, // Vertical swing + false, // iFeel false, // Turbo -1); // Sleep EXPECT_TRUE(ac.getPower()); @@ -194,9 +196,11 @@ TEST(TestIRac, Coolix) { true, // Power stdAc::opmode_t::kHeat, // Mode 21, // Celsius + kNoTempValue, // Sensor Temp stdAc::fanspeed_t::kHigh, // Fan speed stdAc::swingv_t::kOff, // Vertical swing stdAc::swingh_t::kOff, // Horizontal swing + false, // iFeel false, // Turbo false, // Light false, // Clean @@ -562,7 +566,7 @@ TEST(TestIRac, Ecoclim) { IRac irac(kGpioUnused); IRrecv capture(kGpioUnused); char expected[] = - "Power: On, Mode: 1 (Cool), Temp: 26C, SensorTemp: 26C, Fan: 2 (High), " + "Power: On, Mode: 1 (Cool), Temp: 26C, SensorTemp: 27C, Fan: 2 (High), " "Clock: 12:34, On Timer: Off, Off Timer: Off, Type: 0"; ac.begin(); @@ -570,6 +574,7 @@ TEST(TestIRac, Ecoclim) { true, // Power stdAc::opmode_t::kCool, // Mode 26, // Celsius + 27, // Sensor Temp. stdAc::fanspeed_t::kHigh, // Fan speed -1, // Sleep 12 * 60 + 34); // Clock @@ -581,7 +586,7 @@ TEST(TestIRac, Ecoclim) { ASSERT_EQ(expected, IRAcUtils::resultAcToString(&ac._irsend.capture)); char expected_sleep[] = - "Power: On, Mode: 7 (Sleep), Temp: 21C, SensorTemp: 21C, Fan: 0 (Low), " + "Power: On, Mode: 7 (Sleep), Temp: 21C, SensorTemp: 22C, Fan: 0 (Low), " "Clock: 17:17, On Timer: Off, Off Timer: Off, Type: 0"; ac._irsend.reset(); @@ -589,6 +594,7 @@ TEST(TestIRac, Ecoclim) { true, // Power stdAc::opmode_t::kCool, // Mode 21, // Celsius + 22, // Sensor Temp. stdAc::fanspeed_t::kLow, // Fan speed 8 * 60, // Sleep 17 * 60 + 17); // Clock @@ -614,9 +620,11 @@ TEST(TestIRac, Electra) { true, // Power stdAc::opmode_t::kFan, // Mode 26, // Celsius + 27, // Sensor Temp. stdAc::fanspeed_t::kHigh, // Fan speed stdAc::swingv_t::kAuto, // Vertical swing stdAc::swingh_t::kLeft, // Horizontal swing + false, // iFeel true, // Turbo true, // Light (toggle) true); // Clean @@ -779,7 +787,7 @@ TEST(TestIRac, Gree) { IRrecv capture(kGpioUnused); char expected[] = "Model: 1 (YAW1F), Power: On, Mode: 1 (Cool), Temp: 71F, " - "Fan: 2 (Medium), Turbo: Off, Econo: Off, IFeel: Off, WiFi: Off, " + "Fan: 2 (Medium), Turbo: Off, Econo: Off, IFeel: On, WiFi: Off, " "XFan: On, Light: On, Sleep: On, Swing(V) Mode: Manual, " "Swing(V): 3 (UNKNOWN), Swing(H): 5 (Right), Timer: Off, " "Display Temp: 0 (Off)"; @@ -794,6 +802,7 @@ TEST(TestIRac, Gree) { stdAc::fanspeed_t::kMedium, // Fan speed stdAc::swingv_t::kHigh, // Vertical swing stdAc::swingh_t::kRight, // Horizontal swing + true, // iFeel false, // Turbo false, // Econo true, // Light @@ -1496,8 +1505,10 @@ TEST(TestIRac, Midea) { stdAc::opmode_t::kDry, // Mode true, // Celsius 27, // Degrees + 28, // Sensor Temp. stdAc::fanspeed_t::kMedium, // Fan speed stdAc::swingv_t::kOff, // Swing(V) + false, // iFeel false, // Silent/Quiet false, // Previous Silent/Quiet setting false, // Turbo @@ -1939,8 +1950,10 @@ TEST(TestIRac, Sanyo) { true, // Power stdAc::opmode_t::kCool, // Mode 28, // Celsius + kNoTempValue, // SensorTemp stdAc::fanspeed_t::kMedium, // Fan speed stdAc::swingv_t::kHighest, // Vertical Swing + false, // iFeel true, // Beep 17); // Sleep ASSERT_EQ(expected, ac.toString()); @@ -2877,9 +2890,11 @@ TEST(TestIRac, Issue821) { result.power, // Power result.mode, // Mode result.degrees, // Celsius + kNoTempValue, // Sensor Temp result.fanspeed, // Fan speed result.swingv, // Vertical swing result.swingh, // Horizontal swing + result.iFeel, // iFeel result.turbo, // Turbo result.light, // Light result.clean, // Clean