Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Technibel support #1259

Merged
merged 5 commits into from
Sep 6, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "ir_Sanyo.h"
#include "ir_Sharp.h"
#include "ir_Tcl.h"
#include "ir_Technibel.h"
#include "ir_Teco.h"
#include "ir_Toshiba.h"
#include "ir_Trotec.h"
Expand Down Expand Up @@ -251,6 +252,9 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
#if SEND_TCL112AC
case decode_type_t::TCL112AC:
#endif
#if SEND_TECHNIBEL_AC
case decode_type_t::TECHNIBEL_AC:
#endif
#if SEND_TECO
case decode_type_t::TECO:
#endif
Expand Down Expand Up @@ -1746,6 +1750,39 @@ void IRac::tcl112(IRTcl112Ac *ac,
}
#endif // SEND_TCL112AC

#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] 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.
/// @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 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->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

#if SEND_TECO
/// Send a Teco A/C message with the supplied settings.
/// @param[in, out] ac A Ptr to an IRTecoAc object to use.
Expand Down Expand Up @@ -2462,6 +2499,15 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
break;
}
#endif // SEND_TCL112AC
#if SEND_TECHNIBEL_AC
case TECHNIBEL_AC:
{
IRTechnibelAc ac(_pin, _inverted, _modulation);
technibel(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
send.sleep);
break;
}
#endif // SEND_TECHNIBEL_AC
#if SEND_TECO
case TECO:
{
Expand Down Expand Up @@ -3177,6 +3223,13 @@ namespace IRAcUtils {
return ac.toString();
}
#endif // DECODE_VESTEL_AC
#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
#if DECODE_VOLTAS
case decode_type_t::VOLTAS: {
IRVoltas ac(kGpioUnused);
Expand Down Expand Up @@ -3553,6 +3606,14 @@ namespace IRAcUtils {
break;
}
#endif // DECODE_TCL112AC
#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
#if DECODE_TECO
case decode_type_t::TECO: {
IRTecoAc ac(kGpioUnused);
Expand Down
7 changes: 7 additions & 0 deletions src/IRac.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "ir_Sanyo.h"
#include "ir_Sharp.h"
#include "ir_Tcl.h"
#include "ir_Technibel.h"
#include "ir_Teco.h"
#include "ir_Toshiba.h"
#include "ir_Trotec.h"
Expand Down Expand Up @@ -381,6 +382,12 @@ void electra(IRElectraAc *ac,
const bool turbo, const bool light, const bool econo,
const bool filter);
#endif // SEND_TCL112AC
#if SEND_TECHNIBEL_AC
void technibel(IRTechnibelAc *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 = -1);
#endif // SEND_TECHNIBEL_AC
#if SEND_TECO
void teco(IRTecoAc *ac,
const bool on, const stdAc::opmode_t mode, const float degrees,
Expand Down
4 changes: 4 additions & 0 deletions src/IRrecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,10 @@ bool IRrecv::decode(decode_results *results, irparams_t *save,
DPRINTLN("Attempting Carrier 64bit decode");
if (decodeCarrierAC64(results, offset)) return true;
#endif // DECODE_CARRIER_AC64
#if DECODE_TECHNIBEL_AC
DPRINTLN("Attempting Technibel AC decode");
if (decodeTechnibelAc(results, offset)) return true;
#endif // DECODE_TECHNIBEL_AC
#if DECODE_CORONA_AC
DPRINTLN("Attempting CoronaAc decode");
if (decodeCoronaAc(results, offset)) return true;
Expand Down
6 changes: 6 additions & 0 deletions src/IRrecv.h
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,12 @@ class IRrecv {
const uint16_t nbits = kMultibracketsBits,
const bool strict = true);
#endif // DECODE_MULTIBRACKETS
#if DECODE_TECHNIBEL_AC
bool decodeTechnibelAc(decode_results *results,
uint16_t offset = kStartOffset,
const uint16_t nbits = kTechnibelAcBits,
const bool strict = true);
#endif // DECODE_TECHNIBEL_AC
#if DECODE_CORONA_AC
bool decodeCoronaAc(decode_results *results, uint16_t offset = kStartOffset,
const uint16_t nbits = kCoronaAcBitsShort,
Expand Down
12 changes: 11 additions & 1 deletion src/IRremoteESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,13 @@
#define SEND_MULTIBRACKETS _IR_ENABLE_DEFAULT_
#endif // SEND_MULTIBRACKETS

#ifndef DECODE_TECHNIBEL_AC
#define DECODE_TECHNIBEL_AC _IR_ENABLE_DEFAULT_
#endif // DECODE_TECHNIBEL_AC
#ifndef SEND_TECHNIBEL_AC
#define SEND_TECHNIBEL_AC _IR_ENABLE_DEFAULT_
#endif // SEND_TECHNIBEL_AC

#ifndef DECODE_CORONA_AC
#define DECODE_CORONA_AC _IR_ENABLE_DEFAULT_
#endif // DECODE_CORONA_AC
Expand Down Expand Up @@ -835,8 +842,9 @@ enum decode_type_t {
VOLTAS, // 90
METZ,
TRANSCOLD,
TECHNIBEL_AC,
// Add new entries before this one, and update it to point to the last entry.
kLastDecodeType = TRANSCOLD,
kLastDecodeType = TECHNIBEL_AC,
};

// Message lengths & required repeat values
Expand Down Expand Up @@ -893,6 +901,8 @@ const uint16_t kDaikin216Bits = kDaikin216StateLength * 8;
const uint16_t kDaikin216DefaultRepeat = kNoRepeat;
const uint16_t kDelonghiAcBits = 64;
const uint16_t kDelonghiAcDefaultRepeat = kNoRepeat;
const uint16_t kTechnibelAcBits = 56;
const uint16_t kTechnibelAcDefaultRepeat = kNoRepeat;
const uint16_t kDenonBits = 15;
const uint16_t kDenon48Bits = 48;
const uint16_t kDenonLegacyBits = 14;
Expand Down
6 changes: 6 additions & 0 deletions src/IRsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ uint16_t IRsend::defaultBits(const decode_type_t protocol) {
return 48;
case MAGIQUEST:
case VESTEL_AC:
case TECHNIBEL_AC:
return 56;
case AMCOR:
case CARRIER_AC64:
Expand Down Expand Up @@ -976,6 +977,11 @@ bool IRsend::send(const decode_type_t type, const uint64_t data,
sendSymphony(data, nbits, min_repeat);
break;
#endif
#if SEND_TECHNIBEL_AC
case TECHNIBEL_AC:
sendTechnibelAc(data, nbits, min_repeat);
break;
#endif
#if SEND_TECO
case TECO:
sendTeco(data, nbits, min_repeat);
Expand Down
4 changes: 4 additions & 0 deletions src/IRsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,10 @@ class IRsend {
const uint16_t nbits = kMultibracketsBits,
const uint16_t repeat = kMultibracketsDefaultRepeat);
#endif
#if SEND_TECHNIBEL_AC
void sendTechnibelAc(uint64_t data, uint16_t nbits = kTechnibelAcBits,
uint16_t repeat = kTechnibelAcDefaultRepeat);
#endif
#if SEND_CORONA_AC
void sendCoronaAc(const uint8_t data[],
const uint16_t nbytes = kCoronaAcStateLength,
Expand Down
1 change: 1 addition & 0 deletions src/IRtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,5 +269,6 @@ const PROGMEM char *kAllProtocolNamesStr =
D_STR_VOLTAS "\x0"
D_STR_METZ "\x0"
D_STR_TRANSCOLD "\x0"
D_STR_TECHNIBEL_AC "\x0"
///< New protocol strings should be added just above this line.
"\x0"; ///< This string requires double null termination.
Loading