2019-05-27 13:11:01 +01:00
|
|
|
// Copyright 2019 David Conran
|
|
|
|
|
|
|
|
// Provide a universal/standard interface for sending A/C nessages.
|
|
|
|
// It does not provide complete and maximum granular control but tries
|
2020-06-24 20:48:33 +01:00
|
|
|
// to offer most common functionality across all supported devices.
|
2019-05-27 13:11:01 +01:00
|
|
|
|
|
|
|
#include "IRac.h"
|
|
|
|
#ifndef UNIT_TEST
|
|
|
|
#include <Arduino.h>
|
|
|
|
#endif
|
|
|
|
#include <string.h>
|
|
|
|
#ifndef ARDUINO
|
|
|
|
#include <string>
|
|
|
|
#endif
|
|
|
|
#include "IRsend.h"
|
|
|
|
#include "IRremoteESP8266.h"
|
2019-11-02 11:21:18 +00:00
|
|
|
#include "IRtext.h"
|
2019-07-21 15:01:43 +01:00
|
|
|
#include "IRutils.h"
|
2020-07-29 12:57:44 +01:00
|
|
|
#include "ir_Airwell.h"
|
2019-08-30 19:41:01 +01:00
|
|
|
#include "ir_Amcor.h"
|
2019-05-27 13:11:01 +01:00
|
|
|
#include "ir_Argo.h"
|
2020-06-24 20:48:33 +01:00
|
|
|
#include "ir_Carrier.h"
|
2019-05-27 13:11:01 +01:00
|
|
|
#include "ir_Coolix.h"
|
2020-06-24 20:48:33 +01:00
|
|
|
#include "ir_Corona.h"
|
2019-05-27 13:11:01 +01:00
|
|
|
#include "ir_Daikin.h"
|
2021-03-25 07:40:27 +00:00
|
|
|
#include "ir_Ecoclim.h"
|
2019-07-21 15:01:43 +01:00
|
|
|
#include "ir_Electra.h"
|
2019-05-27 13:11:01 +01:00
|
|
|
#include "ir_Fujitsu.h"
|
|
|
|
#include "ir_Haier.h"
|
|
|
|
#include "ir_Hitachi.h"
|
|
|
|
#include "ir_Kelvinator.h"
|
2020-01-06 16:27:36 +00:00
|
|
|
#include "ir_LG.h"
|
2019-05-27 13:11:01 +01:00
|
|
|
#include "ir_Midea.h"
|
|
|
|
#include "ir_Mitsubishi.h"
|
|
|
|
#include "ir_MitsubishiHeavy.h"
|
2019-07-21 15:01:43 +01:00
|
|
|
#include "ir_Neoclima.h"
|
2019-05-27 13:11:01 +01:00
|
|
|
#include "ir_Panasonic.h"
|
|
|
|
#include "ir_Samsung.h"
|
2020-07-29 12:57:44 +01:00
|
|
|
#include "ir_Sanyo.h"
|
2019-07-21 15:01:43 +01:00
|
|
|
#include "ir_Sharp.h"
|
2019-05-27 13:11:01 +01:00
|
|
|
#include "ir_Tcl.h"
|
2020-10-04 10:04:34 +01:00
|
|
|
#include "ir_Technibel.h"
|
2019-05-27 13:11:01 +01:00
|
|
|
#include "ir_Teco.h"
|
|
|
|
#include "ir_Toshiba.h"
|
2020-10-04 10:04:34 +01:00
|
|
|
#include "ir_Transcold.h"
|
2019-05-27 13:11:01 +01:00
|
|
|
#include "ir_Trotec.h"
|
|
|
|
#include "ir_Vestel.h"
|
2020-09-01 10:36:06 +01:00
|
|
|
#include "ir_Voltas.h"
|
2019-05-27 13:11:01 +01:00
|
|
|
#include "ir_Whirlpool.h"
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Class constructor
|
|
|
|
/// @param[in] pin Gpio pin to use when transmitting IR messages.
|
|
|
|
/// @param[in] inverted true, gpio output defaults to high. false, to low.
|
|
|
|
/// @param[in] use_modulation true means use frequency modulation. false, don't.
|
2019-07-21 15:01:43 +01:00
|
|
|
IRac::IRac(const uint16_t pin, const bool inverted, const bool use_modulation) {
|
|
|
|
_pin = pin;
|
|
|
|
_inverted = inverted;
|
|
|
|
_modulation = use_modulation;
|
2019-11-02 11:21:18 +00:00
|
|
|
initState(&next);
|
2020-02-29 12:51:16 +00:00
|
|
|
this->markAsSent();
|
2019-07-21 15:01:43 +01:00
|
|
|
}
|
2019-05-27 13:11:01 +01:00
|
|
|
|
2020-11-14 18:31:50 +00:00
|
|
|
/// Initialise the given state with the supplied settings.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[out] state A Ptr to where the settings will be stored.
|
|
|
|
/// @param[in] vendor The vendor/protocol type.
|
|
|
|
/// @param[in] model The A/C model if applicable.
|
|
|
|
/// @param[in] power The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] celsius Temperature units. True is Celsius, False is Fahrenheit.
|
|
|
|
/// @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] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
|
|
|
/// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc
|
|
|
|
/// @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. Some devices it is the nr. of mins to run for.
|
|
|
|
/// Others it may be the time to enter/exit sleep mode.
|
|
|
|
/// i.e. Time in Nr. of mins since midnight.
|
|
|
|
/// @param[in] clock The time in Nr. of mins since midnight. < 0 is ignore.
|
2019-11-02 11:21:18 +00:00
|
|
|
void IRac::initState(stdAc::state_t *state,
|
|
|
|
const decode_type_t vendor, const int16_t model,
|
|
|
|
const bool power, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const bool celsius,
|
|
|
|
const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
|
|
|
|
const bool quiet, const bool turbo, const bool econo,
|
|
|
|
const bool light, const bool filter, const bool clean,
|
|
|
|
const bool beep, const int16_t sleep,
|
|
|
|
const int16_t clock) {
|
|
|
|
state->protocol = vendor;
|
|
|
|
state->model = model;
|
|
|
|
state->power = power;
|
|
|
|
state->mode = mode;
|
|
|
|
state->degrees = degrees;
|
|
|
|
state->celsius = celsius;
|
|
|
|
state->fanspeed = fan;
|
|
|
|
state->swingv = swingv;
|
|
|
|
state->swingh = swingh;
|
|
|
|
state->quiet = quiet;
|
|
|
|
state->turbo = turbo;
|
|
|
|
state->econo = econo;
|
|
|
|
state->light = light;
|
|
|
|
state->filter = filter;
|
|
|
|
state->clean = clean;
|
|
|
|
state->beep = beep;
|
|
|
|
state->sleep = sleep;
|
|
|
|
state->clock = clock;
|
|
|
|
}
|
|
|
|
|
2020-11-14 18:31:50 +00:00
|
|
|
/// Initialise the given state with the supplied settings.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[out] state A Ptr to where the settings will be stored.
|
|
|
|
/// @note Sets all the parameters to reasonable base/automatic defaults.
|
2019-11-02 11:21:18 +00:00
|
|
|
void IRac::initState(stdAc::state_t *state) {
|
|
|
|
initState(state, decode_type_t::UNKNOWN, -1, false, stdAc::opmode_t::kOff,
|
|
|
|
25, true, // 25 degrees Celsius
|
|
|
|
stdAc::fanspeed_t::kAuto, stdAc::swingv_t::kOff,
|
|
|
|
stdAc::swingh_t::kOff, false, false, false, false, false, false,
|
|
|
|
false, -1, -1);
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Get the current internal A/C climate state.
|
|
|
|
/// @return A Ptr to a state containing the current (to be sent) settings.
|
2019-11-02 11:21:18 +00:00
|
|
|
stdAc::state_t IRac::getState(void) { return next; }
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Get the previous internal A/C climate state that should have already been
|
|
|
|
/// sent to the device. i.e. What the A/C unit should already be set to.
|
|
|
|
/// @return A Ptr to a state containing the previously sent settings.
|
2019-11-02 11:21:18 +00:00
|
|
|
stdAc::state_t IRac::getStatePrev(void) { return _prev; }
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Is the given protocol supported by the IRac class?
|
|
|
|
/// @param[in] protocol The vendor/protocol type.
|
|
|
|
/// @return true if the protocol is supported by this class, otherwise false.
|
2019-05-27 13:11:01 +01:00
|
|
|
bool IRac::isProtocolSupported(const decode_type_t protocol) {
|
|
|
|
switch (protocol) {
|
2020-07-29 12:57:44 +01:00
|
|
|
#if SEND_AIRWELL
|
|
|
|
case decode_type_t::AIRWELL:
|
|
|
|
#endif
|
2019-08-30 19:41:01 +01:00
|
|
|
#if SEND_AMCOR
|
|
|
|
case decode_type_t::AMCOR:
|
|
|
|
#endif
|
2019-11-02 11:21:18 +00:00
|
|
|
#if SEND_ARGO
|
2019-05-27 13:11:01 +01:00
|
|
|
case decode_type_t::ARGO:
|
|
|
|
#endif
|
2020-06-24 20:48:33 +01:00
|
|
|
#if SEND_CARRIER_AC64
|
|
|
|
case decode_type_t::CARRIER_AC64:
|
|
|
|
#endif // SEND_CARRIER_AC64
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_COOLIX
|
|
|
|
case decode_type_t::COOLIX:
|
|
|
|
#endif
|
2020-06-24 20:48:33 +01:00
|
|
|
#if SEND_CORONA_AC
|
|
|
|
case decode_type_t::CORONA_AC:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_DAIKIN
|
|
|
|
case decode_type_t::DAIKIN:
|
|
|
|
#endif
|
2019-07-29 08:28:40 +01:00
|
|
|
#if SEND_DAIKIN128
|
|
|
|
case decode_type_t::DAIKIN128:
|
|
|
|
#endif
|
2019-11-02 11:21:18 +00:00
|
|
|
#if SEND_DAIKIN152
|
|
|
|
case decode_type_t::DAIKIN152:
|
|
|
|
#endif
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_DAIKIN160
|
|
|
|
case decode_type_t::DAIKIN160:
|
|
|
|
#endif
|
|
|
|
#if SEND_DAIKIN176
|
|
|
|
case decode_type_t::DAIKIN176:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_DAIKIN2
|
|
|
|
case decode_type_t::DAIKIN2:
|
|
|
|
#endif
|
|
|
|
#if SEND_DAIKIN216
|
|
|
|
case decode_type_t::DAIKIN216:
|
|
|
|
#endif
|
2020-04-09 09:25:50 +01:00
|
|
|
#if SEND_DAIKIN64
|
|
|
|
case decode_type_t::DAIKIN64:
|
|
|
|
#endif
|
2020-05-20 11:42:34 +01:00
|
|
|
#if SEND_DELONGHI_AC
|
|
|
|
case decode_type_t::DELONGHI_AC:
|
|
|
|
#endif
|
2021-03-25 07:40:27 +00:00
|
|
|
#if SEND_ECOCLIM
|
|
|
|
case decode_type_t::ECOCLIM:
|
|
|
|
#endif
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_ELECTRA_AC
|
|
|
|
case decode_type_t::ELECTRA_AC:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_FUJITSU_AC
|
|
|
|
case decode_type_t::FUJITSU_AC:
|
|
|
|
#endif
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_GOODWEATHER
|
|
|
|
case decode_type_t::GOODWEATHER:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_GREE
|
|
|
|
case decode_type_t::GREE:
|
|
|
|
#endif
|
|
|
|
#if SEND_HAIER_AC
|
|
|
|
case decode_type_t::HAIER_AC:
|
|
|
|
#endif
|
|
|
|
#if SEND_HAIER_AC_YRW02
|
|
|
|
case decode_type_t::HAIER_AC_YRW02:
|
|
|
|
#endif
|
|
|
|
#if SEND_HITACHI_AC
|
|
|
|
case decode_type_t::HITACHI_AC:
|
|
|
|
#endif
|
2020-04-09 09:25:50 +01:00
|
|
|
#if SEND_HITACHI_AC1
|
|
|
|
case decode_type_t::HITACHI_AC1:
|
|
|
|
#endif
|
2020-06-24 20:48:33 +01:00
|
|
|
#if SEND_HITACHI_AC344
|
|
|
|
case decode_type_t::HITACHI_AC344:
|
|
|
|
#endif
|
2019-11-02 11:21:18 +00:00
|
|
|
#if SEND_HITACHI_AC424
|
|
|
|
case decode_type_t::HITACHI_AC424:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_KELVINATOR
|
|
|
|
case decode_type_t::KELVINATOR:
|
|
|
|
#endif
|
2020-01-06 16:27:36 +00:00
|
|
|
#if SEND_LG
|
|
|
|
case decode_type_t::LG:
|
|
|
|
case decode_type_t::LG2:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_MIDEA
|
|
|
|
case decode_type_t::MIDEA:
|
|
|
|
#endif
|
|
|
|
#if SEND_MITSUBISHI_AC
|
|
|
|
case decode_type_t::MITSUBISHI_AC:
|
|
|
|
#endif
|
2019-11-02 11:21:18 +00:00
|
|
|
#if SEND_MITSUBISHI112
|
|
|
|
case decode_type_t::MITSUBISHI112:
|
|
|
|
#endif
|
|
|
|
#if SEND_MITSUBISHI136
|
|
|
|
case decode_type_t::MITSUBISHI136:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_MITSUBISHIHEAVY
|
|
|
|
case decode_type_t::MITSUBISHI_HEAVY_88:
|
|
|
|
case decode_type_t::MITSUBISHI_HEAVY_152:
|
|
|
|
#endif
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_NEOCLIMA
|
|
|
|
case decode_type_t::NEOCLIMA:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_PANASONIC_AC
|
|
|
|
case decode_type_t::PANASONIC_AC:
|
|
|
|
#endif
|
2021-01-04 17:43:58 +00:00
|
|
|
#if SEND_PANASONIC_AC32
|
|
|
|
case decode_type_t::PANASONIC_AC32:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_SAMSUNG_AC
|
|
|
|
case decode_type_t::SAMSUNG_AC:
|
|
|
|
#endif
|
2020-07-29 12:57:44 +01:00
|
|
|
#if SEND_SANYO_AC
|
|
|
|
case decode_type_t::SANYO_AC:
|
|
|
|
#endif
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_SHARP_AC
|
|
|
|
case decode_type_t::SHARP_AC:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_TCL112AC
|
|
|
|
case decode_type_t::TCL112AC:
|
|
|
|
#endif
|
2020-10-04 10:04:34 +01:00
|
|
|
#if SEND_TECHNIBEL_AC
|
|
|
|
case decode_type_t::TECHNIBEL_AC:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_TECO
|
|
|
|
case decode_type_t::TECO:
|
|
|
|
#endif
|
|
|
|
#if SEND_TOSHIBA_AC
|
|
|
|
case decode_type_t::TOSHIBA_AC:
|
|
|
|
#endif
|
2020-10-04 10:04:34 +01:00
|
|
|
#if SEND_TRANSCOLD
|
|
|
|
case decode_type_t::TRANSCOLD:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_TROTEC
|
|
|
|
case decode_type_t::TROTEC:
|
|
|
|
#endif
|
|
|
|
#if SEND_VESTEL_AC
|
|
|
|
case decode_type_t::VESTEL_AC:
|
|
|
|
#endif
|
2020-09-01 10:36:06 +01:00
|
|
|
#if SEND_VOLTAS
|
|
|
|
case decode_type_t::VOLTAS:
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_WHIRLPOOL_AC
|
|
|
|
case decode_type_t::WHIRLPOOL_AC:
|
|
|
|
#endif
|
2020-06-24 20:48:33 +01:00
|
|
|
// Note: Compiler Warning is disabled because someone could disable all
|
|
|
|
// the protocols before this and it is then unreachable.
|
|
|
|
// "-Wswitch-unreachable" not used as it appears to be an unknown option.
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wall"
|
2019-05-27 13:11:01 +01:00
|
|
|
return true;
|
2020-06-24 20:48:33 +01:00
|
|
|
#pragma GCC diagnostic pop
|
2019-05-27 13:11:01 +01:00
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-29 12:57:44 +01:00
|
|
|
#if SEND_AIRWELL
|
|
|
|
/// Send an Airwell A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRAirwellAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
void IRac::airwell(IRAirwellAc *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPowerToggle(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
// No Swing setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Economy setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_AIRWELL
|
|
|
|
|
2019-08-30 19:41:01 +01:00
|
|
|
#if SEND_AMCOR
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send an Amcor A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRAmcorAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
2019-08-30 19:41:01 +01:00
|
|
|
void IRac::amcor(IRAmcorAc *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode, const float degrees,
|
|
|
|
const stdAc::fanspeed_t fan) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-08-30 19:41:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
// No Swing setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Economy setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_AMCOR
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_ARGO
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send an Argo A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRArgoAC object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @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.
|
2019-05-27 13:11:01 +01:00
|
|
|
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 bool turbo, const int16_t sleep) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setMode(ac->convertMode(mode));
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setFlap(ac->convertSwingV(swingv));
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
ac->setMax(turbo);
|
|
|
|
// No Economy setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setNight(sleep >= 0); // Convert to a boolean.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_ARGO
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
#if SEND_CARRIER_AC64
|
|
|
|
/// Send a Carrier 64-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRCarrierAc64 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode.
|
|
|
|
/// @note -1 is Off, >= 0 is on.
|
|
|
|
void IRac::carrier64(IRCarrierAc64 *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv, const int16_t sleep) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingV((int8_t)swingv >= 0);
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Economy setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Convert to a boolean.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_CARRIER_AC64
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_COOLIX
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Coolix A/C message with the supplied settings.
|
|
|
|
/// @note May result in multiple messages being sent.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRCoolixAC object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] 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
|
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode.
|
|
|
|
/// @note -1 is Off, >= 0 is on.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::coolix(IRCoolixAC *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 light, const bool clean,
|
|
|
|
const int16_t sleep) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
|
|
|
ac->setPower(on);
|
|
|
|
if (!on) {
|
|
|
|
// after turn off AC no more commands should
|
|
|
|
// be accepted
|
|
|
|
ac->send();
|
|
|
|
return;
|
|
|
|
}
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
// No Econo setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
if (swingv != stdAc::swingv_t::kOff || swingh != stdAc::swingh_t::kOff) {
|
|
|
|
// Swing has a special command that needs to be sent independently.
|
|
|
|
ac->setSwing();
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
if (turbo) {
|
|
|
|
// Turbo has a special command that needs to be sent independently.
|
|
|
|
ac->setTurbo();
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
if (sleep > 0) {
|
|
|
|
// Sleep has a special command that needs to be sent independently.
|
|
|
|
ac->setSleep();
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
if (light) {
|
|
|
|
// Light has a special command that needs to be sent independently.
|
|
|
|
ac->setLed();
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
if (clean) {
|
|
|
|
// Clean has a special command that needs to be sent independently.
|
|
|
|
ac->setClean();
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_COOLIX
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
#if SEND_CORONA_AC
|
|
|
|
/// Send a Corona A/C message with the supplied settings.
|
|
|
|
/// @note May result in multiple messages being sent.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRCoronaAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
|
|
|
void IRac::corona(IRCoronaAc *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv, const bool econo) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVToggle(swingv != stdAc::swingv_t::kOff);
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
ac->setEcono(econo);
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_CARRIER_AC64
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_DAIKIN
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Daikin A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRDaikinESP object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
|
|
|
/// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::daikin(IRDaikinESP *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 quiet, const bool turbo, const bool econo,
|
|
|
|
const bool clean) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical((int8_t)swingv >= 0);
|
|
|
|
ac->setSwingHorizontal((int8_t)swingh >= 0);
|
|
|
|
ac->setQuiet(quiet);
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
ac->setPowerful(turbo);
|
|
|
|
ac->setEcono(econo);
|
|
|
|
ac->setMold(clean);
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN
|
|
|
|
|
2019-07-29 08:28:40 +01:00
|
|
|
#if SEND_DAIKIN128
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Daikin 128-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRDaikin128 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
2020-09-01 10:36:06 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[in] clock The time in Nr. of mins since midnight. < 0 is ignore.
|
2019-07-29 08:28:40 +01:00
|
|
|
void IRac::daikin128(IRDaikin128 *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv,
|
|
|
|
const bool quiet, const bool turbo, const bool light,
|
|
|
|
const bool econo, const int16_t sleep, const int16_t clock) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-07-29 08:28:40 +01:00
|
|
|
ac->setPowerToggle(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical((int8_t)swingv >= 0);
|
|
|
|
// No Horizontal Swing setting avaliable.
|
|
|
|
ac->setQuiet(quiet);
|
|
|
|
ac->setLightToggle(light ? kDaikin128BitWall : 0);
|
|
|
|
// No Filter setting available.
|
|
|
|
ac->setPowerful(turbo);
|
|
|
|
ac->setEcono(econo);
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep > 0);
|
|
|
|
if (clock >= 0) ac->setClock(clock);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN128
|
|
|
|
|
2019-11-02 11:21:18 +00:00
|
|
|
#if SEND_DAIKIN152
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Daikin 152-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRDaikin152 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
2019-11-02 11:21:18 +00:00
|
|
|
void IRac::daikin152(IRDaikin152 *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv,
|
|
|
|
const bool quiet, const bool turbo, const bool econo) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingV((int8_t)swingv >= 0);
|
|
|
|
// No Horizontal Swing setting avaliable.
|
|
|
|
ac->setQuiet(quiet);
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
ac->setPowerful(turbo);
|
|
|
|
ac->setEcono(econo);
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN152
|
|
|
|
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_DAIKIN160
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Daikin 160-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRDaikin160 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
2019-07-21 15:01:43 +01:00
|
|
|
void IRac::daikin160(IRDaikin160 *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical(ac->convertSwingV(swingv));
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN160
|
|
|
|
|
|
|
|
#if SEND_DAIKIN176
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Daikin 176-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRDaikin176 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingh The horizontal swing setting.
|
2019-07-21 15:01:43 +01:00
|
|
|
void IRac::daikin176(IRDaikin176 *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingh_t swingh) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingHorizontal(ac->convertSwingH(swingh));
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN176
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_DAIKIN2
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Daikin2 A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRDaikin2 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
|
|
|
/// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc
|
|
|
|
/// @param[in] beep Enable/Disable beeps when receiving IR messages.
|
2020-09-01 10:36:06 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[in] clock The time in Nr. of mins since midnight. < 0 is ignore.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::daikin2(IRDaikin2 *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 quiet, const bool turbo, const bool light,
|
|
|
|
const bool econo, const bool filter, const bool clean,
|
|
|
|
const bool beep, const int16_t sleep, const int16_t clock) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical(ac->convertSwingV(swingv));
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->setSwingHorizontal(ac->convertSwingH(swingh));
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setQuiet(quiet);
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->setLight(light ? 1 : 3); // On/High is 1, Off is 3.
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPowerful(turbo);
|
|
|
|
ac->setEcono(econo);
|
|
|
|
ac->setPurify(filter);
|
|
|
|
ac->setMold(clean);
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->setClean(true); // Hardwire auto clean to be on per request (@sheppy99)
|
|
|
|
ac->setBeep(beep ? 2 : 3); // On/Loud is 2, Off is 3.
|
2019-05-27 13:11:01 +01:00
|
|
|
if (sleep > 0) ac->enableSleepTimer(sleep);
|
|
|
|
if (clock >= 0) ac->setCurrentTime(clock);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN2
|
|
|
|
|
|
|
|
#if SEND_DAIKIN216
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Daikin 216-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRDaikin216 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::daikin216(IRDaikin216 *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,
|
2019-07-21 15:01:43 +01:00
|
|
|
const bool quiet, const bool turbo) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical((int8_t)swingv >= 0);
|
|
|
|
ac->setSwingHorizontal((int8_t)swingh >= 0);
|
|
|
|
ac->setQuiet(quiet);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setPowerful(turbo);
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN216
|
|
|
|
|
2020-04-09 09:25:50 +01:00
|
|
|
#if SEND_DAIKIN64
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Daikin 64-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRDaikin64 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
2020-09-01 10:36:06 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[in] clock The time in Nr. of mins since midnight. < 0 is ignore.
|
2020-04-09 09:25:50 +01:00
|
|
|
void IRac::daikin64(IRDaikin64 *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv,
|
|
|
|
const bool quiet, const bool turbo,
|
|
|
|
const int16_t sleep, const int16_t clock) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPowerToggle(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical((int8_t)swingv >= 0);
|
|
|
|
ac->setTurbo(turbo);
|
|
|
|
ac->setQuiet(quiet);
|
|
|
|
ac->setSleep(sleep >= 0);
|
2021-03-25 07:40:27 +00:00
|
|
|
if (clock >= 0) ac->setClock(clock);
|
2020-04-09 09:25:50 +01:00
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN64
|
|
|
|
|
2020-05-20 11:42:34 +01:00
|
|
|
#if SEND_DELONGHI_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Delonghi A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRDelonghiAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @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] fan The speed setting for the fan.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2020-05-20 11:42:34 +01:00
|
|
|
void IRac::delonghiac(IRDelonghiAc *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode, const bool celsius,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const bool turbo, const int16_t sleep) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees, !celsius);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setBoost(turbo);
|
|
|
|
ac->setSleep(sleep >= 0);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_DELONGHI_AC
|
|
|
|
|
2021-03-25 07:40:27 +00:00
|
|
|
#if SEND_ECOCLIM
|
|
|
|
/// Send an EcoClim A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IREcoclimAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPower(on);
|
|
|
|
uint8_t new_mode;
|
|
|
|
if (sleep >= 0) // EcoClim has a descrete Sleep operation mode, not a setting
|
|
|
|
new_mode = kEcoclimSleep; // Override the requested operating mode.
|
|
|
|
else
|
|
|
|
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));
|
|
|
|
// No SwingV setting available
|
|
|
|
// No SwingH setting available
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Econo setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
if (clock >= 0) ac->setClock(clock);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_ECOCLIM
|
|
|
|
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_ELECTRA_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send an Electra A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRElectraAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] 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
|
2019-07-21 15:01:43 +01:00
|
|
|
void IRac::electra(IRElectraAc *ac,
|
2019-05-27 13:11:01 +01:00
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
2019-07-21 15:01:43 +01:00
|
|
|
const stdAc::swingv_t swingv,
|
2020-02-29 12:51:16 +00:00
|
|
|
const stdAc::swingh_t swingh, const bool turbo,
|
|
|
|
const bool lighttoggle, const bool clean) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setPower(on);
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingV(swingv != stdAc::swingv_t::kOff);
|
|
|
|
ac->setSwingH(swingh != stdAc::swingh_t::kOff);
|
|
|
|
// No Quiet setting available.
|
2020-02-29 12:51:16 +00:00
|
|
|
ac->setTurbo(turbo);
|
|
|
|
ac->setLightToggle(lighttoggle);
|
2019-05-27 13:11:01 +01:00
|
|
|
// No Econo setting available.
|
|
|
|
// No Filter setting available.
|
2020-02-29 12:51:16 +00:00
|
|
|
ac->setClean(clean);
|
2019-05-27 13:11:01 +01:00
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_ELECTRA_AC
|
|
|
|
|
|
|
|
#if SEND_FUJITSU_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Fujitsu A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRFujitsuAC object to use.
|
|
|
|
/// @param[in] model The A/C model to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
|
|
|
/// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc
|
2020-10-04 10:04:34 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. <= 0 is Off, > 0 is on.
|
2019-07-21 15:01:43 +01:00
|
|
|
void IRac::fujitsu(IRFujitsuAC *ac, const fujitsu_ac_remote_model_t model,
|
|
|
|
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,
|
2019-11-02 11:21:18 +00:00
|
|
|
const bool quiet, const bool turbo, const bool econo,
|
2020-10-04 10:04:34 +01:00
|
|
|
const bool filter, const bool clean, const int16_t sleep) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setModel(model);
|
|
|
|
if (on) {
|
|
|
|
// Do all special messages (except "Off") first,
|
|
|
|
// These need to be sent separately.
|
|
|
|
switch (ac->getModel()) {
|
|
|
|
// Some functions are only available on some models.
|
|
|
|
case fujitsu_ac_remote_model_t::ARREB1E:
|
|
|
|
if (turbo) {
|
|
|
|
ac->setCmd(kFujitsuAcCmdPowerful);
|
|
|
|
// Powerful is a separate command.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
if (econo) {
|
|
|
|
ac->setCmd(kFujitsuAcCmdEcono);
|
|
|
|
// Econo is a separate command.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
{};
|
|
|
|
}
|
|
|
|
// Normal operation.
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFanSpeed(ac->convertFan(fan));
|
|
|
|
uint8_t swing = kFujitsuAcSwingOff;
|
|
|
|
if (swingv > stdAc::swingv_t::kOff) swing |= kFujitsuAcSwingVert;
|
|
|
|
if (swingh > stdAc::swingh_t::kOff) swing |= kFujitsuAcSwingHoriz;
|
|
|
|
ac->setSwing(swing);
|
|
|
|
if (quiet) ac->setFanSpeed(kFujitsuAcFanQuiet);
|
|
|
|
// No Light setting available.
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->setFilter(filter);
|
|
|
|
ac->setClean(clean);
|
2019-07-21 15:01:43 +01:00
|
|
|
// No Beep setting available.
|
2020-10-04 10:04:34 +01:00
|
|
|
ac->setSleepTimer(sleep > 0 ? sleep : 0);
|
2019-07-21 15:01:43 +01:00
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
2019-08-30 19:41:01 +01:00
|
|
|
ac->on(); // Ref: Issue #860
|
2019-07-21 15:01:43 +01:00
|
|
|
} else {
|
|
|
|
// Off is special case/message. We don't need to send other messages.
|
|
|
|
ac->off();
|
|
|
|
}
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_FUJITSU_AC
|
|
|
|
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_GOODWEATHER
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Goodweather A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRGoodweatherAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2019-07-21 15:01:43 +01:00
|
|
|
void IRac::goodweather(IRGoodweatherAc *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 bool light,
|
|
|
|
const int16_t sleep) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwing(swingv == stdAc::swingv_t::kOff ? kGoodweatherSwingOff
|
|
|
|
: kGoodweatherSwingSlow);
|
|
|
|
ac->setTurbo(turbo);
|
|
|
|
ac->setLight(light);
|
|
|
|
// No Clean setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep on this A/C is either on or off.
|
|
|
|
// No Horizontal Swing setting available.
|
|
|
|
// No Econo setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_GOODWEATHER
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_GREE
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Gree A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRGreeAC object to use.
|
|
|
|
/// @param[in] model The A/C model to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @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] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @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
|
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2019-07-29 08:28:40 +01:00
|
|
|
void IRac::gree(IRGreeAC *ac, const gree_ac_remote_model_t model,
|
2020-05-20 11:42:34 +01:00
|
|
|
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 turbo,
|
|
|
|
const bool light, const bool clean, const int16_t sleep) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-07-29 08:28:40 +01:00
|
|
|
ac->setModel(model);
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
2020-05-20 11:42:34 +01:00
|
|
|
ac->setTemp(degrees, !celsius);
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical(swingv == stdAc::swingv_t::kAuto, // Set auto flag.
|
|
|
|
ac->convertSwingV(swingv));
|
|
|
|
ac->setLight(light);
|
|
|
|
ac->setTurbo(turbo);
|
|
|
|
ac->setXFan(clean);
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep on this A/C is either on or off.
|
|
|
|
// No Horizontal Swing setting available.
|
2019-07-21 15:01:43 +01:00
|
|
|
// No Econo setting available.
|
2019-05-27 13:11:01 +01:00
|
|
|
// No Filter setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_GREE
|
|
|
|
|
|
|
|
#if SEND_HAIER_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Haier A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRGreeAC object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
|
|
|
/// @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.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::haier(IRHaierAC *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode, const float degrees,
|
|
|
|
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
|
|
|
|
const bool filter, const int16_t sleep, const int16_t clock) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwing(ac->convertSwingV(swingv));
|
|
|
|
// No Horizontal Swing setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
ac->setHealth(filter);
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep on this A/C is either on or off.
|
2020-10-04 10:04:34 +01:00
|
|
|
if (clock >= 0) ac->setCurrTime(clock);
|
2019-05-27 13:11:01 +01:00
|
|
|
if (on)
|
|
|
|
ac->setCommand(kHaierAcCmdOn);
|
|
|
|
else
|
|
|
|
ac->setCommand(kHaierAcCmdOff);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_HAIER_AC
|
|
|
|
|
|
|
|
#if SEND_HAIER_AC_YRW02
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Haier YRWO2 A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRHaierACYRW02 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::haierYrwo2(IRHaierACYRW02 *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 bool filter, const int16_t sleep) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwing(ac->convertSwingV(swingv));
|
|
|
|
// No Horizontal Swing setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
ac->setTurbo(turbo);
|
|
|
|
// No Light setting available.
|
|
|
|
ac->setHealth(filter);
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep on this A/C is either on or off.
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_HAIER_AC_YRW02
|
|
|
|
|
|
|
|
#if SEND_HITACHI_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Hitachi A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRHitachiAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] swingh The horizontal swing setting.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::hitachi(IRHitachiAc *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) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical(swingv != stdAc::swingv_t::kOff);
|
|
|
|
ac->setSwingHorizontal(swingh != stdAc::swingh_t::kOff);
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_HITACHI_AC
|
|
|
|
|
2020-04-09 09:25:50 +01:00
|
|
|
#if SEND_HITACHI_AC1
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Hitachi1 A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRHitachiAc1 object to use.
|
|
|
|
/// @param[in] model The A/C model to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] power_toggle The power toggle setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] swing_toggle The swing_toggle setting.
|
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
|
|
|
/// @note The sleep mode used is the "Sleep 2" setting.
|
2020-04-09 09:25:50 +01:00
|
|
|
void IRac::hitachi1(IRHitachiAc1 *ac, const hitachi_ac1_remote_model_t model,
|
|
|
|
const bool on, const bool power_toggle,
|
|
|
|
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 swing_toggle, const int16_t sleep) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setModel(model);
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setPowerToggle(power_toggle);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingV(swingv != stdAc::swingv_t::kOff);
|
|
|
|
ac->setSwingH(swingh != stdAc::swingh_t::kOff);
|
|
|
|
ac->setSwingToggle(swing_toggle);
|
|
|
|
ac->setSleep((sleep >= 0) ? kHitachiAc1Sleep2 : kHitachiAc1SleepOff);
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Swing(H) setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_HITACHI_AC1
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
#if SEND_HITACHI_AC344
|
|
|
|
/// Send a Hitachi 344-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRHitachiAc344 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] swingh The horizontal swing setting.
|
|
|
|
void IRac::hitachi344(IRHitachiAc344 *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) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingH(ac->convertSwingH(swingh));
|
|
|
|
ac->setPower(on);
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
|
|
|
|
// SwingVToggle is special. Needs to be last method called.
|
|
|
|
ac->setSwingVToggle(swingv != stdAc::swingv_t::kOff);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_HITACHI_AC344
|
|
|
|
|
2019-11-02 11:21:18 +00:00
|
|
|
#if SEND_HITACHI_AC424
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Hitachi 424-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRHitachiAc424 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
2019-11-02 11:21:18 +00:00
|
|
|
void IRac::hitachi424(IRHitachiAc424 *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
2019-11-25 20:43:39 +00:00
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
2019-11-25 20:43:39 +00:00
|
|
|
ac->setPower(on);
|
|
|
|
// SwingVToggle is special. Needs to be last method called.
|
|
|
|
ac->setSwingVToggle(swingv != stdAc::swingv_t::kOff);
|
2019-11-02 11:21:18 +00:00
|
|
|
// No Swing(H) setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_HITACHI_AC424
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_KELVINATOR
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Kelvinator A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRKelvinatorAC object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
|
|
|
/// @param[in] clean Turn on the self-cleaning mode. e.g. XFan, dry filters etc
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::kelvinator(IRKelvinatorAC *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 quiet, const bool turbo, const bool light,
|
|
|
|
const bool filter, const bool clean) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan((uint8_t)fan); // No conversion needed.
|
|
|
|
ac->setSwingVertical((int8_t)swingv >= 0);
|
|
|
|
ac->setSwingHorizontal((int8_t)swingh >= 0);
|
|
|
|
ac->setQuiet(quiet);
|
|
|
|
ac->setTurbo(turbo);
|
|
|
|
ac->setLight(light);
|
|
|
|
ac->setIonFilter(filter);
|
|
|
|
ac->setXFan(clean);
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_KELVINATOR
|
|
|
|
|
2020-01-06 16:27:36 +00:00
|
|
|
#if SEND_LG
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a LG A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRLgAc object to use.
|
|
|
|
/// @param[in] model The A/C model to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
2020-01-06 16:27:36 +00:00
|
|
|
void IRac::lg(IRLgAc *ac, const lg_ac_remote_model_t model,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setModel(model);
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
// No Vertical swing setting available.
|
|
|
|
// No Horizontal swing setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_LG
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_MIDEA
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Midea A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRMideaAC object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @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] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @param[in] turbo Toggle the device's turbo/powerful mode.
|
|
|
|
/// @param[in] econo Toggle the device's economical mode.
|
|
|
|
/// @param[in] light Toggle the LED/Display mode.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2020-07-29 12:57:44 +01:00
|
|
|
/// @note On Danby A/C units, swingv controls the Ion Filter instead.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::midea(IRMideaAC *ac,
|
2019-07-29 08:28:40 +01:00
|
|
|
const bool on, const stdAc::opmode_t mode, const bool celsius,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
2020-11-14 18:31:50 +00:00
|
|
|
const stdAc::swingv_t swingv, const bool turbo,
|
|
|
|
const bool econo, const bool light, const int16_t sleep) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
2019-07-29 08:28:40 +01:00
|
|
|
ac->setUseCelsius(celsius);
|
|
|
|
ac->setTemp(degrees, celsius);
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setFan(ac->convertFan(fan));
|
2019-07-29 08:28:40 +01:00
|
|
|
ac->setSwingVToggle(swingv != stdAc::swingv_t::kOff);
|
2019-05-27 13:11:01 +01:00
|
|
|
// No Horizontal swing setting available.
|
|
|
|
// No Quiet setting available.
|
2020-11-14 18:31:50 +00:00
|
|
|
ac->setTurboToggle(turbo);
|
2020-07-29 12:57:44 +01:00
|
|
|
ac->setEconoToggle(econo);
|
2020-11-14 18:31:50 +00:00
|
|
|
ac->setLightToggle(light);
|
2019-05-27 13:11:01 +01:00
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep on this A/C is either on or off.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_MIDEA
|
|
|
|
|
|
|
|
#if SEND_MITSUBISHI_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Mitsubishi A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRMitsubishiAC object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] clock The time in Nr. of mins since midnight. < 0 is ignore.
|
|
|
|
/// @note Clock can only be set in 10 minute increments. i.e. % 10.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::mitsubishi(IRMitsubishiAC *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees,
|
|
|
|
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
|
2019-07-29 08:28:40 +01:00
|
|
|
const stdAc::swingh_t swingh,
|
2019-05-27 13:11:01 +01:00
|
|
|
const bool quiet, const int16_t clock) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2021-02-13 13:51:52 +00:00
|
|
|
// Uncomment next line if you *really* need the weekly timer enabled via IRac.
|
|
|
|
// ac->setWeeklyTimerEnabled(true); // Weekly Timer is disabled by default.
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setVane(ac->convertSwingV(swingv));
|
2019-07-29 08:28:40 +01:00
|
|
|
ac->setWideVane(ac->convertSwingH(swingh));
|
2019-05-27 13:11:01 +01:00
|
|
|
if (quiet) ac->setFan(kMitsubishiAcFanSilent);
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
if (clock >= 0) ac->setClock(clock / 10); // Clock is in 10 min increments.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_MITSUBISHI_AC
|
|
|
|
|
2019-11-02 11:21:18 +00:00
|
|
|
#if SEND_MITSUBISHI112
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Mitsubishi 112-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRMitsubishi112 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] quiet Run the device in quiet/silent mode.
|
2019-11-02 11:21:18 +00:00
|
|
|
void IRac::mitsubishi112(IRMitsubishi112 *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 quiet) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingV(ac->convertSwingV(swingv));
|
|
|
|
ac->setSwingH(ac->convertSwingH(swingh));
|
|
|
|
ac->setQuiet(quiet);
|
|
|
|
// FIXME - Econo
|
|
|
|
// ac->setEcono(econo);
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_MITSUBISHI112
|
|
|
|
|
|
|
|
#if SEND_MITSUBISHI136
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Mitsubishi 136-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRMitsubishi136 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] quiet Run the device in quiet/silent mode.
|
2019-11-02 11:21:18 +00:00
|
|
|
void IRac::mitsubishi136(IRMitsubishi136 *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv, const bool quiet) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingV(ac->convertSwingV(swingv));
|
|
|
|
// No Horizontal Swing setting available.
|
|
|
|
ac->setQuiet(quiet);
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_MITSUBISHI136
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_MITSUBISHIHEAVY
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Mitsubishi Heavy 88-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRMitsubishiHeavy88Ac object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
|
|
|
/// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::mitsubishiHeavy88(IRMitsubishiHeavy88Ac *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 econo,
|
|
|
|
const bool clean) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical(ac->convertSwingV(swingv));
|
|
|
|
ac->setSwingHorizontal(ac->convertSwingH(swingh));
|
|
|
|
// No Quiet setting available.
|
|
|
|
ac->setTurbo(turbo);
|
|
|
|
// No Light setting available.
|
|
|
|
ac->setEcono(econo);
|
|
|
|
// No Filter setting available.
|
|
|
|
ac->setClean(clean);
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Mitsubishi Heavy 152-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRMitsubishiHeavy152Ac object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
|
|
|
/// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc
|
2020-09-01 10:36:06 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::mitsubishiHeavy152(IRMitsubishiHeavy152Ac *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 quiet, const bool turbo,
|
|
|
|
const bool econo, const bool filter,
|
|
|
|
const bool clean, const int16_t sleep) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical(ac->convertSwingV(swingv));
|
|
|
|
ac->setSwingHorizontal(ac->convertSwingH(swingh));
|
|
|
|
ac->setSilent(quiet);
|
|
|
|
ac->setTurbo(turbo);
|
|
|
|
// No Light setting available.
|
|
|
|
ac->setEcono(econo);
|
|
|
|
ac->setClean(clean);
|
|
|
|
ac->setFilter(filter);
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setNight(sleep >= 0); // Sleep is either on/off, so convert to boolean.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_MITSUBISHIHEAVY
|
|
|
|
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_NEOCLIMA
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Neoclima A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRNeoclimaAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
2020-10-04 10:04:34 +01:00
|
|
|
/// @param[in] celsius Temperature units. True is Celsius, False is Fahrenheit.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] turbo Run the device in turbo/powerful mode.
|
2020-10-04 10:04:34 +01:00
|
|
|
/// @param[in] econo Run the device in economical mode.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
2020-09-01 10:36:06 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2019-07-21 15:01:43 +01:00
|
|
|
void IRac::neoclima(IRNeoclimaAc *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
2020-10-04 10:04:34 +01:00
|
|
|
const bool celsius, const float degrees,
|
|
|
|
const stdAc::fanspeed_t fan,
|
2019-07-21 15:01:43 +01:00
|
|
|
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
|
2020-10-04 10:04:34 +01:00
|
|
|
const bool turbo, const bool econo, const bool light,
|
|
|
|
const bool filter, const int16_t sleep) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setMode(ac->convertMode(mode));
|
2020-10-04 10:04:34 +01:00
|
|
|
ac->setTemp(degrees, celsius);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingV(swingv != stdAc::swingv_t::kOff);
|
|
|
|
ac->setSwingH(swingh != stdAc::swingh_t::kOff);
|
|
|
|
// No Quiet setting available.
|
|
|
|
ac->setTurbo(turbo);
|
|
|
|
ac->setLight(light);
|
2020-10-04 10:04:34 +01:00
|
|
|
ac->setEcono(econo);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setIon(filter);
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep is either on/off, so convert to boolean.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_NEOCLIMA
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_PANASONIC_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Panasonic A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRPanasonicAc object to use.
|
|
|
|
/// @param[in] model The A/C model to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
|
|
|
/// @param[in] clock The time in Nr. of mins since midnight. < 0 is ignore.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::panasonic(IRPanasonicAc *ac, const panasonic_ac_remote_model_t model,
|
|
|
|
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,
|
2020-02-03 18:41:35 +00:00
|
|
|
const bool quiet, const bool turbo, const bool filter,
|
|
|
|
const int16_t clock) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setModel(model);
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical(ac->convertSwingV(swingv));
|
|
|
|
ac->setSwingHorizontal(ac->convertSwingH(swingh));
|
|
|
|
ac->setQuiet(quiet);
|
|
|
|
ac->setPowerful(turbo);
|
2020-02-03 18:41:35 +00:00
|
|
|
ac->setIon(filter);
|
2019-05-27 13:11:01 +01:00
|
|
|
// No Light setting available.
|
|
|
|
// No Econo setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
if (clock >= 0) ac->setClock(clock);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_PANASONIC_AC
|
|
|
|
|
2021-01-04 17:43:58 +00:00
|
|
|
#if SEND_PANASONIC_AC32
|
|
|
|
/// Send a Panasonic A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRPanasonicAc32 object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] swingh The horizontal swing setting.
|
|
|
|
void IRac::panasonic32(IRPanasonicAc32 *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) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPowerToggle(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical(ac->convertSwingV(swingv));
|
|
|
|
ac->setSwingHorizontal(swingh != stdAc::swingh_t::kOff);
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Econo setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_PANASONIC_AC32
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_SAMSUNG_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Samsung A/C message with the supplied settings.
|
|
|
|
/// @note Multiple IR messages may be generated & sent.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRSamsungAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
|
|
|
/// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc
|
|
|
|
/// @param[in] beep Enable/Disable beeps when receiving IR messages.
|
|
|
|
/// @param[in] prevpower The power setting from the previous A/C state.
|
|
|
|
/// @param[in] forcepower Do we force send the special power message?
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::samsung(IRSamsungAc *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees,
|
|
|
|
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
|
2020-02-29 12:51:16 +00:00
|
|
|
const bool quiet, const bool turbo, const bool light,
|
|
|
|
const bool filter, const bool clean,
|
2019-11-02 11:21:18 +00:00
|
|
|
const bool beep, const bool prevpower,
|
|
|
|
const bool forcepower) {
|
|
|
|
ac->begin();
|
|
|
|
ac->stateReset(forcepower, prevpower);
|
|
|
|
ac->setPower(on);
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwing(swingv != stdAc::swingv_t::kOff);
|
|
|
|
// No Horizontal swing setting available.
|
|
|
|
ac->setQuiet(quiet);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setPowerful(turbo);
|
2020-02-29 12:51:16 +00:00
|
|
|
ac->setDisplay(light);
|
2019-05-27 13:11:01 +01:00
|
|
|
// No Econo setting available.
|
2020-02-29 12:51:16 +00:00
|
|
|
ac->setIon(filter);
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setClean(clean);
|
|
|
|
ac->setBeep(beep);
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
// Do setMode() again as it can affect fan speed.
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_SAMSUNG_AC
|
|
|
|
|
2020-07-29 12:57:44 +01:00
|
|
|
#if SEND_SANYO_AC
|
|
|
|
/// Send a Toshiba A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRSanyoAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] beep Enable/Disable beeps when receiving IR messages.
|
2020-09-01 10:36:06 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2020-07-29 12:57:44 +01:00
|
|
|
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) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingV(ac->convertSwingV(swingv));
|
|
|
|
// No Horizontal swing setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Econo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
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
|
|
|
|
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_SHARP_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Sharp A/C message with the supplied settings.
|
|
|
|
/// @note Multiple IR messages may be generated & sent.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRSharpAc object to use.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @param[in] model The A/C model to use.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] prev_power The power setting from the previous A/C state.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
|
|
|
/// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc
|
2020-11-14 18:31:50 +00:00
|
|
|
void IRac::sharp(IRSharpAc *ac, const sharp_ac_remote_model_t model,
|
2020-04-09 09:25:50 +01:00
|
|
|
const bool on, const bool prev_power,
|
|
|
|
const stdAc::opmode_t mode,
|
2020-05-20 11:42:34 +01:00
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv, const bool turbo,
|
2020-11-14 18:31:50 +00:00
|
|
|
const bool light, const bool filter, const bool clean) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2020-11-14 18:31:50 +00:00
|
|
|
ac->setModel(model);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
2021-02-13 13:51:52 +00:00
|
|
|
ac->setFan(ac->convertFan(fan, model));
|
2020-05-20 11:42:34 +01:00
|
|
|
ac->setSwingToggle(swingv != stdAc::swingv_t::kOff);
|
2020-11-14 18:31:50 +00:00
|
|
|
// Econo deliberately not used as it cycles through 3 modes uncontrollably.
|
2020-05-20 11:42:34 +01:00
|
|
|
// ac->setEconoToggle(econo);
|
|
|
|
ac->setIon(filter);
|
2019-07-21 15:01:43 +01:00
|
|
|
// No Horizontal swing setting available.
|
|
|
|
// No Quiet setting available.
|
2020-11-14 18:31:50 +00:00
|
|
|
ac->setLightToggle(light);
|
2019-07-21 15:01:43 +01:00
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
// Do setMode() again as it can affect fan speed and temp.
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
2020-05-20 11:42:34 +01:00
|
|
|
// Clean after mode, as it can affect the mode, temp & fan speed.
|
|
|
|
if (clean) {
|
|
|
|
// A/C needs to be off before we can enter clean mode.
|
|
|
|
ac->setPower(false, prev_power);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
ac->setClean(clean);
|
2021-02-13 13:51:52 +00:00
|
|
|
ac->setPower(on, prev_power);
|
2020-05-20 11:42:34 +01:00
|
|
|
if (turbo) {
|
|
|
|
ac->send(); // Send the current state.
|
|
|
|
// Set up turbo mode as it needs to be sent after everything else.
|
|
|
|
ac->setTurbo(true);
|
|
|
|
}
|
2019-07-21 15:01:43 +01:00
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_SHARP_AC
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_TCL112AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a TCL 112-bit A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRTcl112Ac object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::tcl112(IRTcl112Ac *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 light, const bool econo,
|
|
|
|
const bool filter) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingVertical(swingv != stdAc::swingv_t::kOff);
|
|
|
|
ac->setSwingHorizontal(swingh != stdAc::swingh_t::kOff);
|
|
|
|
// No Quiet setting available.
|
|
|
|
ac->setTurbo(turbo);
|
|
|
|
ac->setLight(light);
|
|
|
|
ac->setEcono(econo);
|
|
|
|
ac->setHealth(filter);
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_TCL112AC
|
|
|
|
|
2020-10-04 10:04:34 +01:00
|
|
|
#if SEND_TECHNIBEL_AC
|
|
|
|
/// Send a Technibel A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRTechnibelAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @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] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
|
|
|
void IRac::technibel(IRTechnibelAc *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 int16_t sleep) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees, !celsius);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwing(swingv != stdAc::swingv_t::kOff);
|
|
|
|
// No Horizontal swing setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep is either on/off, so convert to boolean.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_TECHNIBEL_AC
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_TECO
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Teco A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRTecoAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
2020-09-01 10:36:06 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::teco(IRTecoAc *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode, const float degrees,
|
|
|
|
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
|
2019-08-30 19:41:01 +01:00
|
|
|
const bool light, const int16_t sleep) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwing(swingv != stdAc::swingv_t::kOff);
|
|
|
|
// No Horizontal swing setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
2019-08-30 19:41:01 +01:00
|
|
|
ac->setLight(light);
|
2019-05-27 13:11:01 +01:00
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep is either on/off, so convert to boolean.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_TECO
|
|
|
|
|
|
|
|
#if SEND_TOSHIBA_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Toshiba A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRToshibaAC object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
2020-07-29 12:57:44 +01:00
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::toshiba(IRToshibaAC *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
2020-07-29 12:57:44 +01:00
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv,
|
|
|
|
const bool turbo, const bool econo) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
2020-07-29 12:57:44 +01:00
|
|
|
// The API has no "step" option, so off is off, anything else is on.
|
|
|
|
ac->setSwing((swingv == stdAc::swingv_t::kOff) ? kToshibaAcSwingOff
|
|
|
|
: kToshibaAcSwingOn);
|
2019-05-27 13:11:01 +01:00
|
|
|
// No Horizontal swing setting available.
|
|
|
|
// No Quiet setting available.
|
2020-07-29 12:57:44 +01:00
|
|
|
ac->setTurbo(turbo);
|
|
|
|
ac->setEcono(econo);
|
2019-05-27 13:11:01 +01:00
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Sleep setting available.
|
|
|
|
// No Clock setting available.
|
2020-09-01 10:36:06 +01:00
|
|
|
// Do this last because Toshiba A/C has an odd quirk with how power off works.
|
|
|
|
ac->setPower(on);
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_TOSHIBA_AC
|
|
|
|
|
|
|
|
#if SEND_TROTEC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Trotec A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRTrotecESP object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
2020-09-01 10:36:06 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::trotec(IRTrotecESP *ac,
|
|
|
|
const bool on, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const stdAc::fanspeed_t fan,
|
|
|
|
const int16_t sleep) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setSpeed(ac->convertFan(fan));
|
|
|
|
// No Vertical swing setting available.
|
|
|
|
// No Horizontal swing setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
// No Turbo setting available.
|
|
|
|
// No Light setting available.
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep is either on/off, so convert to boolean.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_TROTEC
|
|
|
|
|
|
|
|
#if SEND_VESTEL_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Vestel A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRVestelAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
2020-09-01 10:36:06 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[in] clock The time in Nr. of mins since midnight. < 0 is ignore.
|
|
|
|
/// @param[in] sendNormal Do we send a Normal settings message at all?
|
|
|
|
/// i.e In addition to the clock/time/timer message
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::vestel(IRVestelAc *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 bool filter, const int16_t sleep,
|
|
|
|
const int16_t clock, const bool sendNormal) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwing(swingv != stdAc::swingv_t::kOff);
|
|
|
|
// No Horizontal swing setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
ac->setTurbo(turbo);
|
|
|
|
// No Light setting available.
|
|
|
|
ac->setIon(filter);
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep is either on/off, so convert to boolean.
|
|
|
|
if (sendNormal) ac->send(); // Send the normal message.
|
|
|
|
if (clock >= 0) {
|
|
|
|
ac->setTime(clock);
|
|
|
|
ac->send(); // Setting the clock requires a different "timer" message.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // SEND_VESTEL_AC
|
|
|
|
|
2020-09-01 10:36:06 +01:00
|
|
|
#if SEND_VOLTAS
|
|
|
|
/// Send a Voltas A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRVoltas object to use.
|
|
|
|
/// @param[in] model The A/C model to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @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] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
|
|
|
void IRac::voltas(IRVoltas *ac,
|
|
|
|
const voltas_ac_remote_model_t model,
|
|
|
|
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 econo, const bool light,
|
|
|
|
const int16_t sleep) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setModel(model);
|
|
|
|
ac->setPower(on);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwingV(swingv != stdAc::swingv_t::kOff);
|
|
|
|
ac->setSwingH(swingh != stdAc::swingh_t::kOff);
|
|
|
|
// No Quiet setting available.
|
|
|
|
ac->setTurbo(turbo);
|
|
|
|
ac->setEcono(econo);
|
|
|
|
ac->setLight(light);
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep is either on/off, so convert to boolean.
|
|
|
|
// No Clock setting available.
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_VOLTAS
|
|
|
|
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_WHIRLPOOL_AC
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send a Whirlpool A/C message with the supplied settings.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRWhirlpoolAc object to use.
|
|
|
|
/// @param[in] model The A/C model to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
2020-09-01 10:36:06 +01:00
|
|
|
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[in] clock The time in Nr. of mins since midnight. < 0 is ignore.
|
2019-05-27 13:11:01 +01:00
|
|
|
void IRac::whirlpool(IRWhirlpoolAc *ac, const whirlpool_ac_remote_model_t model,
|
|
|
|
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 bool light,
|
|
|
|
const int16_t sleep, const int16_t clock) {
|
2019-11-02 11:21:18 +00:00
|
|
|
ac->begin();
|
2019-05-27 13:11:01 +01:00
|
|
|
ac->setModel(model);
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
ac->setSwing(swingv != stdAc::swingv_t::kOff);
|
|
|
|
// No Horizontal swing setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
ac->setSuper(turbo);
|
|
|
|
ac->setLight(light);
|
|
|
|
// No Filter setting available
|
|
|
|
// No Clean setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
ac->setSleep(sleep >= 0); // Sleep is either on/off, so convert to boolean.
|
|
|
|
if (clock >= 0) ac->setClock(clock);
|
|
|
|
ac->setPowerToggle(on);
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_WHIRLPOOL_AC
|
|
|
|
|
2020-10-04 10:04:34 +01:00
|
|
|
#if SEND_TRANSCOLD
|
|
|
|
/// Send a Transcold A/C message with the supplied settings.
|
|
|
|
/// @note May result in multiple messages being sent.
|
|
|
|
/// @param[in, out] ac A Ptr to an IRTranscoldAc object to use.
|
|
|
|
/// @param[in] on The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] swingh The horizontal swing setting.
|
|
|
|
/// @note -1 is Off, >= 0 is on.
|
|
|
|
void IRac::transcold(IRTranscoldAc *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) {
|
|
|
|
ac->begin();
|
|
|
|
ac->setPower(on);
|
|
|
|
if (!on) {
|
|
|
|
// after turn off AC no more commands should
|
|
|
|
// be accepted
|
|
|
|
ac->send();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ac->setMode(ac->convertMode(mode));
|
|
|
|
ac->setTemp(degrees);
|
|
|
|
ac->setFan(ac->convertFan(fan));
|
|
|
|
// No Filter setting available.
|
|
|
|
// No Beep setting available.
|
|
|
|
// No Clock setting available.
|
|
|
|
// No Econo setting available.
|
|
|
|
// No Quiet setting available.
|
|
|
|
if (swingv != stdAc::swingv_t::kOff || swingh != stdAc::swingh_t::kOff) {
|
|
|
|
// Swing has a special command that needs to be sent independently.
|
|
|
|
ac->setSwing();
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
|
|
|
|
ac->send();
|
|
|
|
}
|
|
|
|
#endif // SEND_TRANSCOLD
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Create a new state base on the provided state that has been suitably fixed.
|
|
|
|
/// @note This is for use with Home Assistant, which requires mode to be off if
|
|
|
|
/// the power is off.
|
|
|
|
/// @param[in] state The state_t structure describing the desired a/c state.
|
|
|
|
/// @return A stdAc::state_t with the needed settings.
|
2020-01-06 16:27:36 +00:00
|
|
|
stdAc::state_t IRac::cleanState(const stdAc::state_t state) {
|
|
|
|
stdAc::state_t result = state;
|
|
|
|
// A hack for Home Assistant, it appears to need/want an Off opmode.
|
|
|
|
// So enforce the power is off if the mode is also off.
|
|
|
|
if (state.mode == stdAc::opmode_t::kOff) result.power = false;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Create a new state base on desired & previous states but handle
|
|
|
|
/// any state changes for options that need to be toggled.
|
|
|
|
/// @param[in] desired The state_t structure describing the desired a/c state.
|
|
|
|
/// @param[in] prev A Ptr to the previous state_t structure.
|
|
|
|
/// @return A stdAc::state_t with the needed settings.
|
2019-07-21 15:01:43 +01:00
|
|
|
stdAc::state_t IRac::handleToggles(const stdAc::state_t desired,
|
|
|
|
const stdAc::state_t *prev) {
|
|
|
|
stdAc::state_t result = desired;
|
|
|
|
// If we've been given a previous state AND the it's the same A/C basically.
|
|
|
|
if (prev != NULL && desired.protocol == prev->protocol &&
|
|
|
|
desired.model == prev->model) {
|
|
|
|
// Check if we have to handle toggle settings for specific A/C protocols.
|
|
|
|
switch (desired.protocol) {
|
|
|
|
case decode_type_t::COOLIX:
|
2020-10-04 10:04:34 +01:00
|
|
|
case decode_type_t::TRANSCOLD:
|
2019-07-21 15:01:43 +01:00
|
|
|
if ((desired.swingv == stdAc::swingv_t::kOff) ^
|
|
|
|
(prev->swingv == stdAc::swingv_t::kOff)) // It changed, so toggle.
|
|
|
|
result.swingv = stdAc::swingv_t::kAuto;
|
|
|
|
else
|
|
|
|
result.swingv = stdAc::swingv_t::kOff; // No change, so no toggle.
|
|
|
|
result.turbo = desired.turbo ^ prev->turbo;
|
|
|
|
result.light = desired.light ^ prev->light;
|
|
|
|
result.clean = desired.clean ^ prev->clean;
|
2019-07-29 08:28:40 +01:00
|
|
|
result.sleep = ((desired.sleep >= 0) ^ (prev->sleep >= 0)) ? 0 : -1;
|
|
|
|
break;
|
|
|
|
case decode_type_t::DAIKIN128:
|
|
|
|
result.power = desired.power ^ prev->power;
|
|
|
|
result.light = desired.light ^ prev->light;
|
|
|
|
break;
|
2020-02-29 12:51:16 +00:00
|
|
|
case decode_type_t::ELECTRA_AC:
|
|
|
|
result.light = desired.light ^ prev->light;
|
|
|
|
break;
|
2021-01-04 17:43:58 +00:00
|
|
|
case decode_type_t::FUJITSU_AC:
|
|
|
|
result.turbo = desired.turbo ^ prev->turbo;
|
|
|
|
result.econo = desired.econo ^ prev->econo;
|
|
|
|
break;
|
2020-07-29 12:57:44 +01:00
|
|
|
case decode_type_t::MIDEA:
|
2020-11-14 18:31:50 +00:00
|
|
|
result.turbo = desired.turbo ^ prev->turbo;
|
2020-07-29 12:57:44 +01:00
|
|
|
result.econo = desired.econo ^ prev->econo;
|
2020-11-14 18:31:50 +00:00
|
|
|
result.light = desired.light ^ prev->light;
|
2020-07-29 12:57:44 +01:00
|
|
|
// FALL THRU
|
2020-06-24 20:48:33 +01:00
|
|
|
case decode_type_t::CORONA_AC:
|
|
|
|
case decode_type_t::HITACHI_AC344:
|
2019-11-25 20:43:39 +00:00
|
|
|
case decode_type_t::HITACHI_AC424:
|
2020-11-14 18:31:50 +00:00
|
|
|
if ((desired.swingv == stdAc::swingv_t::kOff) ^
|
|
|
|
(prev->swingv == stdAc::swingv_t::kOff)) // It changed, so toggle.
|
|
|
|
result.swingv = stdAc::swingv_t::kAuto;
|
|
|
|
else
|
|
|
|
result.swingv = stdAc::swingv_t::kOff; // No change, so no toggle.
|
|
|
|
break;
|
2020-05-20 11:42:34 +01:00
|
|
|
case decode_type_t::SHARP_AC:
|
2020-11-14 18:31:50 +00:00
|
|
|
result.light = desired.light ^ prev->light;
|
2019-07-29 08:28:40 +01:00
|
|
|
if ((desired.swingv == stdAc::swingv_t::kOff) ^
|
|
|
|
(prev->swingv == stdAc::swingv_t::kOff)) // It changed, so toggle.
|
|
|
|
result.swingv = stdAc::swingv_t::kAuto;
|
|
|
|
else
|
|
|
|
result.swingv = stdAc::swingv_t::kOff; // No change, so no toggle.
|
2019-07-21 15:01:43 +01:00
|
|
|
break;
|
2020-07-29 12:57:44 +01:00
|
|
|
case decode_type_t::AIRWELL:
|
2020-04-09 09:25:50 +01:00
|
|
|
case decode_type_t::DAIKIN64:
|
2021-01-04 17:43:58 +00:00
|
|
|
case decode_type_t::PANASONIC_AC32:
|
2019-07-21 15:01:43 +01:00
|
|
|
case decode_type_t::WHIRLPOOL_AC:
|
|
|
|
result.power = desired.power ^ prev->power;
|
|
|
|
break;
|
|
|
|
case decode_type_t::PANASONIC_AC:
|
|
|
|
// CKP models use a power mode toggle.
|
|
|
|
if (desired.model == panasonic_ac_remote_model_t::kPanasonicCkp)
|
|
|
|
result.power = desired.power ^ prev->power;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
{};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send A/C message for a given device using common A/C settings.
|
|
|
|
/// @param[in] vendor The vendor/protocol type.
|
|
|
|
/// @param[in] model The A/C model if applicable.
|
|
|
|
/// @param[in] power The power setting.
|
|
|
|
/// @param[in] mode The operation mode setting.
|
2021-02-13 13:51:52 +00:00
|
|
|
/// @note Changing mode from "Off" to something else does NOT turn on a device.
|
|
|
|
/// You need to use `power` for that.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @param[in] degrees The temperature setting in degrees.
|
|
|
|
/// @param[in] celsius Temperature units. True is Celsius, False is Fahrenheit.
|
|
|
|
/// @param[in] fan The speed setting for the fan.
|
|
|
|
/// @note The following are all "if supported" by the underlying A/C classes.
|
|
|
|
/// @param[in] swingv The vertical swing setting.
|
|
|
|
/// @param[in] swingh The horizontal swing setting.
|
|
|
|
/// @param[in] quiet Run the device in quiet/silent mode.
|
|
|
|
/// @param[in] turbo Run the device in turbo/powerful mode.
|
|
|
|
/// @param[in] econo Run the device in economical mode.
|
|
|
|
/// @param[in] light Turn on the LED/Display mode.
|
|
|
|
/// @param[in] filter Turn on the (ion/pollen/etc) filter mode.
|
|
|
|
/// @param[in] clean Turn on the self-cleaning mode. e.g. Mould, dry filters etc
|
|
|
|
/// @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. Some devices it is the nr. of mins to run for.
|
|
|
|
/// Others it may be the time to enter/exit sleep mode.
|
|
|
|
/// i.e. Time in Nr. of mins since midnight.
|
|
|
|
/// @param[in] clock The time in Nr. of mins since midnight. < 0 is ignore.
|
|
|
|
/// @return True, if accepted/converted/attempted etc. False, if unsupported.
|
2019-05-27 13:11:01 +01:00
|
|
|
bool IRac::sendAc(const decode_type_t vendor, const int16_t model,
|
|
|
|
const bool power, const stdAc::opmode_t mode,
|
|
|
|
const float degrees, const bool celsius,
|
|
|
|
const stdAc::fanspeed_t fan,
|
|
|
|
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
|
|
|
|
const bool quiet, const bool turbo, const bool econo,
|
|
|
|
const bool light, const bool filter, const bool clean,
|
|
|
|
const bool beep, const int16_t sleep, const int16_t clock) {
|
2019-11-02 11:21:18 +00:00
|
|
|
stdAc::state_t to_send;
|
|
|
|
initState(&to_send, vendor, model, power, mode, degrees, celsius, fan, swingv,
|
|
|
|
swingh, quiet, turbo, econo, light, filter, clean, beep, sleep,
|
|
|
|
clock);
|
|
|
|
return this->sendAc(to_send, &to_send);
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send A/C message for a given device using state_t structures.
|
|
|
|
/// @param[in] desired The state_t structure describing the desired new ac state
|
|
|
|
/// @param[in] prev A Ptr to the state_t structure containing the previous state
|
2021-02-13 13:51:52 +00:00
|
|
|
/// @note Changing mode from "Off" to something else does NOT turn on a device.
|
|
|
|
/// You need to use `power` for that.
|
2020-06-24 20:48:33 +01:00
|
|
|
/// @return True, if accepted/converted/attempted etc. False, if unsupported.
|
2019-11-02 11:21:18 +00:00
|
|
|
bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
|
2020-01-06 16:27:36 +00:00
|
|
|
// Convert the temp from Fahrenheit to Celsius if we are not in Celsius mode.
|
2020-06-24 20:48:33 +01:00
|
|
|
float degC __attribute__((unused)) =
|
|
|
|
desired.celsius ? desired.degrees : fahrenheitToCelsius(desired.degrees);
|
2020-01-06 16:27:36 +00:00
|
|
|
// special `state_t` that is required to be sent based on that.
|
|
|
|
stdAc::state_t send = this->handleToggles(this->cleanState(desired), prev);
|
2020-11-25 18:41:51 +00:00
|
|
|
// Some protocols expect a previous state for power.
|
|
|
|
// Construct a pointer-safe previous power state incase prev is NULL/NULLPTR.
|
|
|
|
#if (SEND_HITACHI_AC1 || SEND_SAMSUNG_AC || SEND_SHARP_AC)
|
|
|
|
const bool prev_power = (prev != NULL) ? prev->power : !send.power;
|
|
|
|
#endif
|
2019-05-27 13:11:01 +01:00
|
|
|
// Per vendor settings & setup.
|
2019-11-02 11:21:18 +00:00
|
|
|
switch (send.protocol) {
|
2020-07-29 12:57:44 +01:00
|
|
|
#if SEND_AIRWELL
|
|
|
|
case AIRWELL:
|
|
|
|
{
|
|
|
|
IRAirwellAc ac(_pin, _inverted, _modulation);
|
|
|
|
airwell(&ac, send.power, send.mode, degC, send.fanspeed);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_AIRWELL
|
2019-08-30 19:41:01 +01:00
|
|
|
#if SEND_AMCOR
|
|
|
|
case AMCOR:
|
|
|
|
{
|
|
|
|
IRAmcorAc ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
amcor(&ac, send.power, send.mode, degC, send.fanspeed);
|
2019-08-30 19:41:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_AMCOR
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_ARGO
|
|
|
|
case ARGO:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRArgoAC ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
argo(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.turbo, send.sleep);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
2019-07-29 08:28:40 +01:00
|
|
|
#endif // SEND_ARGO
|
2020-06-24 20:48:33 +01:00
|
|
|
#if SEND_CARRIER_AC64
|
|
|
|
case CARRIER_AC64:
|
|
|
|
{
|
|
|
|
IRCarrierAc64 ac(_pin, _inverted, _modulation);
|
|
|
|
carrier64(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.sleep);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_CARRIER_AC64
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_COOLIX
|
|
|
|
case COOLIX:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRCoolixAC ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
coolix(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.swingh, send.turbo, send.light, send.clean, send.sleep);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
2019-07-29 08:28:40 +01:00
|
|
|
#endif // SEND_COOLIX
|
2020-06-24 20:48:33 +01:00
|
|
|
#if SEND_CORONA_AC
|
|
|
|
case CORONA_AC:
|
|
|
|
{
|
|
|
|
IRCoronaAc ac(_pin, _inverted, _modulation);
|
|
|
|
corona(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.econo);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_CORONA_AC
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_DAIKIN
|
|
|
|
case DAIKIN:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRDaikinESP ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
daikin(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.swingh, send.quiet, send.turbo, send.econo, send.clean);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN
|
2019-07-29 08:28:40 +01:00
|
|
|
#if SEND_DAIKIN128
|
|
|
|
case DAIKIN128:
|
|
|
|
{
|
|
|
|
IRDaikin128 ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
daikin128(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
2019-11-02 11:21:18 +00:00
|
|
|
send.quiet, send.turbo, send.light, send.econo, send.sleep,
|
|
|
|
send.clock);
|
2019-07-29 08:28:40 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN2
|
2019-11-02 11:21:18 +00:00
|
|
|
#if SEND_DAIKIN152
|
|
|
|
case DAIKIN152:
|
|
|
|
{
|
|
|
|
IRDaikin152 ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
daikin152(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
2019-11-02 11:21:18 +00:00
|
|
|
send.quiet, send.turbo, send.econo);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN152
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_DAIKIN160
|
|
|
|
case DAIKIN160:
|
|
|
|
{
|
|
|
|
IRDaikin160 ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
daikin160(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv);
|
2019-07-21 15:01:43 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN160
|
|
|
|
#if SEND_DAIKIN176
|
|
|
|
case DAIKIN176:
|
|
|
|
{
|
2019-07-29 08:28:40 +01:00
|
|
|
IRDaikin176 ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
daikin176(&ac, send.power, send.mode, degC, send.fanspeed, send.swingh);
|
2019-07-21 15:01:43 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN176
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_DAIKIN2
|
|
|
|
case DAIKIN2:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRDaikin2 ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
daikin2(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.swingh, send.quiet, send.turbo, send.light, send.econo,
|
|
|
|
send.filter, send.clean, send.beep, send.sleep, send.clock);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
2019-07-29 08:28:40 +01:00
|
|
|
#endif // SEND_DAIKIN2
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_DAIKIN216
|
|
|
|
case DAIKIN216:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRDaikin216 ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
daikin216(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
2019-11-02 11:21:18 +00:00
|
|
|
send.swingh, send.quiet, send.turbo);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN216
|
2020-04-09 09:25:50 +01:00
|
|
|
#if SEND_DAIKIN64
|
|
|
|
case DAIKIN64:
|
|
|
|
{
|
|
|
|
IRDaikin64 ac(_pin, _inverted, _modulation);
|
|
|
|
daikin64(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.quiet, send.turbo, send.sleep, send.clock);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_DAIKIN64
|
2020-05-20 11:42:34 +01:00
|
|
|
#if SEND_DELONGHI_AC
|
|
|
|
case DELONGHI_AC:
|
|
|
|
{
|
|
|
|
IRDelonghiAc ac(_pin, _inverted, _modulation);
|
|
|
|
delonghiac(&ac, send.power, send.mode, send.celsius, degC, send.fanspeed,
|
|
|
|
send.turbo, send.sleep);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_DELONGHI_AC
|
2021-03-25 07:40:27 +00:00
|
|
|
#if SEND_ECOCLIM
|
|
|
|
case ECOCLIM:
|
|
|
|
{
|
|
|
|
IREcoclimAc ac(_pin, _inverted, _modulation);
|
|
|
|
ecoclim(&ac, send.power, send.mode, degC, send.fanspeed, send.clock);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_ECOCLIM
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_ELECTRA_AC
|
|
|
|
case ELECTRA_AC:
|
|
|
|
{
|
|
|
|
IRElectraAc ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
electra(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
2020-02-29 12:51:16 +00:00
|
|
|
send.swingh, send.turbo, send.light, send.clean);
|
2019-07-21 15:01:43 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_ELECTRA_AC
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_FUJITSU_AC
|
|
|
|
case FUJITSU_AC:
|
|
|
|
{
|
2019-11-02 11:21:18 +00:00
|
|
|
IRFujitsuAC ac(_pin, (fujitsu_ac_remote_model_t)send.model, _inverted,
|
2019-07-21 15:01:43 +01:00
|
|
|
_modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
fujitsu(&ac, (fujitsu_ac_remote_model_t)send.model, send.power, send.mode,
|
|
|
|
degC, send.fanspeed, send.swingv, send.swingh, send.quiet,
|
|
|
|
send.turbo, send.econo, send.filter, send.clean);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_FUJITSU_AC
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_GOODWEATHER
|
|
|
|
case GOODWEATHER:
|
|
|
|
{
|
|
|
|
IRGoodweatherAc ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
goodweather(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
2019-11-02 11:21:18 +00:00
|
|
|
send.turbo, send.light, send.sleep);
|
2019-07-21 15:01:43 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_GOODWEATHER
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_GREE
|
|
|
|
case GREE:
|
|
|
|
{
|
2019-11-02 11:21:18 +00:00
|
|
|
IRGreeAC ac(_pin, (gree_ac_remote_model_t)send.model, _inverted,
|
|
|
|
_modulation);
|
2020-05-20 11:42:34 +01:00
|
|
|
gree(&ac, (gree_ac_remote_model_t)send.model, send.power, send.mode,
|
|
|
|
send.celsius, send.degrees, send.fanspeed, send.swingv, send.turbo,
|
|
|
|
send.light, send.clean, send.sleep);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_GREE
|
|
|
|
#if SEND_HAIER_AC
|
|
|
|
case HAIER_AC:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRHaierAC ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
haier(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.filter, send.sleep, send.clock);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_HAIER_AC
|
|
|
|
#if SEND_HAIER_AC_YRW02
|
|
|
|
case HAIER_AC_YRW02:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRHaierACYRW02 ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
haierYrwo2(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
2019-11-02 11:21:18 +00:00
|
|
|
send.turbo, send.filter, send.sleep);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_HAIER_AC_YRW02
|
|
|
|
#if SEND_HITACHI_AC
|
|
|
|
case HITACHI_AC:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRHitachiAc ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
hitachi(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
2019-11-02 11:21:18 +00:00
|
|
|
send.swingh);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_HITACHI_AC
|
2020-04-09 09:25:50 +01:00
|
|
|
#if SEND_HITACHI_AC1
|
|
|
|
case HITACHI_AC1:
|
|
|
|
{
|
|
|
|
IRHitachiAc1 ac(_pin, _inverted, _modulation);
|
|
|
|
bool power_toggle = false;
|
|
|
|
bool swing_toggle = false;
|
|
|
|
if (prev != NULL) {
|
|
|
|
power_toggle = (send.power != prev->power);
|
|
|
|
swing_toggle = (send.swingv != prev->swingv) ||
|
|
|
|
(send.swingh != prev->swingh);
|
|
|
|
}
|
|
|
|
hitachi1(&ac, (hitachi_ac1_remote_model_t)send.model, send.power,
|
|
|
|
power_toggle, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.swingh, swing_toggle, send.sleep);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_HITACHI_AC1
|
2020-06-24 20:48:33 +01:00
|
|
|
#if SEND_HITACHI_AC344
|
|
|
|
case HITACHI_AC344:
|
|
|
|
{
|
|
|
|
IRHitachiAc344 ac(_pin, _inverted, _modulation);
|
|
|
|
hitachi344(&ac, send.power, send.mode, degC, send.fanspeed,
|
|
|
|
send.swingv, send.swingh);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_HITACHI_AC344
|
2019-11-02 11:21:18 +00:00
|
|
|
#if SEND_HITACHI_AC424
|
|
|
|
case HITACHI_AC424:
|
|
|
|
{
|
|
|
|
IRHitachiAc424 ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
hitachi424(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv);
|
2019-11-02 11:21:18 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_HITACHI_AC424
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_KELVINATOR
|
|
|
|
case KELVINATOR:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRKelvinatorAC ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
kelvinator(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
2019-11-02 11:21:18 +00:00
|
|
|
send.swingh, send.quiet, send.turbo, send.light, send.filter,
|
|
|
|
send.clean);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_KELVINATOR
|
2020-01-06 16:27:36 +00:00
|
|
|
#if SEND_LG
|
|
|
|
case LG:
|
|
|
|
case LG2:
|
|
|
|
{
|
|
|
|
IRLgAc ac(_pin, _inverted, _modulation);
|
|
|
|
lg(&ac, (lg_ac_remote_model_t)send.model, send.power, send.mode,
|
|
|
|
send.degrees, send.fanspeed);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_LG
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_MIDEA
|
|
|
|
case MIDEA:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRMideaAC ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
midea(&ac, send.power, send.mode, send.celsius, send.degrees,
|
2020-11-14 18:31:50 +00:00
|
|
|
send.fanspeed, send.swingv, send.turbo, send.econo, send.light,
|
|
|
|
send.sleep);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_MIDEA
|
|
|
|
#if SEND_MITSUBISHI_AC
|
|
|
|
case MITSUBISHI_AC:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRMitsubishiAC ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
mitsubishi(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
2019-11-02 11:21:18 +00:00
|
|
|
send.swingh, send.quiet, send.clock);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_MITSUBISHI_AC
|
2019-11-02 11:21:18 +00:00
|
|
|
#if SEND_MITSUBISHI112
|
|
|
|
case MITSUBISHI112:
|
|
|
|
{
|
|
|
|
IRMitsubishi112 ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
mitsubishi112(&ac, send.power, send.mode, degC, send.fanspeed,
|
|
|
|
send.swingv, send.swingh, send.quiet);
|
2019-11-02 11:21:18 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_MITSUBISHI112
|
|
|
|
#if SEND_MITSUBISHI136
|
|
|
|
case MITSUBISHI136:
|
|
|
|
{
|
|
|
|
IRMitsubishi136 ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
mitsubishi136(&ac, send.power, send.mode, degC, send.fanspeed,
|
|
|
|
send.swingv, send.quiet);
|
2019-11-02 11:21:18 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_MITSUBISHI136
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_MITSUBISHIHEAVY
|
|
|
|
case MITSUBISHI_HEAVY_88:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRMitsubishiHeavy88Ac ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
mitsubishiHeavy88(&ac, send.power, send.mode, degC, send.fanspeed,
|
|
|
|
send.swingv, send.swingh, send.turbo, send.econo,
|
|
|
|
send.clean);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MITSUBISHI_HEAVY_152:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRMitsubishiHeavy152Ac ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
mitsubishiHeavy152(&ac, send.power, send.mode, degC, send.fanspeed,
|
|
|
|
send.swingv, send.swingh, send.quiet, send.turbo,
|
|
|
|
send.econo, send.filter, send.clean, send.sleep);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_MITSUBISHIHEAVY
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_NEOCLIMA
|
|
|
|
case NEOCLIMA:
|
|
|
|
{
|
|
|
|
IRNeoclimaAc ac(_pin, _inverted, _modulation);
|
2020-10-04 10:04:34 +01:00
|
|
|
neoclima(&ac, send.power, send.mode, send.celsius, send.degrees,
|
|
|
|
send.fanspeed, send.swingv, send.swingh, send.turbo,
|
|
|
|
send.econo, send.light, send.filter, send.sleep);
|
2019-07-21 15:01:43 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_NEOCLIMA
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_PANASONIC_AC
|
|
|
|
case PANASONIC_AC:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRPanasonicAc ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
panasonic(&ac, (panasonic_ac_remote_model_t)send.model, send.power,
|
|
|
|
send.mode, degC, send.fanspeed, send.swingv, send.swingh,
|
|
|
|
send.quiet, send.turbo, send.clock);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_PANASONIC_AC
|
2021-01-04 17:43:58 +00:00
|
|
|
#if SEND_PANASONIC_AC32
|
|
|
|
case PANASONIC_AC32:
|
|
|
|
{
|
|
|
|
IRPanasonicAc32 ac(_pin, _inverted, _modulation);
|
|
|
|
panasonic32(&ac, send.power, send.mode, degC, send.fanspeed,
|
|
|
|
send.swingv, send.swingh);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_PANASONIC_AC32
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_SAMSUNG_AC
|
|
|
|
case SAMSUNG_AC:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRSamsungAc ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
samsung(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
2020-02-29 12:51:16 +00:00
|
|
|
send.quiet, send.turbo, send.light, send.filter, send.clean,
|
2020-11-24 18:40:03 +00:00
|
|
|
send.beep, prev_power);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_SAMSUNG_AC
|
2020-07-29 12:57:44 +01:00
|
|
|
#if SEND_SANYO_AC
|
|
|
|
case SANYO_AC:
|
|
|
|
{
|
|
|
|
IRSanyoAc ac(_pin, _inverted, _modulation);
|
|
|
|
sanyo(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.beep, send.sleep);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_SANYO_AC
|
2019-07-21 15:01:43 +01:00
|
|
|
#if SEND_SHARP_AC
|
|
|
|
case SHARP_AC:
|
|
|
|
{
|
|
|
|
IRSharpAc ac(_pin, _inverted, _modulation);
|
2020-11-14 18:31:50 +00:00
|
|
|
sharp(&ac, (sharp_ac_remote_model_t)send.model, send.power, prev_power,
|
|
|
|
send.mode, degC, send.fanspeed, send.swingv, send.turbo, send.light,
|
|
|
|
send.filter, send.clean);
|
2019-07-21 15:01:43 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_SHARP_AC
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_TCL112AC
|
|
|
|
case TCL112AC:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRTcl112Ac ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
tcl112(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.swingh, send.turbo, send.light, send.econo, send.filter);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_TCL112AC
|
2020-10-04 10:04:34 +01:00
|
|
|
#if SEND_TECHNIBEL_AC
|
|
|
|
case TECHNIBEL_AC:
|
|
|
|
{
|
|
|
|
IRTechnibelAc ac(_pin, _inverted, _modulation);
|
|
|
|
technibel(&ac, send.power, send.mode, send.celsius, send.degrees,
|
|
|
|
send.fanspeed, send.swingv, send.sleep);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_TECHNIBEL_AC
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_TECO
|
|
|
|
case TECO:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRTecoAc ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
teco(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.light, send.sleep);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_TECO
|
|
|
|
#if SEND_TOSHIBA_AC
|
|
|
|
case TOSHIBA_AC:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRToshibaAC ac(_pin, _inverted, _modulation);
|
2020-07-29 12:57:44 +01:00
|
|
|
toshiba(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.turbo, send.econo);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_TOSHIBA_AC
|
|
|
|
#if SEND_TROTEC
|
|
|
|
case TROTEC:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRTrotecESP ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
trotec(&ac, send.power, send.mode, degC, send.fanspeed, send.sleep);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_TROTEC
|
|
|
|
#if SEND_VESTEL_AC
|
|
|
|
case VESTEL_AC:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRVestelAc ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
vestel(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.turbo, send.filter, send.sleep, send.clock);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_VESTEL_AC
|
2020-09-01 10:36:06 +01:00
|
|
|
#if SEND_VOLTAS
|
|
|
|
case VOLTAS:
|
|
|
|
{
|
|
|
|
IRVoltas ac(_pin, _inverted, _modulation);
|
|
|
|
voltas(&ac, (voltas_ac_remote_model_t)send.model, send.power, send.mode,
|
|
|
|
degC, send.fanspeed, send.swingv, send.swingh, send.turbo,
|
|
|
|
send.econo, send.light, send.sleep);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_VOLTAS
|
2019-05-27 13:11:01 +01:00
|
|
|
#if SEND_WHIRLPOOL_AC
|
|
|
|
case WHIRLPOOL_AC:
|
|
|
|
{
|
2019-07-21 15:01:43 +01:00
|
|
|
IRWhirlpoolAc ac(_pin, _inverted, _modulation);
|
2020-01-06 16:27:36 +00:00
|
|
|
whirlpool(&ac, (whirlpool_ac_remote_model_t)send.model, send.power,
|
|
|
|
send.mode, degC, send.fanspeed, send.swingv, send.turbo,
|
|
|
|
send.light, send.sleep, send.clock);
|
2019-05-27 13:11:01 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_WHIRLPOOL_AC
|
2020-10-04 10:04:34 +01:00
|
|
|
#if SEND_TRANSCOLD
|
|
|
|
case TRANSCOLD:
|
|
|
|
{
|
|
|
|
IRTranscoldAc ac(_pin, _inverted, _modulation);
|
|
|
|
transcold(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
|
|
|
|
send.swingh);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // SEND_TRANSCOLD_AC
|
2019-05-27 13:11:01 +01:00
|
|
|
default:
|
|
|
|
return false; // Fail, didn't match anything.
|
|
|
|
}
|
|
|
|
return true; // Success.
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Update the previous state to the current one.
|
2020-02-29 12:51:16 +00:00
|
|
|
void IRac::markAsSent(void) {
|
|
|
|
_prev = next;
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Send an A/C message based soley on our internal state.
|
|
|
|
/// @return True, if accepted/converted/attempted. False, if unsupported.
|
2019-11-02 11:21:18 +00:00
|
|
|
bool IRac::sendAc(void) {
|
|
|
|
bool success = this->sendAc(next, &_prev);
|
2020-02-29 12:51:16 +00:00
|
|
|
if (success) this->markAsSent();
|
2019-11-02 11:21:18 +00:00
|
|
|
return success;
|
2019-07-21 15:01:43 +01:00
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Compare two AirCon states.
|
|
|
|
/// @note The comparison excludes the clock.
|
|
|
|
/// @param a A state_t to be compared.
|
|
|
|
/// @param b A state_t to be compared.
|
|
|
|
/// @return True if they differ, False if they don't.
|
2019-07-21 15:01:43 +01:00
|
|
|
bool IRac::cmpStates(const stdAc::state_t a, const stdAc::state_t b) {
|
|
|
|
return a.protocol != b.protocol || a.model != b.model || a.power != b.power ||
|
|
|
|
a.mode != b.mode || a.degrees != b.degrees || a.celsius != b.celsius ||
|
|
|
|
a.fanspeed != b.fanspeed || a.swingv != b.swingv ||
|
|
|
|
a.swingh != b.swingh || a.quiet != b.quiet || a.turbo != b.turbo ||
|
|
|
|
a.econo != b.econo || a.light != b.light || a.filter != b.filter ||
|
|
|
|
a.clean != b.clean || a.beep != b.beep || a.sleep != b.sleep;
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Check if the internal state has changed from what was previously sent.
|
|
|
|
/// @note The comparison excludes the clock.
|
|
|
|
/// @return True if it has changed, False if not.
|
2019-11-02 11:21:18 +00:00
|
|
|
bool IRac::hasStateChanged(void) { return cmpStates(next, _prev); }
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert the supplied str into the appropriate enum.
|
|
|
|
/// @param[in] str A Ptr to a C-style string to be converted.
|
|
|
|
/// @param[in] def The enum to return if no conversion was possible.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @return The equivalent enum.
|
2019-05-27 13:11:01 +01:00
|
|
|
stdAc::opmode_t IRac::strToOpmode(const char *str,
|
2020-06-24 20:48:33 +01:00
|
|
|
const stdAc::opmode_t def) {
|
2019-11-25 20:43:39 +00:00
|
|
|
if (!strcasecmp(str, kAutoStr) ||
|
|
|
|
!strcasecmp(str, kAutomaticStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::opmode_t::kAuto;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kOffStr) ||
|
|
|
|
!strcasecmp(str, kStopStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::opmode_t::kOff;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kCoolStr) ||
|
2019-11-02 11:21:18 +00:00
|
|
|
!strcasecmp(str, "COOLING"))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::opmode_t::kCool;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kHeatStr) ||
|
2019-11-02 11:21:18 +00:00
|
|
|
!strcasecmp(str, "HEATING"))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::opmode_t::kHeat;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kDryStr) ||
|
2019-11-02 11:21:18 +00:00
|
|
|
!strcasecmp(str, "DRYING") ||
|
2019-07-21 15:01:43 +01:00
|
|
|
!strcasecmp(str, "DEHUMIDIFY"))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::opmode_t::kDry;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kFanStr) ||
|
2019-11-02 11:21:18 +00:00
|
|
|
!strcasecmp(str, "FANONLY") ||
|
2019-11-25 20:43:39 +00:00
|
|
|
!strcasecmp(str, kFanOnlyStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::opmode_t::kFan;
|
|
|
|
else
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert the supplied str into the appropriate enum.
|
|
|
|
/// @param[in] str A Ptr to a C-style string to be converted.
|
|
|
|
/// @param[in] def The enum to return if no conversion was possible.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @return The equivalent enum.
|
2019-05-27 13:11:01 +01:00
|
|
|
stdAc::fanspeed_t IRac::strToFanspeed(const char *str,
|
|
|
|
const stdAc::fanspeed_t def) {
|
2019-11-25 20:43:39 +00:00
|
|
|
if (!strcasecmp(str, kAutoStr) ||
|
|
|
|
!strcasecmp(str, kAutomaticStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::fanspeed_t::kAuto;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kMinStr) ||
|
|
|
|
!strcasecmp(str, kMinimumStr) ||
|
|
|
|
!strcasecmp(str, kLowestStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::fanspeed_t::kMin;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kLowStr) ||
|
|
|
|
!strcasecmp(str, kLoStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::fanspeed_t::kLow;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kMedStr) ||
|
|
|
|
!strcasecmp(str, kMediumStr) ||
|
|
|
|
!strcasecmp(str, kMidStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::fanspeed_t::kMedium;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kHighStr) ||
|
|
|
|
!strcasecmp(str, kHiStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::fanspeed_t::kHigh;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kMaxStr) ||
|
|
|
|
!strcasecmp(str, kMaximumStr) ||
|
|
|
|
!strcasecmp(str, kHighestStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::fanspeed_t::kMax;
|
|
|
|
else
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert the supplied str into the appropriate enum.
|
|
|
|
/// @param[in] str A Ptr to a C-style string to be converted.
|
|
|
|
/// @param[in] def The enum to return if no conversion was possible.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @return The equivalent enum.
|
2019-05-27 13:11:01 +01:00
|
|
|
stdAc::swingv_t IRac::strToSwingV(const char *str,
|
|
|
|
const stdAc::swingv_t def) {
|
2019-11-25 20:43:39 +00:00
|
|
|
if (!strcasecmp(str, kAutoStr) ||
|
|
|
|
!strcasecmp(str, kAutomaticStr) ||
|
|
|
|
!strcasecmp(str, kOnStr) ||
|
|
|
|
!strcasecmp(str, kSwingStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingv_t::kAuto;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kOffStr) ||
|
|
|
|
!strcasecmp(str, kStopStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingv_t::kOff;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kMinStr) ||
|
|
|
|
!strcasecmp(str, kMinimumStr) ||
|
|
|
|
!strcasecmp(str, kLowestStr) ||
|
|
|
|
!strcasecmp(str, kBottomStr) ||
|
|
|
|
!strcasecmp(str, kDownStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingv_t::kLowest;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kLowStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingv_t::kLow;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kMidStr) ||
|
|
|
|
!strcasecmp(str, kMiddleStr) ||
|
|
|
|
!strcasecmp(str, kMedStr) ||
|
|
|
|
!strcasecmp(str, kMediumStr) ||
|
|
|
|
!strcasecmp(str, kCentreStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingv_t::kMiddle;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kHighStr) ||
|
|
|
|
!strcasecmp(str, kHiStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingv_t::kHigh;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kHighestStr) ||
|
|
|
|
!strcasecmp(str, kMaxStr) ||
|
|
|
|
!strcasecmp(str, kMaximumStr) ||
|
|
|
|
!strcasecmp(str, kTopStr) ||
|
|
|
|
!strcasecmp(str, kUpStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingv_t::kHighest;
|
|
|
|
else
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert the supplied str into the appropriate enum.
|
|
|
|
/// @param[in] str A Ptr to a C-style string to be converted.
|
|
|
|
/// @param[in] def The enum to return if no conversion was possible.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @return The equivalent enum.
|
2019-05-27 13:11:01 +01:00
|
|
|
stdAc::swingh_t IRac::strToSwingH(const char *str,
|
|
|
|
const stdAc::swingh_t def) {
|
2019-11-25 20:43:39 +00:00
|
|
|
if (!strcasecmp(str, kAutoStr) ||
|
|
|
|
!strcasecmp(str, kAutomaticStr) ||
|
|
|
|
!strcasecmp(str, kOnStr) || !strcasecmp(str, kSwingStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingh_t::kAuto;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kOffStr) ||
|
|
|
|
!strcasecmp(str, kStopStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingh_t::kOff;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kLeftMaxStr) ||
|
2019-11-02 11:21:18 +00:00
|
|
|
!strcasecmp(str, D_STR_LEFT " " D_STR_MAX) ||
|
|
|
|
!strcasecmp(str, D_STR_MAX D_STR_LEFT) ||
|
2019-11-25 20:43:39 +00:00
|
|
|
!strcasecmp(str, kMaxLeftStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingh_t::kLeftMax;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kLeftStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingh_t::kLeft;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kMidStr) ||
|
|
|
|
!strcasecmp(str, kMiddleStr) ||
|
|
|
|
!strcasecmp(str, kMedStr) ||
|
|
|
|
!strcasecmp(str, kMediumStr) ||
|
|
|
|
!strcasecmp(str, kCentreStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingh_t::kMiddle;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kRightStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingh_t::kRight;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kRightMaxStr) ||
|
2019-11-02 11:21:18 +00:00
|
|
|
!strcasecmp(str, D_STR_MAX " " D_STR_RIGHT) ||
|
|
|
|
!strcasecmp(str, D_STR_MAX D_STR_RIGHT) ||
|
2019-11-25 20:43:39 +00:00
|
|
|
!strcasecmp(str, kMaxRightStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return stdAc::swingh_t::kRightMax;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kWideStr))
|
2019-08-30 19:41:01 +01:00
|
|
|
return stdAc::swingh_t::kWide;
|
2019-05-27 13:11:01 +01:00
|
|
|
else
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert the supplied str into the appropriate enum.
|
|
|
|
/// @note Assumes str is the model code or an integer >= 1.
|
|
|
|
/// @param[in] str A Ptr to a C-style string to be converted.
|
|
|
|
/// @param[in] def The enum to return if no conversion was possible.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @return The equivalent enum.
|
2019-05-27 13:11:01 +01:00
|
|
|
int16_t IRac::strToModel(const char *str, const int16_t def) {
|
2019-08-30 19:41:01 +01:00
|
|
|
// Gree
|
|
|
|
if (!strcasecmp(str, "YAW1F")) {
|
|
|
|
return gree_ac_remote_model_t::YAW1F;
|
|
|
|
} else if (!strcasecmp(str, "YBOFB")) {
|
|
|
|
return gree_ac_remote_model_t::YBOFB;
|
2020-04-09 09:25:50 +01:00
|
|
|
// HitachiAc1 models
|
|
|
|
} else if (!strcasecmp(str, "R-LT0541-HTA-A")) {
|
|
|
|
return hitachi_ac1_remote_model_t::R_LT0541_HTA_A;
|
|
|
|
} else if (!strcasecmp(str, "R-LT0541-HTA-B")) {
|
|
|
|
return hitachi_ac1_remote_model_t::R_LT0541_HTA_B;
|
2019-05-27 13:11:01 +01:00
|
|
|
// Fujitsu A/C models
|
2019-08-30 19:41:01 +01:00
|
|
|
} else if (!strcasecmp(str, "ARRAH2E")) {
|
2019-05-27 13:11:01 +01:00
|
|
|
return fujitsu_ac_remote_model_t::ARRAH2E;
|
2019-07-21 15:01:43 +01:00
|
|
|
} else if (!strcasecmp(str, "ARDB1")) {
|
2019-05-27 13:11:01 +01:00
|
|
|
return fujitsu_ac_remote_model_t::ARDB1;
|
2019-08-30 19:41:01 +01:00
|
|
|
} else if (!strcasecmp(str, "ARREB1E")) {
|
|
|
|
return fujitsu_ac_remote_model_t::ARREB1E;
|
|
|
|
} else if (!strcasecmp(str, "ARJW2")) {
|
|
|
|
return fujitsu_ac_remote_model_t::ARJW2;
|
2019-11-02 11:21:18 +00:00
|
|
|
} else if (!strcasecmp(str, "ARRY4")) {
|
|
|
|
return fujitsu_ac_remote_model_t::ARRY4;
|
2020-09-01 10:36:06 +01:00
|
|
|
// LG A/C models
|
|
|
|
} else if (!strcasecmp(str, "GE6711AR2853M")) {
|
|
|
|
return lg_ac_remote_model_t::GE6711AR2853M;
|
|
|
|
} else if (!strcasecmp(str, "AKB75215403")) {
|
|
|
|
return lg_ac_remote_model_t::AKB75215403;
|
2019-05-27 13:11:01 +01:00
|
|
|
// Panasonic A/C families
|
2019-07-21 15:01:43 +01:00
|
|
|
} else if (!strcasecmp(str, "LKE") || !strcasecmp(str, "PANASONICLKE")) {
|
2019-05-27 13:11:01 +01:00
|
|
|
return panasonic_ac_remote_model_t::kPanasonicLke;
|
2019-07-21 15:01:43 +01:00
|
|
|
} else if (!strcasecmp(str, "NKE") || !strcasecmp(str, "PANASONICNKE")) {
|
2019-05-27 13:11:01 +01:00
|
|
|
return panasonic_ac_remote_model_t::kPanasonicNke;
|
2020-02-03 18:41:35 +00:00
|
|
|
} else if (!strcasecmp(str, "DKE") || !strcasecmp(str, "PANASONICDKE") ||
|
|
|
|
!strcasecmp(str, "PKR") || !strcasecmp(str, "PANASONICPKR")) {
|
2019-05-27 13:11:01 +01:00
|
|
|
return panasonic_ac_remote_model_t::kPanasonicDke;
|
2019-07-21 15:01:43 +01:00
|
|
|
} else if (!strcasecmp(str, "JKE") || !strcasecmp(str, "PANASONICJKE")) {
|
2019-05-27 13:11:01 +01:00
|
|
|
return panasonic_ac_remote_model_t::kPanasonicJke;
|
2019-07-21 15:01:43 +01:00
|
|
|
} else if (!strcasecmp(str, "CKP") || !strcasecmp(str, "PANASONICCKP")) {
|
2019-05-27 13:11:01 +01:00
|
|
|
return panasonic_ac_remote_model_t::kPanasonicCkp;
|
2019-07-21 15:01:43 +01:00
|
|
|
} else if (!strcasecmp(str, "RKR") || !strcasecmp(str, "PANASONICRKR")) {
|
2019-05-27 13:11:01 +01:00
|
|
|
return panasonic_ac_remote_model_t::kPanasonicRkr;
|
2020-09-01 10:36:06 +01:00
|
|
|
// Voltas A/C models
|
|
|
|
} else if (!strcasecmp(str, "122LZF")) {
|
|
|
|
return voltas_ac_remote_model_t::kVoltas122LZF;
|
2019-05-27 13:11:01 +01:00
|
|
|
// Whirlpool A/C models
|
2019-07-21 15:01:43 +01:00
|
|
|
} else if (!strcasecmp(str, "DG11J13A") || !strcasecmp(str, "DG11J104") ||
|
|
|
|
!strcasecmp(str, "DG11J1-04")) {
|
2019-05-27 13:11:01 +01:00
|
|
|
return whirlpool_ac_remote_model_t::DG11J13A;
|
2019-07-21 15:01:43 +01:00
|
|
|
} else if (!strcasecmp(str, "DG11J191")) {
|
2019-05-27 13:11:01 +01:00
|
|
|
return whirlpool_ac_remote_model_t::DG11J191;
|
|
|
|
} else {
|
|
|
|
int16_t number = atoi(str);
|
|
|
|
if (number > 0)
|
|
|
|
return number;
|
|
|
|
else
|
|
|
|
return def;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert the supplied str into the appropriate boolean value.
|
|
|
|
/// @param[in] str A Ptr to a C-style string to be converted.
|
|
|
|
/// @param[in] def The boolean value to return if no conversion was possible.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @return The equivalent boolean value.
|
2019-05-27 13:11:01 +01:00
|
|
|
bool IRac::strToBool(const char *str, const bool def) {
|
2019-11-25 20:43:39 +00:00
|
|
|
if (!strcasecmp(str, kOnStr) ||
|
2019-11-02 11:21:18 +00:00
|
|
|
!strcasecmp(str, "1") ||
|
2019-11-25 20:43:39 +00:00
|
|
|
!strcasecmp(str, kYesStr) ||
|
|
|
|
!strcasecmp(str, kTrueStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return true;
|
2019-11-25 20:43:39 +00:00
|
|
|
else if (!strcasecmp(str, kOffStr) ||
|
2019-11-02 11:21:18 +00:00
|
|
|
!strcasecmp(str, "0") ||
|
2019-11-25 20:43:39 +00:00
|
|
|
!strcasecmp(str, kNoStr) ||
|
|
|
|
!strcasecmp(str, kFalseStr))
|
2019-05-27 13:11:01 +01:00
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return def;
|
|
|
|
}
|
2019-07-21 15:01:43 +01:00
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert the supplied boolean into the appropriate String.
|
|
|
|
/// @param[in] value The boolean value to be converted.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @return The equivalent String for the locale.
|
2019-07-21 15:01:43 +01:00
|
|
|
String IRac::boolToString(const bool value) {
|
2019-11-02 11:21:18 +00:00
|
|
|
return value ? kOnStr : kOffStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert the supplied operation mode into the appropriate String.
|
|
|
|
/// @param[in] mode The enum to be converted.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @return The equivalent String for the locale.
|
2019-07-21 15:01:43 +01:00
|
|
|
String IRac::opmodeToString(const stdAc::opmode_t mode) {
|
|
|
|
switch (mode) {
|
|
|
|
case stdAc::opmode_t::kOff:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kOffStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::opmode_t::kAuto:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kAutoStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::opmode_t::kCool:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kCoolStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::opmode_t::kHeat:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kHeatStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::opmode_t::kDry:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kDryStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::opmode_t::kFan:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kFanOnlyStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
default:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kUnknownStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert the supplied fan speed enum into the appropriate String.
|
|
|
|
/// @param[in] speed The enum to be converted.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @return The equivalent String for the locale.
|
2019-07-21 15:01:43 +01:00
|
|
|
String IRac::fanspeedToString(const stdAc::fanspeed_t speed) {
|
|
|
|
switch (speed) {
|
|
|
|
case stdAc::fanspeed_t::kAuto:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kAutoStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::fanspeed_t::kMax:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kMaxStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::fanspeed_t::kHigh:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kHighStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::fanspeed_t::kMedium:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kMediumStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::fanspeed_t::kLow:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kLowStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::fanspeed_t::kMin:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kMinStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
default:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kUnknownStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert the supplied enum into the appropriate String.
|
|
|
|
/// @param[in] swingv The enum to be converted.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @return The equivalent String for the locale.
|
2019-07-21 15:01:43 +01:00
|
|
|
String IRac::swingvToString(const stdAc::swingv_t swingv) {
|
|
|
|
switch (swingv) {
|
|
|
|
case stdAc::swingv_t::kOff:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kOffStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingv_t::kAuto:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kAutoStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingv_t::kHighest:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kHighestStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingv_t::kHigh:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kHighStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingv_t::kMiddle:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kMiddleStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingv_t::kLow:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kLowStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingv_t::kLowest:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kLowestStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
default:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kUnknownStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert the supplied enum into the appropriate String.
|
|
|
|
/// @param[in] swingh The enum to be converted.
|
2020-11-14 18:31:50 +00:00
|
|
|
/// @return The equivalent String for the locale.
|
2019-07-21 15:01:43 +01:00
|
|
|
String IRac::swinghToString(const stdAc::swingh_t swingh) {
|
|
|
|
switch (swingh) {
|
|
|
|
case stdAc::swingh_t::kOff:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kOffStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingh_t::kAuto:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kAutoStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingh_t::kLeftMax:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kLeftMaxStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingh_t::kLeft:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kLeftStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingh_t::kMiddle:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kMiddleStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingh_t::kRight:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kRightStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
case stdAc::swingh_t::kRightMax:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kRightMaxStr;
|
2019-08-30 19:41:01 +01:00
|
|
|
case stdAc::swingh_t::kWide:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kWideStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
default:
|
2019-11-02 11:21:18 +00:00
|
|
|
return kUnknownStr;
|
2019-07-21 15:01:43 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace IRAcUtils {
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Display the human readable state of an A/C message if we can.
|
|
|
|
/// @param[in] result A Ptr to the captured `decode_results` that contains an
|
|
|
|
/// A/C mesg.
|
|
|
|
/// @return A string with the human description of the A/C message.
|
|
|
|
/// An empty string if we can't.
|
2019-07-21 15:01:43 +01:00
|
|
|
String resultAcToString(const decode_results * const result) {
|
|
|
|
switch (result->decode_type) {
|
2020-07-29 12:57:44 +01:00
|
|
|
#if DECODE_AIRWELL
|
|
|
|
case decode_type_t::AIRWELL: {
|
|
|
|
IRAirwellAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->value); // AIRWELL uses value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_AIRWELL
|
2019-08-30 19:41:01 +01:00
|
|
|
#if DECODE_AMCOR
|
|
|
|
case decode_type_t::AMCOR: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRAmcorAc ac(kGpioUnused);
|
2019-08-30 19:41:01 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_AMCOR
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_ARGO
|
|
|
|
case decode_type_t::ARGO: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRArgoAC ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_ARGO
|
2020-06-24 20:48:33 +01:00
|
|
|
#if DECODE_CARRIER_AC64
|
|
|
|
case decode_type_t::CARRIER_AC64: {
|
|
|
|
IRCarrierAc64 ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->value); // CARRIER_AC64 uses value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_CARRIER_AC64
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_DAIKIN
|
|
|
|
case decode_type_t::DAIKIN: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRDaikinESP ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN
|
2019-07-29 08:28:40 +01:00
|
|
|
#if DECODE_DAIKIN128
|
|
|
|
case decode_type_t::DAIKIN128: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRDaikin128 ac(kGpioUnused);
|
2019-07-29 08:28:40 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN128
|
2019-11-02 11:21:18 +00:00
|
|
|
#if DECODE_DAIKIN152
|
|
|
|
case decode_type_t::DAIKIN152: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRDaikin152 ac(kGpioUnused);
|
2019-11-02 11:21:18 +00:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN152
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_DAIKIN160
|
|
|
|
case decode_type_t::DAIKIN160: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRDaikin160 ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN160
|
|
|
|
#if DECODE_DAIKIN176
|
|
|
|
case decode_type_t::DAIKIN176: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRDaikin176 ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN160
|
|
|
|
#if DECODE_DAIKIN2
|
|
|
|
case decode_type_t::DAIKIN2: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRDaikin2 ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN2
|
|
|
|
#if DECODE_DAIKIN216
|
|
|
|
case decode_type_t::DAIKIN216: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRDaikin216 ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN216
|
2020-04-09 09:25:50 +01:00
|
|
|
#if DECODE_DAIKIN64
|
|
|
|
case decode_type_t::DAIKIN64: {
|
|
|
|
IRDaikin64 ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->value); // Daikin64 uses value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
2020-05-20 11:42:34 +01:00
|
|
|
#endif // DECODE_DAIKIN64
|
|
|
|
#if DECODE_DELONGHI_AC
|
|
|
|
case decode_type_t::DELONGHI_AC: {
|
|
|
|
IRDelonghiAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->value); // DelonghiAc uses value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_DELONGHI_AC
|
2021-03-25 07:40:27 +00:00
|
|
|
#if DECODE_ECOCLIM
|
|
|
|
case decode_type_t::ECOCLIM: {
|
|
|
|
if (result->bits == kEcoclimBits) {
|
|
|
|
IREcoclimAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->value); // EcoClim uses value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
#endif // DECODE_ECOCLIM
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_ELECTRA_AC
|
|
|
|
case decode_type_t::ELECTRA_AC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRElectraAc ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_ELECTRA_AC
|
|
|
|
#if DECODE_FUJITSU_AC
|
|
|
|
case decode_type_t::FUJITSU_AC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRFujitsuAC ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state, result->bits / 8);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_FUJITSU_AC
|
|
|
|
#if DECODE_KELVINATOR
|
|
|
|
case decode_type_t::KELVINATOR: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRKelvinatorAC ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_KELVINATOR
|
|
|
|
#if DECODE_MITSUBISHI_AC
|
|
|
|
case decode_type_t::MITSUBISHI_AC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRMitsubishiAC ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_MITSUBISHI_AC
|
2019-11-02 11:21:18 +00:00
|
|
|
#if DECODE_MITSUBISHI112
|
|
|
|
case decode_type_t::MITSUBISHI112: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRMitsubishi112 ac(kGpioUnused);
|
2019-11-02 11:21:18 +00:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_MITSUBISHI112
|
|
|
|
#if DECODE_MITSUBISHI136
|
|
|
|
case decode_type_t::MITSUBISHI136: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRMitsubishi136 ac(kGpioUnused);
|
2019-11-02 11:21:18 +00:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_MITSUBISHI136
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_MITSUBISHIHEAVY
|
|
|
|
case decode_type_t::MITSUBISHI_HEAVY_88: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRMitsubishiHeavy88Ac ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
case decode_type_t::MITSUBISHI_HEAVY_152: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRMitsubishiHeavy152Ac ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_MITSUBISHIHEAVY
|
|
|
|
#if DECODE_NEOCLIMA
|
|
|
|
case decode_type_t::NEOCLIMA: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRNeoclimaAc ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_NEOCLIMA
|
|
|
|
#if DECODE_TOSHIBA_AC
|
|
|
|
case decode_type_t::TOSHIBA_AC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRToshibaAC ac(kGpioUnused);
|
2021-03-25 07:40:27 +00:00
|
|
|
ac.setRaw(result->state, result->bits / 8);
|
2019-07-21 15:01:43 +01:00
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_TOSHIBA_AC
|
|
|
|
#if DECODE_TROTEC
|
|
|
|
case decode_type_t::TROTEC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRTrotecESP ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_TROTEC
|
|
|
|
#if DECODE_GOODWEATHER
|
|
|
|
case decode_type_t::GOODWEATHER: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRGoodweatherAc ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->value); // Goodweather uses value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_GOODWEATHER
|
|
|
|
#if DECODE_GREE
|
|
|
|
case decode_type_t::GREE: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRGreeAC ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_GREE
|
|
|
|
#if DECODE_MIDEA
|
|
|
|
case decode_type_t::MIDEA: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRMideaAC ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->value); // Midea uses value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_MIDEA
|
|
|
|
#if DECODE_HAIER_AC
|
|
|
|
case decode_type_t::HAIER_AC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRHaierAC ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_HAIER_AC
|
|
|
|
#if DECODE_HAIER_AC_YRW02
|
|
|
|
case decode_type_t::HAIER_AC_YRW02: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRHaierACYRW02 ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_HAIER_AC_YRW02
|
|
|
|
#if DECODE_SAMSUNG_AC
|
|
|
|
case decode_type_t::SAMSUNG_AC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRSamsungAc ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state, result->bits / 8);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_SAMSUNG_AC
|
2020-07-29 12:57:44 +01:00
|
|
|
#if DECODE_SANYO_AC
|
|
|
|
case decode_type_t::SANYO_AC: {
|
|
|
|
IRSanyoAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_SANYO_AC
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_SHARP_AC
|
|
|
|
case decode_type_t::SHARP_AC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRSharpAc ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_SHARP_AC
|
|
|
|
#if DECODE_COOLIX
|
|
|
|
case decode_type_t::COOLIX: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRCoolixAC ac(kGpioUnused);
|
2019-11-02 11:21:18 +00:00
|
|
|
ac.on();
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->value); // Coolix uses value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_COOLIX
|
2020-06-24 20:48:33 +01:00
|
|
|
#if DECODE_CORONA_AC
|
|
|
|
case decode_type_t::CORONA_AC: {
|
|
|
|
IRCoronaAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->state, result->bits / 8);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_CORONA_AC
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_PANASONIC_AC
|
|
|
|
case decode_type_t::PANASONIC_AC: {
|
|
|
|
if (result->bits > kPanasonicAcShortBits) {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRPanasonicAc ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
#endif // DECODE_PANASONIC_AC
|
2021-01-04 17:43:58 +00:00
|
|
|
#if DECODE_PANASONIC_AC32
|
|
|
|
case decode_type_t::PANASONIC_AC32: {
|
|
|
|
if (result->bits >= kPanasonicAc32Bits) {
|
|
|
|
IRPanasonicAc32 ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->value); // Uses value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
#endif // DECODE_PANASONIC_AC
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_HITACHI_AC
|
|
|
|
case decode_type_t::HITACHI_AC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRHitachiAc ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_HITACHI_AC
|
2020-04-09 09:25:50 +01:00
|
|
|
#if DECODE_HITACHI_AC1
|
|
|
|
case decode_type_t::HITACHI_AC1: {
|
|
|
|
IRHitachiAc1 ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_HITACHI_AC1
|
2020-06-24 20:48:33 +01:00
|
|
|
#if DECODE_HITACHI_AC344
|
|
|
|
case decode_type_t::HITACHI_AC344: {
|
|
|
|
IRHitachiAc344 ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_HITACHI_AC344
|
2019-11-02 11:21:18 +00:00
|
|
|
#if DECODE_HITACHI_AC424
|
|
|
|
case decode_type_t::HITACHI_AC424: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRHitachiAc424 ac(kGpioUnused);
|
2019-11-02 11:21:18 +00:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_HITACHI_AC424
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_WHIRLPOOL_AC
|
|
|
|
case decode_type_t::WHIRLPOOL_AC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRWhirlpoolAc ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_WHIRLPOOL_AC
|
|
|
|
#if DECODE_VESTEL_AC
|
|
|
|
case decode_type_t::VESTEL_AC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRVestelAc ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->value); // Like Coolix, use value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_VESTEL_AC
|
2020-10-04 10:04:34 +01:00
|
|
|
#if DECODE_TECHNIBEL_AC
|
|
|
|
case decode_type_t::TECHNIBEL_AC: {
|
|
|
|
IRTechnibelAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->value); // TechnibelAc uses value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_TECHNIBEL_AC
|
2020-09-01 10:36:06 +01:00
|
|
|
#if DECODE_VOLTAS
|
|
|
|
case decode_type_t::VOLTAS: {
|
|
|
|
IRVoltas ac(kGpioUnused);
|
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_VOLTAS
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_TECO
|
|
|
|
case decode_type_t::TECO: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRTecoAc ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->value); // Like Coolix, use value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_TECO
|
|
|
|
#if DECODE_TCL112AC
|
|
|
|
case decode_type_t::TCL112AC: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRTcl112Ac ac(kGpioUnused);
|
2019-07-21 15:01:43 +01:00
|
|
|
ac.setRaw(result->state);
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_TCL112AC
|
2020-01-06 16:27:36 +00:00
|
|
|
#if DECODE_LG
|
|
|
|
case decode_type_t::LG:
|
|
|
|
case decode_type_t::LG2: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRLgAc ac(kGpioUnused);
|
2020-01-06 16:27:36 +00:00
|
|
|
ac.setRaw(result->value); // Like Coolix, use value instead of state.
|
|
|
|
switch (result->decode_type) {
|
|
|
|
case decode_type_t::LG2:
|
|
|
|
ac.setModel(lg_ac_remote_model_t::AKB75215403);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ac.setModel(lg_ac_remote_model_t::GE6711AR2853M);
|
|
|
|
}
|
|
|
|
return ac.isValidLgAc() ? ac.toString() : "";
|
|
|
|
}
|
|
|
|
#endif // DECODE_LG
|
2020-10-04 10:04:34 +01:00
|
|
|
#if DECODE_TRANSCOLD
|
|
|
|
case decode_type_t::TRANSCOLD: {
|
|
|
|
IRTranscoldAc ac(kGpioUnused);
|
|
|
|
ac.on();
|
|
|
|
ac.setRaw(result->value); // TRANSCOLD uses value instead of state.
|
|
|
|
return ac.toString();
|
|
|
|
}
|
|
|
|
#endif // DECODE_TRANSCOLD
|
2019-07-21 15:01:43 +01:00
|
|
|
default:
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-24 20:48:33 +01:00
|
|
|
/// Convert a valid IR A/C remote message that we understand enough into a
|
|
|
|
/// Common A/C state.
|
|
|
|
/// @param[in] decode A PTR to a successful raw IR decode object.
|
|
|
|
/// @param[in] result A PTR to a state structure to store the result in.
|
|
|
|
/// @param[in] prev A PTR to a state structure which has the prev. state.
|
|
|
|
/// @return A boolean indicating success or failure.
|
2019-07-21 15:01:43 +01:00
|
|
|
bool decodeToState(const decode_results *decode, stdAc::state_t *result,
|
2020-06-24 20:48:33 +01:00
|
|
|
const stdAc::state_t *prev
|
|
|
|
/// @cond IGNORE
|
|
|
|
// *prev flagged as "unused" due to potential compiler warning when some
|
|
|
|
// protocols that use it are disabled. It really is used.
|
|
|
|
__attribute__((unused))
|
|
|
|
/// @endcond
|
|
|
|
) {
|
2019-07-21 15:01:43 +01:00
|
|
|
if (decode == NULL || result == NULL) return false; // Safety check.
|
|
|
|
switch (decode->decode_type) {
|
2020-07-29 12:57:44 +01:00
|
|
|
#if DECODE_AIRWELL
|
|
|
|
case decode_type_t::AIRWELL: {
|
|
|
|
IRAirwellAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
2020-10-04 10:04:34 +01:00
|
|
|
*result = ac.toCommon(prev);
|
2020-07-29 12:57:44 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_AIRWELL
|
2019-08-30 19:41:01 +01:00
|
|
|
#if DECODE_AMCOR
|
|
|
|
case decode_type_t::AMCOR: {
|
|
|
|
IRAmcorAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_AMCOR
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_ARGO
|
|
|
|
case decode_type_t::ARGO: {
|
|
|
|
IRArgoAC ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_ARGO
|
|
|
|
#if DECODE_COOLIX
|
|
|
|
case decode_type_t::COOLIX: {
|
|
|
|
IRCoolixAC ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
|
|
|
*result = ac.toCommon(prev);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_COOLIX
|
2020-06-24 20:48:33 +01:00
|
|
|
#if DECODE_CORONA_AC
|
|
|
|
case decode_type_t::CORONA_AC: {
|
|
|
|
IRCoronaAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state, decode->bits / 8);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_CARRIER_AC64
|
|
|
|
#if DECODE_CARRIER_AC64
|
|
|
|
case decode_type_t::CARRIER_AC64: {
|
|
|
|
IRCarrierAc64 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_CARRIER_AC64
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_DAIKIN
|
|
|
|
case decode_type_t::DAIKIN: {
|
|
|
|
IRDaikinESP ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN
|
2019-11-02 11:21:18 +00:00
|
|
|
#if DECODE_DAIKIN128
|
|
|
|
case decode_type_t::DAIKIN128: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRDaikin128 ac(kGpioUnused);
|
2019-11-02 11:21:18 +00:00
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN128
|
|
|
|
#if DECODE_DAIKIN152
|
|
|
|
case decode_type_t::DAIKIN152: {
|
2020-07-29 12:57:44 +01:00
|
|
|
IRDaikin152 ac(kGpioUnused);
|
2019-11-02 11:21:18 +00:00
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN152
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_DAIKIN160
|
|
|
|
case decode_type_t::DAIKIN160: {
|
|
|
|
IRDaikin160 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN160
|
|
|
|
#if DECODE_DAIKIN176
|
|
|
|
case decode_type_t::DAIKIN176: {
|
|
|
|
IRDaikin176 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN160
|
|
|
|
#if DECODE_DAIKIN2
|
|
|
|
case decode_type_t::DAIKIN2: {
|
|
|
|
IRDaikin2 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN2
|
|
|
|
#if DECODE_DAIKIN216
|
|
|
|
case decode_type_t::DAIKIN216: {
|
|
|
|
IRDaikin216 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN216
|
2020-04-09 09:25:50 +01:00
|
|
|
#if DECODE_DAIKIN64
|
|
|
|
case decode_type_t::DAIKIN64: {
|
|
|
|
IRDaikin64 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
|
|
|
*result = ac.toCommon(prev);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_DAIKIN64
|
2020-05-20 11:42:34 +01:00
|
|
|
#if DECODE_DELONGHI_AC
|
|
|
|
case decode_type_t::DELONGHI_AC: {
|
|
|
|
IRDelonghiAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_DELONGHI_AC
|
2021-03-25 07:40:27 +00:00
|
|
|
#if DECODE_ECOCLIM
|
|
|
|
case decode_type_t::ECOCLIM: {
|
|
|
|
if (decode->bits == kEcoclimBits) {
|
|
|
|
IREcoclimAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
|
|
|
*result = ac.toCommon();
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_ECOCLIM
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_ELECTRA_AC
|
|
|
|
case decode_type_t::ELECTRA_AC: {
|
|
|
|
IRElectraAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_ELECTRA_AC
|
|
|
|
#if DECODE_FUJITSU_AC
|
|
|
|
case decode_type_t::FUJITSU_AC: {
|
|
|
|
IRFujitsuAC ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state, decode->bits / 8);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_FUJITSU_AC
|
|
|
|
#if DECODE_GOODWEATHER
|
|
|
|
case decode_type_t::GOODWEATHER: {
|
|
|
|
IRGoodweatherAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_GOODWEATHER
|
|
|
|
#if DECODE_GREE
|
|
|
|
case decode_type_t::GREE: {
|
|
|
|
IRGreeAC ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_GREE
|
|
|
|
#if DECODE_HAIER_AC
|
|
|
|
case decode_type_t::HAIER_AC: {
|
|
|
|
IRHaierAC ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_HAIER_AC
|
|
|
|
#if DECODE_HAIER_AC_YRW02
|
|
|
|
case decode_type_t::HAIER_AC_YRW02: {
|
|
|
|
IRHaierACYRW02 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_HAIER_AC_YRW02
|
|
|
|
#if (DECODE_HITACHI_AC || DECODE_HITACHI_AC2)
|
|
|
|
case decode_type_t::HITACHI_AC: {
|
|
|
|
IRHitachiAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // (DECODE_HITACHI_AC || DECODE_HITACHI_AC2)
|
2020-04-09 09:25:50 +01:00
|
|
|
#if DECODE_HITACHI_AC1
|
|
|
|
case decode_type_t::HITACHI_AC1: {
|
|
|
|
IRHitachiAc1 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_HITACHI_AC1
|
2020-06-24 20:48:33 +01:00
|
|
|
#if DECODE_HITACHI_AC344
|
|
|
|
case decode_type_t::HITACHI_AC344: {
|
|
|
|
IRHitachiAc344 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_HITACHI_AC344
|
2019-11-02 11:21:18 +00:00
|
|
|
#if DECODE_HITACHI_AC424
|
|
|
|
case decode_type_t::HITACHI_AC424: {
|
|
|
|
IRHitachiAc424 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_HITACHI_AC424
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_KELVINATOR
|
|
|
|
case decode_type_t::KELVINATOR: {
|
|
|
|
IRKelvinatorAC ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_KELVINATOR
|
2020-01-06 16:27:36 +00:00
|
|
|
#if DECODE_LG
|
|
|
|
case decode_type_t::LG:
|
|
|
|
case decode_type_t::LG2: {
|
|
|
|
IRLgAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
|
|
|
if (!ac.isValidLgAc()) return false;
|
|
|
|
switch (decode->decode_type) {
|
|
|
|
case decode_type_t::LG2:
|
|
|
|
ac.setModel(lg_ac_remote_model_t::AKB75215403);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ac.setModel(lg_ac_remote_model_t::GE6711AR2853M);
|
|
|
|
}
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_LG
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_MIDEA
|
|
|
|
case decode_type_t::MIDEA: {
|
|
|
|
IRMideaAC ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
2019-07-29 08:28:40 +01:00
|
|
|
*result = ac.toCommon(prev);
|
2019-07-21 15:01:43 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_MIDEA
|
|
|
|
#if DECODE_MITSUBISHI_AC
|
|
|
|
case decode_type_t::MITSUBISHI_AC: {
|
|
|
|
IRMitsubishiAC ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_MITSUBISHI_AC
|
2019-11-02 11:21:18 +00:00
|
|
|
#if DECODE_MITSUBISHI112
|
|
|
|
case decode_type_t::MITSUBISHI112: {
|
|
|
|
IRMitsubishi112 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_MITSUBISHI112
|
|
|
|
#if DECODE_MITSUBISHI136
|
|
|
|
case decode_type_t::MITSUBISHI136: {
|
|
|
|
IRMitsubishi136 ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_MITSUBISHI136
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_MITSUBISHIHEAVY
|
|
|
|
case decode_type_t::MITSUBISHI_HEAVY_88: {
|
|
|
|
IRMitsubishiHeavy88Ac ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case decode_type_t::MITSUBISHI_HEAVY_152: {
|
|
|
|
IRMitsubishiHeavy152Ac ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_MITSUBISHIHEAVY
|
|
|
|
#if DECODE_NEOCLIMA
|
|
|
|
case decode_type_t::NEOCLIMA: {
|
|
|
|
IRNeoclimaAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_NEOCLIMA
|
|
|
|
#if DECODE_PANASONIC_AC
|
|
|
|
case decode_type_t::PANASONIC_AC: {
|
|
|
|
IRPanasonicAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_PANASONIC_AC
|
2021-01-04 17:43:58 +00:00
|
|
|
#if DECODE_PANASONIC_AC32
|
|
|
|
case decode_type_t::PANASONIC_AC32: {
|
|
|
|
IRPanasonicAc32 ac(kGpioUnused);
|
|
|
|
if (decode->bits >= kPanasonicAc32Bits) {
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
|
|
|
*result = ac.toCommon(prev);
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_PANASONIC_AC32
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_SAMSUNG_AC
|
|
|
|
case decode_type_t::SAMSUNG_AC: {
|
|
|
|
IRSamsungAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_SAMSUNG_AC
|
2020-07-29 12:57:44 +01:00
|
|
|
#if DECODE_SANYO_AC
|
|
|
|
case decode_type_t::SANYO_AC: {
|
|
|
|
IRSanyoAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_SANYO_AC
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_SHARP_AC
|
|
|
|
case decode_type_t::SHARP_AC: {
|
|
|
|
IRSharpAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_SHARP_AC
|
|
|
|
#if DECODE_TCL112AC
|
|
|
|
case decode_type_t::TCL112AC: {
|
|
|
|
IRTcl112Ac ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_TCL112AC
|
2020-10-04 10:04:34 +01:00
|
|
|
#if DECODE_TECHNIBEL_AC
|
|
|
|
case decode_type_t::TECHNIBEL_AC: {
|
|
|
|
IRTechnibelAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_TECHNIBEL_AC
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_TECO
|
|
|
|
case decode_type_t::TECO: {
|
|
|
|
IRTecoAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_TECO
|
|
|
|
#if DECODE_TOSHIBA_AC
|
|
|
|
case decode_type_t::TOSHIBA_AC: {
|
|
|
|
IRToshibaAC ac(kGpioUnused);
|
2021-03-25 07:40:27 +00:00
|
|
|
ac.setRaw(decode->state, decode->bits / 8);
|
|
|
|
*result = ac.toCommon(prev);
|
2019-07-21 15:01:43 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_TOSHIBA_AC
|
|
|
|
#if DECODE_TROTEC
|
|
|
|
case decode_type_t::TROTEC: {
|
|
|
|
IRTrotecESP ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_TROTEC
|
|
|
|
#if DECODE_VESTEL_AC
|
|
|
|
case decode_type_t::VESTEL_AC: {
|
|
|
|
IRVestelAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // Uses value instead of state.
|
|
|
|
*result = ac.toCommon();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_VESTEL_AC
|
2020-09-01 10:36:06 +01:00
|
|
|
#if DECODE_VOLTAS
|
|
|
|
case decode_type_t::VOLTAS: {
|
|
|
|
IRVoltas ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
|
|
|
*result = ac.toCommon(prev);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_VOLTAS
|
2019-07-21 15:01:43 +01:00
|
|
|
#if DECODE_WHIRLPOOL_AC
|
|
|
|
case decode_type_t::WHIRLPOOL_AC: {
|
|
|
|
IRWhirlpoolAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->state);
|
2020-10-04 10:04:34 +01:00
|
|
|
*result = ac.toCommon(prev);
|
2019-07-21 15:01:43 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_WHIRLPOOL_AC
|
2020-10-04 10:04:34 +01:00
|
|
|
#if DECODE_TRANSCOLD
|
|
|
|
case decode_type_t::TRANSCOLD: {
|
|
|
|
IRTranscoldAc ac(kGpioUnused);
|
|
|
|
ac.setRaw(decode->value); // TRANSCOLD Uses value instead of state.
|
|
|
|
*result = ac.toCommon(prev);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif // DECODE_TRANSCOLD
|
2019-07-21 15:01:43 +01:00
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
} // namespace IRAcUtils
|