Skip to content

Commit e6ec73c

Browse files
authored
Added 'sensorTemperature' and 'iFeel' to IRac (common) (#1928)
* Added sensor temp. support to IRac (common) Incl. impl. for Argo A/C Signed-off-by: Mateusz Bronk <[email protected]> * Added common sensor temp. support to all protos exposing iFeel already Signed-off-by: Mateusz Bronk <[email protected]> Signed-off-by: Mateusz Bronk <[email protected]> Co-authored-by: Mateusz Bronk <[email protected]>
1 parent f19ab87 commit e6ec73c

14 files changed

+228
-81
lines changed

src/IRac.cpp

Lines changed: 117 additions & 45 deletions
Large diffs are not rendered by default.

src/IRac.h

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,14 @@ class IRac {
144144
#if SEND_ARGO
145145
void argo(IRArgoAC *ac,
146146
const bool on, const stdAc::opmode_t mode, const float degrees,
147-
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
148-
const bool turbo, const int16_t sleep = -1);
147+
const float sensorTemp, const stdAc::fanspeed_t fan,
148+
const stdAc::swingv_t swingv, const bool iFeel, const bool turbo,
149+
const int16_t sleep = -1);
149150
void argoWrem3_ACCommand(IRArgoAC_WREM3 *ac,
150151
const bool on, const stdAc::opmode_t mode, const float degrees,
151-
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
152-
const bool night, const bool econo, const bool turbo, const bool filter,
153-
const bool light);
152+
const float sensorTemp, const stdAc::fanspeed_t fan,
153+
const stdAc::swingv_t swingv, const bool iFeel, const bool night,
154+
const bool econo, const bool turbo, const bool filter, const bool light);
154155
void argoWrem3_iFeelReport(IRArgoAC_WREM3 *ac, const float sensorTemp);
155156
void argoWrem3_ConfigSet(IRArgoAC_WREM3 *ac, const uint8_t param,
156157
const uint8_t value, bool safe = true);
@@ -162,7 +163,7 @@ class IRac {
162163
const bool on, const stdAc::opmode_t mode, const float degrees,
163164
const stdAc::fanspeed_t fan,
164165
const bool quiet);
165-
#endif // SEND_COOLIX
166+
#endif // SEND_BOSCH144
166167
#if SEND_CARRIER_AC64
167168
void carrier64(IRCarrierAc64 *ac,
168169
const bool on, const stdAc::opmode_t mode,
@@ -172,10 +173,10 @@ void carrier64(IRCarrierAc64 *ac,
172173
#if SEND_COOLIX
173174
void coolix(IRCoolixAC *ac,
174175
const bool on, const stdAc::opmode_t mode, const float degrees,
175-
const stdAc::fanspeed_t fan,
176+
const float sensorTemp, const stdAc::fanspeed_t fan,
176177
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
177-
const bool turbo, const bool light, const bool clean,
178-
const int16_t sleep = -1);
178+
const bool iFeel, const bool turbo, const bool light,
179+
const bool clean, const int16_t sleep = -1);
179180
#endif // SEND_COOLIX
180181
#if SEND_CORONA_AC
181182
void corona(IRCoronaAc *ac,
@@ -253,15 +254,16 @@ void daikin216(IRDaikin216 *ac,
253254
#if SEND_ECOCLIM
254255
void ecoclim(IREcoclimAc *ac,
255256
const bool on, const stdAc::opmode_t mode,
256-
const float degrees, const stdAc::fanspeed_t fan,
257-
const int16_t sleep = -1, const int16_t clock = -1);
257+
const float degrees, const float sensorTemp,
258+
const stdAc::fanspeed_t fan, const int16_t sleep = -1,
259+
const int16_t clock = -1);
258260
#endif // SEND_ECOCLIM
259261
#if SEND_ELECTRA_AC
260262
void electra(IRElectraAc *ac,
261263
const bool on, const stdAc::opmode_t mode,
262-
const float degrees, const stdAc::fanspeed_t fan,
263-
const stdAc::swingv_t swingv,
264-
const stdAc::swingh_t swingh, const bool turbo,
264+
const float degrees, const float sensorTemp,
265+
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
266+
const stdAc::swingh_t swingh, const bool iFeel, const bool turbo,
265267
const bool lighttoggle, const bool clean);
266268
#endif // SEND_ELECTRA_AC
267269
#if SEND_FUJITSU_AC
@@ -287,8 +289,8 @@ void electra(IRElectraAc *ac,
287289
const bool on, const stdAc::opmode_t mode, const bool celsius,
288290
const float degrees, const stdAc::fanspeed_t fan,
289291
const stdAc::swingv_t swingv, const stdAc::swingh_t swingh,
290-
const bool turbo, const bool econo, const bool light,
291-
const bool clean, const int16_t sleep = -1);
292+
const bool iFeel, const bool turbo, const bool econo,
293+
const bool light, const bool clean, const int16_t sleep = -1);
292294
#endif // SEND_GREE
293295
#if SEND_HAIER_AC
294296
void haier(IRHaierAC *ac,
@@ -385,11 +387,11 @@ void electra(IRElectraAc *ac,
385387
#if SEND_MIDEA
386388
void midea(IRMideaAC *ac,
387389
const bool on, const stdAc::opmode_t mode, const bool celsius,
388-
const float degrees, const stdAc::fanspeed_t fan,
389-
const stdAc::swingv_t swingv,
390-
const bool quiet, const bool quiet_prev, const bool turbo,
391-
const bool econo, const bool light, const bool clean,
392-
const int16_t sleep = -1);
390+
const float degrees, const float sensorTemp,
391+
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
392+
const bool iFeel, const bool quiet, const bool quiet_prev,
393+
const bool turbo, const bool econo, const bool light,
394+
const bool clean, const int16_t sleep = -1);
393395
#endif // SEND_MIDEA
394396
#if SEND_MIRAGE
395397
void mirage(IRMirageAc *ac, const stdAc::state_t state);
@@ -473,8 +475,9 @@ void electra(IRElectraAc *ac,
473475
#if SEND_SANYO_AC
474476
void sanyo(IRSanyoAc *ac,
475477
const bool on, const stdAc::opmode_t mode, const float degrees,
476-
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
477-
const bool beep, const int16_t sleep = -1);
478+
const float sensorTemp, const stdAc::fanspeed_t fan,
479+
const stdAc::swingv_t swingv, const bool iFeel, const bool beep,
480+
const int16_t sleep = -1);
478481
#endif // SEND_SANYO_AC
479482
#if SEND_SANYO_AC88
480483
void sanyo88(IRSanyoAc88 *ac,

src/IRsend.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ const uint8_t kDutyMax = 100; // Percentage
3939
const uint16_t kMaxAccurateUsecDelay = 16383;
4040
// Usecs to wait between messages we don't know the proper gap time.
4141
const uint32_t kDefaultMessageGap = 100000;
42+
/// Placeholder for missing sensor temp value
43+
/// @note Not using "-1" as it may be a valid external temp
44+
const float kNoTempValue = -100.0;
4245

4346
/// Enumerators and Structures for the Common A/C API.
4447
namespace stdAc {
@@ -128,6 +131,8 @@ struct state_t {
128131
int16_t sleep = -1; // `-1` means off.
129132
int16_t clock = -1; // `-1` means not set.
130133
stdAc::ac_command_t command = stdAc::ac_command_t::kControlCommand;
134+
bool iFeel = false;
135+
float sensorTemperature = kNoTempValue; // `kNoTempValue` means not set.
131136
};
132137
}; // namespace stdAc
133138

src/ir_Argo.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,8 +1253,9 @@ stdAc::state_t IRArgoAC::toCommon(void) const {
12531253
result.power = _.Power;
12541254
result.mode = toCommonMode(getModeEx());
12551255
result.celsius = true;
1256-
result.degrees = (_messageType != argoIrMessageType_t::IFEEL_TEMP_REPORT)?
1257-
getTemp() : getSensorTemp();
1256+
result.degrees = getTemp();
1257+
result.sensorTemperature = getSensorTemp();
1258+
result.iFeel = getiFeel();
12581259
result.fanspeed = toCommonFanSpeed(getFanEx());
12591260
result.turbo = _.Max;
12601261
result.sleep = _.Night ? 0 : -1;
@@ -1268,7 +1269,6 @@ stdAc::state_t IRArgoAC::toCommon(void) const {
12681269
result.clean = false;
12691270
result.beep = false;
12701271
result.clock = -1;
1271-
// Common does not (yet?) support commandType / iFeel / roomTemp
12721272
return result;
12731273
}
12741274

@@ -1282,8 +1282,9 @@ stdAc::state_t IRArgoAC_WREM3::toCommon(void) const {
12821282
result.power = getPower();
12831283
result.mode = toCommonMode(getModeEx());
12841284
result.celsius = true;
1285-
result.degrees = (_messageType != argoIrMessageType_t::IFEEL_TEMP_REPORT)?
1286-
getTemp() : getSensorTemp();
1285+
result.degrees = getTemp();
1286+
result.sensorTemperature = getSensorTemp();
1287+
result.iFeel = getiFeel();
12871288
result.fanspeed = toCommonFanSpeed(getFanEx());
12881289
result.turbo = _.Max;
12891290
result.swingv = toCommonSwingV(_.Flap);
@@ -1304,7 +1305,6 @@ stdAc::state_t IRArgoAC_WREM3::toCommon(void) const {
13041305
result.swingh = stdAc::swingh_t::kOff;
13051306
result.clean = false;
13061307

1307-
// Common does not (yet?) support commandType / iFeel / roomTemp
13081308

13091309
return result;
13101310
}

src/ir_Coolix.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,8 @@ stdAc::state_t IRCoolixAC::toCommon(const stdAc::state_t *prev) const {
548548
// Back to "normal" stateful messages.
549549
result.mode = toCommonMode(getMode());
550550
result.degrees = getTemp();
551+
result.sensorTemperature = getSensorTemp();
552+
result.iFeel = getZoneFollow();
551553
result.fanspeed = toCommonFanSpeed(getFan());
552554
return result;
553555
}

src/ir_Coolix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ class IRCoolixAC {
165165
static stdAc::fanspeed_t toCommonFanSpeed(const uint8_t speed);
166166
stdAc::state_t toCommon(const stdAc::state_t *prev = NULL) const;
167167
String toString(void) const;
168+
void setZoneFollow(const bool on);
168169
#ifndef UNIT_TEST
169170

170171
private:
@@ -189,7 +190,6 @@ class IRCoolixAC {
189190
void setTempRaw(const uint8_t code);
190191
uint8_t getTempRaw(void) const;
191192
void setSensorTempRaw(const uint8_t code);
192-
void setZoneFollow(const bool on);
193193
bool isSpecialState(void) const;
194194
bool handleSpecialState(const uint32_t data);
195195
void updateAndSaveState(const uint32_t raw_state);

src/ir_Ecoclim.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ stdAc::state_t IREcoclimAc::toCommon(void) const {
365365
result.mode = toCommonMode(getMode());
366366
result.celsius = true;
367367
result.degrees = getTemp();
368+
result.sensorTemperature = getSensorTemp();
368369
result.fanspeed = toCommonFanSpeed(_.Fan);
369370
result.sleep = (getMode() == kEcoclimSleep) ? 0 : -1;
370371
result.clock = getClock();

src/ir_Electra.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ stdAc::state_t IRElectraAc::toCommon(void) const {
365365
result.mode = toCommonMode(_.Mode);
366366
result.celsius = true;
367367
result.degrees = getTemp();
368+
result.sensorTemperature = getSensorTemp();
368369
result.fanspeed = toCommonFanSpeed(_.Fan);
369370
result.swingv = getSwingV() ? stdAc::swingv_t::kAuto
370371
: stdAc::swingv_t::kOff;
@@ -373,6 +374,7 @@ stdAc::state_t IRElectraAc::toCommon(void) const {
373374
result.light = getLightToggle();
374375
result.turbo = _.Turbo;
375376
result.clean = _.Clean;
377+
result.iFeel = getIFeel();
376378
// Not supported.
377379
result.model = -1; // No models used.
378380
result.quiet = false;

src/ir_Gree.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,8 @@ stdAc::state_t IRGreeAC::toCommon(void) {
591591
result.mode = toCommonMode(_.Mode);
592592
result.celsius = !_.UseFahrenheit;
593593
result.degrees = getTemp();
594+
// no support for Sensor temp.
595+
result.iFeel = getIFeel();
594596
result.fanspeed = toCommonFanSpeed(_.Fan);
595597
if (_.SwingAuto)
596598
result.swingv = stdAc::swingv_t::kAuto;

src/ir_Midea.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ stdAc::state_t IRMideaAC::toCommon(const stdAc::state_t *prev) {
679679
result.mode = toCommonMode(_.Mode);
680680
result.celsius = !_.useFahrenheit;
681681
result.degrees = getTemp(result.celsius);
682+
result.sensorTemperature = getSensorTemp(result.celsius);
682683
result.fanspeed = toCommonFanSpeed(_.Fan);
683684
result.sleep = _.Sleep ? 0 : -1;
684685
result.econo = getEconoToggle();

0 commit comments

Comments
 (0)