Skip to content

Commit

Permalink
Fujitsu: Add support for ARREW4E model. (#1456)
Browse files Browse the repository at this point in the history
* All Models:
  - Add `setId()` & `getId()` for controlling multiple A/C units in the same area. (`IRFujitsuAC` class only)
  - Relax tests in `decodeFujitsu()` to match different IDs.
  - Tweak timing tolerance for `decodeFujitsu()` to improve matching.
* `ARREW4E` models
  - Support new temperature setting style.
    * Half degrees (Celsius) e.g. `25.5`
    * Native Fahrenheit support.
    * Allow _Outside Quiet_, _Powerful_, & _Economy_ settings.
    * Add support for _10C Heat_ setting. (`IRFujitsuAC` class only)
* Improve header messages in generated `IRtext.h`

Fixes #1455
  • Loading branch information
crankyoldgit committed Apr 17, 2021
1 parent 02c7651 commit 635ec85
Show file tree
Hide file tree
Showing 12 changed files with 562 additions and 162 deletions.
7 changes: 5 additions & 2 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ void IRac::electra(IRElectraAc *ac,
/// @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.
Expand All @@ -905,6 +906,7 @@ void IRac::electra(IRElectraAc *ac,
/// @param[in] sleep Nr. of minutes for sleep mode. <= 0 is Off, > 0 is on.
void IRac::fujitsu(IRFujitsuAC *ac, const fujitsu_ac_remote_model_t model,
const bool on, const stdAc::opmode_t mode,
const bool celsius,
const float degrees, const stdAc::fanspeed_t fan,
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
const bool quiet, const bool turbo, const bool econo,
Expand Down Expand Up @@ -933,7 +935,7 @@ void IRac::fujitsu(IRFujitsuAC *ac, const fujitsu_ac_remote_model_t model,
}
// Normal operation.
ac->setMode(ac->convertMode(mode));
ac->setTemp(degrees);
ac->setTemp(degrees, celsius);
ac->setFanSpeed(ac->convertFan(fan));
uint8_t swing = kFujitsuAcSwingOff;
if (swingv > stdAc::swingv_t::kOff) swing |= kFujitsuAcSwingVert;
Expand Down Expand Up @@ -2485,7 +2487,8 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
IRFujitsuAC ac(_pin, (fujitsu_ac_remote_model_t)send.model, _inverted,
_modulation);
fujitsu(&ac, (fujitsu_ac_remote_model_t)send.model, send.power, send.mode,
degC, send.fanspeed, send.swingv, send.swingh, send.quiet,
send.celsius, send.degrees, send.fanspeed,
send.swingv, send.swingh, send.quiet,
send.turbo, send.econo, send.filter, send.clean);
break;
}
Expand Down
3 changes: 2 additions & 1 deletion src/IRac.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ void electra(IRElectraAc *ac,
#endif // SEND_ELECTRA_AC
#if SEND_FUJITSU_AC
void fujitsu(IRFujitsuAC *ac, const fujitsu_ac_remote_model_t model,
const bool on, const stdAc::opmode_t mode, const float degrees,
const bool on, const stdAc::opmode_t mode,
const bool celsius, const float degrees,
const stdAc::fanspeed_t fan,
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
const bool quiet, const bool turbo, const bool econo,
Expand Down
1 change: 1 addition & 0 deletions src/IRsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ enum fujitsu_ac_remote_model_t {
///< control)
ARJW2, ///< (4) AR-JW2 (Same as ARDB1 but with horiz control)
ARRY4, ///< (5) AR-RY4 (Same as AR-RAH2E but with clean & filter)
ARREW4E, ///< (6) Similar to ARRAH2E, but with different temp config.
};

/// Gree A/C model numbers
Expand Down
4 changes: 3 additions & 1 deletion src/IRtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ const PROGMEM char* kIonStr = D_STR_ION; ///< "Ion"
const PROGMEM char* kFreshStr = D_STR_FRESH; ///< "Fresh"
const PROGMEM char* kHoldStr = D_STR_HOLD; ///< "Hold"
const PROGMEM char* kButtonStr = D_STR_BUTTON; ///< "Button"
const PROGMEM char* k8CHeatStr = D_STR_8C_HEAT; ///< "8CHeat"
const PROGMEM char* k8CHeatStr = D_STR_8C_HEAT; ///< "8C Heat"
const PROGMEM char* k10CHeatStr = D_STR_10C_HEAT; ///< "10C Heat"
const PROGMEM char* kNightStr = D_STR_NIGHT; ///< "Night"
const PROGMEM char* kSilentStr = D_STR_SILENT; ///< "Silent"
const PROGMEM char* kFilterStr = D_STR_FILTER; ///< "Filter"
Expand Down Expand Up @@ -97,6 +98,7 @@ const PROGMEM char* kRoomStr = D_STR_ROOM; ///< "Room"
const PROGMEM char* k6thSenseStr = D_STR_6THSENSE; ///< "6th Sense"
const PROGMEM char* kTypeStr = D_STR_TYPE; ///< "Type"
const PROGMEM char* kSpecialStr = D_STR_SPECIAL; ///< "Special"
const PROGMEM char* kIdStr = D_STR_ID; ///< "Id" / Device Identifier

const PROGMEM char* kAutoStr = D_STR_AUTO; ///< "Auto"
const PROGMEM char* kAutomaticStr = D_STR_AUTOMATIC; ///< "Automatic"
Expand Down
6 changes: 4 additions & 2 deletions src/IRtext.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2019 - David Conran (@crankyoldgit)
// Copyright 2019-2021 - David Conran (@crankyoldgit)
// This header file is to be included in files **other than** 'IRtext.cpp'.
//
// WARNING: Do not edit this file! This file is automatically generated by
// 'tools/generate_irtext_h.sh'.
// '../tools/generate_irtext_h.sh'.

#ifndef IRTEXT_H_
#define IRTEXT_H_
Expand All @@ -13,6 +13,7 @@
// This means there is only one copy of the character/string/text etc.

extern char kTimeSep;
extern const char* k10CHeatStr;
extern const char* k3DStr;
extern const char* k6thSenseStr;
extern const char* k8CHeatStr;
Expand Down Expand Up @@ -66,6 +67,7 @@ extern const char* kHoldStr;
extern const char* kHoursStr;
extern const char* kHourStr;
extern const char* kHumidStr;
extern const char* kIdStr;
extern const char* kIFeelStr;
extern const char* kInsideStr;
extern const char* kIonStr;
Expand Down
1 change: 1 addition & 0 deletions src/IRutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ namespace irutils {
case fujitsu_ac_remote_model_t::ARREB1E: return F("ARREB1E");
case fujitsu_ac_remote_model_t::ARJW2: return F("ARJW2");
case fujitsu_ac_remote_model_t::ARRY4: return F("ARRY4");
case fujitsu_ac_remote_model_t::ARREW4E: return F("ARREW4E");
default: return kUnknownStr;
}
break;
Expand Down
Loading

0 comments on commit 635ec85

Please sign in to comment.