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

Mitsubishi 112 #947

Merged
merged 46 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1237c55
Initial add of Mitsubishi 112 protocol. Decode of raw signal working.…
mrkuchel Oct 3, 2019
afe0da9
Temperature works now. Mode somewhat works. Fan and v and h vane don't.
mrkuchel Oct 3, 2019
65cf317
Got fan working as well.
mrkuchel Oct 3, 2019
44847a3
Removing debug print
mrkuchel Oct 3, 2019
00b92a6
Set power status seems to work.
mrkuchel Oct 3, 2019
d699d6c
SwingV and Fan working
mrkuchel Oct 4, 2019
565bedf
Everything apart from checksum *IMPORTANT* and H Swing seem to work.
mrkuchel Oct 4, 2019
e0b693a
SwingH working now. Econo not working but needs to be linked to stdAC.
mrkuchel Oct 4, 2019
1cd0a14
Change back to decoding all of the others that I didn't need initially.
mrkuchel Oct 4, 2019
c4be039
Made it hopefully so the only changes are the new code for 112.
mrkuchel Oct 4, 2019
5e19f8b
Changed it so that econo (not working) and swingh where included.
mrkuchel Oct 4, 2019
93b65cb
Merge pull request #1 from kuchel77/Mitsubishi112
kuchel77 Oct 5, 2019
f9592be
Fixing linter and unit test issues.
mrkuchel Oct 5, 2019
9f8116a
Fixed up econo.
mrkuchel Oct 5, 2019
bfb33f2
Econo frame done.
mrkuchel Oct 5, 2019
6ee5eeb
Formatting issues
mrkuchel Oct 5, 2019
3fe69d1
Fix up the 136 protocol I messed up.
mrkuchel Oct 5, 2019
81c08f2
Update travis.yml for personal notifications.
mrkuchel Oct 5, 2019
d2d93cf
Merge pull request #3 from kuchel77/Mitsubishi112
kuchel77 Oct 5, 2019
6936631
Fixing travis.yml notifications
mrkuchel Oct 5, 2019
6165eee
First update of tests. Using 136 as template.
mrkuchel Oct 5, 2019
c1d45a8
Checksum working thanks to oldcrankygit.
mrkuchel Oct 6, 2019
618b1f5
Updating the automated tests to check things work. Still needs more c…
mrkuchel Oct 6, 2019
867bf3c
Updated tests with real examples.
mrkuchel Oct 6, 2019
66dd50e
Fixed a test that was missing a comma.
mrkuchel Oct 6, 2019
35982c3
Remove econo for the moment. Once fixed it will go back in.
mrkuchel Oct 6, 2019
0d98d85
Fixed removing econo fully
mrkuchel Oct 6, 2019
393ae22
Remove econo fully to stop fails about unused variables.
mrkuchel Oct 6, 2019
3138256
Ignoring some failing tests at the moment.
mrkuchel Oct 6, 2019
ffaf394
Checksum should be working now. Works with the MQTT and my AC. Yeah!
mrkuchel Oct 6, 2019
8066def
Merge pull request #4 from kuchel77/Mitsubishi112
kuchel77 Oct 6, 2019
7313bc2
Merge Tcl112 and Mitsubishi112 decoder & review cleanup.
crankyoldgit Oct 7, 2019
be3c476
Remove references to "Inner"
crankyoldgit Oct 7, 2019
4be57c1
Update the tests
mrkuchel Oct 11, 2019
1060e52
Delete .travis.yml
kuchel77 Oct 11, 2019
eef1ad9
Merge remote-tracking branch 'origin/Mitsubishi112' into Mitsubishi112
kuchel77 Oct 12, 2019
a2361ff
Update the new contributors.
mrkuchel Oct 12, 2019
7daa940
Update to tests and econo mode setting.
mrkuchel Oct 12, 2019
02811a8
Update to SwingH test.
mrkuchel Oct 12, 2019
247cf4a
Actually make it swingh.
mrkuchel Oct 12, 2019
16d2807
Merge pull request #6 from kuchel77/Mitsubishi112
kuchel77 Oct 12, 2019
bccdd22
Revert "Delete .travis.yml"
kuchel77 Oct 11, 2019
119db30
Fix travis.yml removing notification rather than delete the file.
mrkuchel Oct 12, 2019
a708bce
Merge branch 'Mitsubishi112'
kuchel77 Oct 12, 2019
3bb4aba
Merge remote-tracking branch 'origin/master'
kuchel77 Oct 12, 2019
489c509
Update copyrights and comments.
mrkuchel Oct 12, 2019
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
1 change: 1 addition & 0 deletions .github/Contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [Fabien Valthier](https://github.com/hcoohb)
- [Ajay Pala](https://github.com/ajaypala/)
- [Motea Marius](https://github.com/mariusmotea)
- [Mark Kuchel](https://github.com/kuchel77)

All contributors can be found on the [contributors site](https://github.com/crankyoldgit/IRremoteESP8266/graphs/contributors).

Expand Down
55 changes: 55 additions & 0 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
#if SEND_MITSUBISHI_AC
case decode_type_t::MITSUBISHI_AC:
#endif
#if SEND_MITSUBISHI112
case decode_type_t::MITSUBISHI112:
#endif
crankyoldgit marked this conversation as resolved.
Show resolved Hide resolved
#if SEND_MITSUBISHI136
case decode_type_t::MITSUBISHI136:
#endif
Expand Down Expand Up @@ -704,6 +707,34 @@ void IRac::mitsubishi(IRMitsubishiAC *ac,
}
#endif // SEND_MITSUBISHI_AC

#if SEND_MITSUBISHI112
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);
// ac->setEcono(econo);
// FIXME - 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
void IRac::mitsubishi136(IRMitsubishi136 *ac,
const bool on, const stdAc::opmode_t mode,
Expand Down Expand Up @@ -1336,6 +1367,15 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
break;
}
#endif // SEND_MITSUBISHI_AC
#if SEND_MITSUBISHI112
case MITSUBISHI112:
{
IRMitsubishi112 ac(_pin, _inverted, _modulation);
mitsubishi112(&ac, on, send.mode, degC, send.fanspeed, send.swingv,
send.swingh, send.quiet);
break;
}
#endif // SEND_MITSUBISHI112
#if SEND_MITSUBISHI136
case MITSUBISHI136:
{
Expand Down Expand Up @@ -1813,6 +1853,13 @@ namespace IRAcUtils {
return ac.toString();
}
#endif // DECODE_MITSUBISHI_AC
#if DECODE_MITSUBISHI112
case decode_type_t::MITSUBISHI112: {
IRMitsubishi112 ac(0);
ac.setRaw(result->state);
return ac.toString();
}
#endif // DECODE_MITSUBISHI112
#if DECODE_MITSUBISHI136
case decode_type_t::MITSUBISHI136: {
IRMitsubishi136 ac(0);
Expand Down Expand Up @@ -2116,6 +2163,14 @@ namespace IRAcUtils {
break;
}
#endif // DECODE_MITSUBISHI_AC
#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);
Expand Down
8 changes: 8 additions & 0 deletions src/IRac.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,14 @@ void electra(IRElectraAc *ac,
const stdAc::swingh_t swingh,
const bool quiet, const int16_t clock = -1);
#endif // SEND_MITSUBISHI_AC
#if SEND_MITSUBISHI112
void 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);
#endif // SEND_MITSUBISHI112
#if SEND_MITSUBISHI136
void mitsubishi136(IRMitsubishi136 *ac,
const bool on, const stdAc::opmode_t mode,
Expand Down
9 changes: 5 additions & 4 deletions src/IRrecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,11 @@ bool IRrecv::decode(decode_results *results, irparams_t *save) {
DPRINTLN("Attempting Vestel AC decode");
if (decodeVestelAc(results)) return true;
#endif
#if DECODE_TCL112AC
DPRINTLN("Attempting TCL112AC decode");
if (decodeTcl112Ac(results)) return true;
#endif
#if DECODE_MITSUBISHI112 || DECODE_TCL112AC
// Mitsubish112 and Tcl112 share the same decoder.
DPRINTLN("Attempting Mitsubishi112/TCL112AC decode");
if (decodeMitsubishi112(results)) return true;
#endif // DECODE_MITSUBISHI112 || DECODE_TCL112AC
#if DECODE_TECO
DPRINTLN("Attempting Teco decode");
if (decodeTeco(results)) return true;
Expand Down
10 changes: 5 additions & 5 deletions src/IRrecv.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ class IRrecv {
const uint16_t nbits = kMitsubishi136Bits,
const bool strict = true);
#endif
#if DECODE_MITSUBISHI112
bool decodeMitsubishi112(decode_results *results,
const uint16_t nbits = kMitsubishi112Bits,
const bool strict = true);
#endif
#if DECODE_MITSUBISHIHEAVY
bool decodeMitsubishiHeavy(decode_results *results, const uint16_t nbits,
const bool strict = true);
Expand Down Expand Up @@ -477,11 +482,6 @@ class IRrecv {
const uint16_t nbits = kVestelAcBits,
const bool strict = true);
#endif
#if DECODE_TCL112AC
bool decodeTcl112Ac(decode_results *results,
const uint16_t nbits = kTcl112AcBits,
const bool strict = true);
#endif
#if DECODE_TECO
bool decodeTeco(decode_results *results, const uint16_t nbits = kTecoBits,
const bool strict = false);
Expand Down
13 changes: 11 additions & 2 deletions src/IRremoteESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* Carrier & Haier AC code by crankyoldgit
* Vestel AC code by Erdem U. Altınyurt
* Teco AC code by Fabien Valthier (hcoohb)
* Mitsubishi 112 AC Code by kuchel77
*
* GPL license, all text above must be included in any redistribution
****************************************************/
Expand Down Expand Up @@ -133,6 +134,9 @@
#define DECODE_MITSUBISHI136 true
#define SEND_MITSUBISHI136 true

#define DECODE_MITSUBISHI112 true
#define SEND_MITSUBISHI112 true

#define DECODE_FUJITSU_AC true
#define SEND_FUJITSU_AC true

Expand Down Expand Up @@ -265,7 +269,8 @@
DECODE_VESTEL_AC || DECODE_TCL112AC || DECODE_MITSUBISHIHEAVY || \
DECODE_DAIKIN216 || DECODE_SHARP_AC || DECODE_DAIKIN160 || \
DECODE_NEOCLIMA || DECODE_DAIKIN176 || DECODE_DAIKIN128 || \
DECODE_AMCOR || DECODE_DAIKIN152 || DECODE_MITSUBISHI136)
DECODE_AMCOR || DECODE_DAIKIN152 || DECODE_MITSUBISHI136 || \
DECODE_MITSUBISHI112)
#define DECODE_AC true // We need some common infrastructure for decoding A/Cs.
#else
#define DECODE_AC false // We don't need that infrastructure.
Expand Down Expand Up @@ -356,8 +361,9 @@ enum decode_type_t {
AMCOR,
DAIKIN152, // 70
MITSUBISHI136,
MITSUBISHI112,
// Add new entries before this one, and update it to point to the last entry.
kLastDecodeType = MITSUBISHI136,
kLastDecodeType = MITSUBISHI112,
};

// Message lengths & required repeat values
Expand Down Expand Up @@ -458,6 +464,9 @@ const uint16_t kMitsubishiACMinRepeat = kSingleRepeat;
const uint16_t kMitsubishi136StateLength = 17;
const uint16_t kMitsubishi136Bits = kMitsubishi136StateLength * 8;
const uint16_t kMitsubishi136MinRepeat = kNoRepeat;
const uint16_t kMitsubishi112StateLength = 14;
const uint16_t kMitsubishi112Bits = kMitsubishi112StateLength * 8;
const uint16_t kMitsubishi112MinRepeat = kNoRepeat;
const uint16_t kMitsubishiHeavy88StateLength = 11;
const uint16_t kMitsubishiHeavy88Bits = kMitsubishiHeavy88StateLength * 8;
const uint16_t kMitsubishiHeavy88MinRepeat = kNoRepeat;
Expand Down
7 changes: 7 additions & 0 deletions src/IRsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,8 @@ uint16_t IRsend::defaultBits(const decode_type_t protocol) {
return kMitsubishiACBits;
case MITSUBISHI136:
return kMitsubishi136Bits;
case MITSUBISHI112:
return kMitsubishi112Bits;
case MITSUBISHI_HEAVY_152:
return kMitsubishiHeavy152Bits;
case MITSUBISHI_HEAVY_88:
Expand Down Expand Up @@ -947,6 +949,11 @@ bool IRsend::send(const decode_type_t type, const unsigned char *state,
sendMitsubishi136(state, nbytes);
break;
#endif // SEND_MITSUBISHI136
#if SEND_MITSUBISHI112
case MITSUBISHI112:
sendMitsubishi112(state, nbytes);
break;
#endif // SEND_MITSUBISHI112
#if SEND_MITSUBISHIHEAVY
case MITSUBISHI_HEAVY_88:
sendMitsubishiHeavy88(state, nbytes);
Expand Down
5 changes: 5 additions & 0 deletions src/IRsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ class IRsend {
const uint16_t nbytes = kMitsubishi136StateLength,
const uint16_t repeat = kMitsubishi136MinRepeat);
#endif
#if SEND_MITSUBISHI112
void sendMitsubishi112(const unsigned char data[],
const uint16_t nbytes = kMitsubishi112StateLength,
const uint16_t repeat = kMitsubishi112MinRepeat);
#endif
#if SEND_MITSUBISHI2
void sendMitsubishi2(uint64_t data, uint16_t nbits = kMitsubishiBits,
uint16_t repeat = kMitsubishiMinRepeat);
Expand Down
6 changes: 6 additions & 0 deletions src/IRutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ decode_type_t strToDecodeType(const char * const str) {
return decode_type_t::MITSUBISHI_AC;
else if (!strcasecmp(str, "MITSUBISHI136"))
return decode_type_t::MITSUBISHI136;
else if (!strcasecmp(str, "MITSUBISHI112"))
return decode_type_t::MITSUBISHI112;
else if (!strcasecmp(str, "MITSUBISHI_HEAVY_88"))
return decode_type_t::MITSUBISHI_HEAVY_88;
else if (!strcasecmp(str, "MITSUBISHI_HEAVY_152"))
Expand Down Expand Up @@ -374,6 +376,9 @@ String typeToString(const decode_type_t protocol, const bool isRepeat) {
case MITSUBISHI136:
result = F("MITSUBISHI136");
break;
case MITSUBISHI112:
result = F("MITSUBISHI112");
break;
case MITSUBISHI_HEAVY_88:
result = F("MITSUBISHI_HEAVY_88");
break;
Expand Down Expand Up @@ -501,6 +506,7 @@ bool hasACState(const decode_type_t protocol) {
case HITACHI_AC2:
case KELVINATOR:
case MITSUBISHI136:
case MITSUBISHI112:
case MITSUBISHI_AC:
case MITSUBISHI_HEAVY_88:
case MITSUBISHI_HEAVY_152:
Expand Down
Loading