From d916d571f83bf6561210c6a83f2cf9812838306b Mon Sep 17 00:00:00 2001 From: noone2k Date: Fri, 12 May 2023 16:55:29 +0200 Subject: [PATCH] Add Electra_AC Quiet Mode ( testet with Delonghi PAC EM90 ) --- src/IRac.cpp | 7 ++++--- src/IRac.h | 2 +- src/ir_Electra.cpp | 15 ++++++++++++++- src/ir_Electra.h | 4 +++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/IRac.cpp b/src/IRac.cpp index 8826bc1ae..6049ba18d 100644 --- a/src/IRac.cpp +++ b/src/IRac.cpp @@ -1160,6 +1160,7 @@ void IRac::ecoclim(IREcoclimAc *ac, /// @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] quiet Run the device in quiet/silent mode. /// @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 @@ -1168,7 +1169,7 @@ void IRac::electra(IRElectraAc *ac, 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) { + const bool quiet, const bool turbo, const bool lighttoggle, const bool clean) { ac->begin(); ac->setPower(on); ac->setMode(ac->convertMode(mode)); @@ -1179,7 +1180,7 @@ void IRac::electra(IRElectraAc *ac, ac->setFan(ac->convertFan(fan)); ac->setSwingV(swingv != stdAc::swingv_t::kOff); ac->setSwingH(swingh != stdAc::swingh_t::kOff); - // No Quiet setting available. + ac->setQuiet(quiet); ac->setTurbo(turbo); ac->setLightToggle(lighttoggle); // No Econo setting available. @@ -3216,7 +3217,7 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) { { IRElectraAc ac(_pin, _inverted, _modulation); electra(&ac, send.power, send.mode, degC, sensorTempC, send.fanspeed, - send.swingv, send.swingh, send.iFeel, send.turbo, send.light, + send.swingv, send.swingh, send.iFeel, send.quiet, send.turbo, send.light, send.clean); break; } diff --git a/src/IRac.h b/src/IRac.h index 7f4a3cf01..31666f1f7 100644 --- a/src/IRac.h +++ b/src/IRac.h @@ -264,7 +264,7 @@ void electra(IRElectraAc *ac, const bool on, const stdAc::opmode_t mode, 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 stdAc::swingh_t swingh, const bool iFeel, const bool quiet, const bool turbo, const bool lighttoggle, const bool clean); #endif // SEND_ELECTRA_AC #if SEND_FUJITSU_AC diff --git a/src/ir_Electra.cpp b/src/ir_Electra.cpp index f8edf9729..40e208a52 100644 --- a/src/ir_Electra.cpp +++ b/src/ir_Electra.cpp @@ -310,6 +310,18 @@ bool IRElectraAc::getTurbo(void) const { return _.Turbo; } +/// Set the Quiet/Silent'mode of the A/C. +/// @param[in] on true, the setting is on. false, the setting is off. +void IRElectraAc::setQuiet(const bool on) { + _.Quiet = on; +} + +/// Get the Quiet/Silent mode of the A/C. +/// @return true, the setting is on. false, the setting is off. +bool IRElectraAc::getQuiet(void) const { + return _.Quiet; +} + /// Get the IFeel mode of the A/C. /// @return true, the setting is on. false, the setting is off. bool IRElectraAc::getIFeel(void) const { return _.IFeel; } @@ -373,11 +385,11 @@ stdAc::state_t IRElectraAc::toCommon(void) const { : stdAc::swingh_t::kOff; result.light = getLightToggle(); result.turbo = _.Turbo; + result.quiet = _.Quiet; result.clean = _.Clean; result.iFeel = getIFeel(); // Not supported. result.model = -1; // No models used. - result.quiet = false; result.econo = false; result.filter = false; result.beep = false; @@ -404,6 +416,7 @@ String IRElectraAc::toString(void) const { result += addToggleToString(getLightToggle(), kLightStr); result += addBoolToString(_.Clean, kCleanStr); result += addBoolToString(_.Turbo, kTurboStr); + result += addBoolToString(_.Quiet, kQuietStr); result += addBoolToString(_.IFeel, kIFeelStr); } if (_.IFeel || _.SensorUpdate) { diff --git a/src/ir_Electra.h b/src/ir_Electra.h index 6a59473f7..ebc330068 100644 --- a/src/ir_Electra.h +++ b/src/ir_Electra.h @@ -53,7 +53,7 @@ union ElectraProtocol { // Byte 5 uint8_t :6; uint8_t Turbo :1; - uint8_t :1; + uint8_t Quiet :1; // Byte 6 uint8_t :3; uint8_t IFeel :1; @@ -146,6 +146,8 @@ class IRElectraAc { bool getLightToggle(void) const; void setTurbo(const bool on); bool getTurbo(void) const; + void setQuiet(const bool on); + bool getQuiet(void) const; void setIFeel(const bool on); bool getIFeel(void) const; void setSensorUpdate(const bool on);