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

Added MitsubishiAC VaneLeft #1572

Merged
merged 6 commits into from
Aug 27, 2021
Merged

Added MitsubishiAC VaneLeft #1572

merged 6 commits into from
Aug 27, 2021

Conversation

hideosasaki
Copy link
Contributor

@hideosasaki hideosasaki commented Aug 23, 2021

Hi,
I am a user of Mitsubishi A/C MSZ-ZW4017S-W, which has two vanes. While evaluating the library I noticed that IRMitsubishiAC::setVane moved only the right vane. So I added setVaneLeft method.
This is the first time to contribute open-source projects for me. Thank you so much for correcting my mistakes.
Hideo
IMG_0284

@NiKiZe
Copy link
Collaborator

NiKiZe commented Aug 23, 2021

Nice start! ありがとうございます!

Just a quick initial look.
Please add your device to the Supports section in the .h file.
There is a few checks that is failing, can you take a look?

Maybe we can also add some captures from original remote and add tests?
There is also some string generation that we would like to have. Let us know if this is something that you want to tackle, and if you need guidance. Otherwise we are happy to do these parts before merging.

src/ir_Mitsubishi.h Outdated Show resolved Hide resolved
Comment on lines 87 to 92
// Byte 14
uint8_t :4;
uint8_t :4;
// Byte 15
uint8_t :4;
uint8_t :4;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now these can be kept as :8; instead of double? :4; or is there some specific reason that it is split?

Comment on lines 492 to 495
uint8_t IRMitsubishiAC::getVaneLeft(void) const {
return _.VaneLeft;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this fits in 80 columns on one line?

Comment on lines 486 to 487
uint8_t pos = std::min(position, kMitsubishiAcVaneAutoMove); // bounds check
_.VaneLeft = pos;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporary pos variable is unnecessary

@NiKiZe NiKiZe self-assigned this Aug 23, 2021
@hideosasaki
Copy link
Contributor Author

hideosasaki commented Aug 23, 2021

@NiKiZe
Thank you for reviewing! I committed some fixes you pointed out. And I am sorry for not being able to provide the real capture, because I haven't got any IR receivable devices but only have M5Stick-C.

Copy link
Owner

@crankyoldgit crankyoldgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on your effort. We appreciate it!

@@ -652,6 +652,26 @@ TEST(TestMitsubishiACClass, VaneMode) {
EXPECT_EQ(kMitsubishiAcVaneAutoMove - 1, ac.getVane());
}

TEST(TestMitsubishiACClass, VaneMode) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test with the same name already exists. e.g. VaneMode
You need to change it for your new test.
e.g.

TEST(TestMitsubishiACClass, VaneLeft) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to VaneLeft

@@ -480,6 +480,16 @@ uint8_t IRMitsubishiAC::getWideVane(void) const {
return _.WideVane;
}

/// Set the requested Left Vane (Vertical Swing) operation mode of the a/c unit.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it "Vertical Swing" or "Horizontal Swing"? Your description Mitsubishi144Protocol (VaneLeft) indicates it's a "SwingH(Left)". Hence the question.

Copy link
Contributor Author

@hideosasaki hideosasaki Aug 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's Vertical Swing. The comment was wrong. See the attached photo on the first post.

_.VaneLeft = std::min(position, kMitsubishiAcVaneAutoMove); // bounds check
}

/// Get the Left Vane (Vertical Swing) mode of the A/C.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto other comment.

src/ir_Mitsubishi.cpp Show resolved Hide resolved
@crankyoldgit
Copy link
Owner

One of the unit tests is failing.
It just needs to be updated.
See https://github.com/crankyoldgit/IRremoteESP8266/pull/1572/checks?check_run_id=3419003709#step:4:2931

@hideosasaki
Copy link
Contributor Author

@crankyoldgit
I fixed the test case, just removed the VaneLeft setting from. I had no choice to do the bad thing because I haven't got the IR receivable device.

test/ir_Mitsubishi_test.cpp Outdated Show resolved Hide resolved
@crankyoldgit crankyoldgit merged commit e507b60 into crankyoldgit:master Aug 27, 2021
Copy link
Owner

@crankyoldgit crankyoldgit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

crankyoldgit added a commit that referenced this pull request Aug 27, 2021
* Fix a code linter warning.
* Improve documentation.
* Improve a unit test.

Ref #1572
@hideosasaki hideosasaki deleted the Mitsubishi_VaneLeft branch August 27, 2021 06:07
crankyoldgit added a commit that referenced this pull request Aug 27, 2021
* Fix a code linter warning.
* Improve documentation.
* Improve a unit test.

Ref #1572
crankyoldgit added a commit that referenced this pull request Aug 28, 2021
_v2.7.20 (20210828)_

**[Bug Fixes]**
- Make `strToSwingH()` match "Right Max" (#1550 #1551)

**[Features]**
- Experimental Bose remote support (#1579)
- Added MitsubishiAC VaneLeft (#1572 #1576)
- HAIER_AC176: Add experimental detailed support (#1480 #1571)
- Detailed support for Tornado/Sanyo 88-bit A/C protocol (#1503 #1568)
- Add support for new `TROTEC_3550` A/C protocol (#1563 #1566 #1507)
- SamsungAc: Use `sendExtended()` going forward. (#1484 #1562)
- SamsungAc: Redo/fix checksum calculations. (#1538 #1554)
- LG: Add support for `AKB73757604` model (#1531 #1545)
- Daikin176: Add support for Unit Id. (#1543 #1544)
- Daikin2: Add support for Humidity setting/operation. (#1535 #1540)
- TCL112AC: Add support for quiet/mute setting. (#1528 #1529)
- LG2: Add Fan speed, Swing, & Light support for new `AKB74955603` model (#1513 #1530)
- Add Mitsubishi AC "fan only" mode (#1527)

**[Misc]**
- Fix pylint issues due to pylint update. (#1569 #1570)
- DAIKIN216: Update supported models. (#1552 #1567)
- IRMQTTServer: Build a minimal OTA image via PlatformIO. (#1513 #1541)
- Reduce memory fragmentation cause by String usage. (#1493 #1536)
- Refactor `decodeMitsubishiAC()` (#1523 #1532)
- Fix incorrect comment.
- Migrate from Travis to GitHub Actions (#1522 #1526)
- Documentation update with additional supported Panasonic AC models (#1525)
@crankyoldgit crankyoldgit mentioned this pull request Aug 28, 2021
crankyoldgit added a commit that referenced this pull request Aug 28, 2021
_v2.7.20 (20210828)_

**[Bug Fixes]**
- Make `strToSwingH()` match "Right Max" (#1550 #1551)

**[Features]**
- Experimental Bose remote support (#1579)
- Added MitsubishiAC VaneLeft (#1572 #1576)
- HAIER_AC176: Add experimental detailed support (#1480 #1571)
- Detailed support for Tornado/Sanyo 88-bit A/C protocol (#1503 #1568)
- Add support for new `TROTEC_3550` A/C protocol (#1563 #1566 #1507)
- SamsungAc: Use `sendExtended()` going forward. (#1484 #1562)
- SamsungAc: Redo/fix checksum calculations. (#1538 #1554)
- LG: Add support for `AKB73757604` model (#1531 #1545)
- Daikin176: Add support for Unit Id. (#1543 #1544)
- Daikin2: Add support for Humidity setting/operation. (#1535 #1540)
- TCL112AC: Add support for quiet/mute setting. (#1528 #1529)
- LG2: Add Fan speed, Swing, & Light support for new `AKB74955603` model (#1513 #1530)
- Add Mitsubishi AC "fan only" mode (#1527)

**[Misc]**
- Change when some github workflows run (#1583)
- Add/update supported device info (#1580 #1581 #1585)
- Fix pylint issues due to pylint update. (#1569 #1570)
- DAIKIN216: Update supported models. (#1552 #1567)
- IRMQTTServer: Build a minimal OTA image via PlatformIO. (#1513 #1541)
- Reduce memory fragmentation cause by String usage. (#1493 #1536)
- Refactor `decodeMitsubishiAC()` (#1523 #1532)
- Fix incorrect comment.
- Migrate from Travis to GitHub Actions (#1522 #1526)
- Documentation update with additional supported Panasonic AC models (#1525)
crankyoldgit added a commit that referenced this pull request Aug 28, 2021
## _v2.7.20 (20210828)_

**[Bug Fixes]**
- Make `strToSwingH()` match "Right Max" (#1550 #1551)

**[Features]**
- Experimental Bose remote support (#1579)
- Added MitsubishiAC VaneLeft (#1572 #1576)
- HAIER_AC176: Add experimental detailed support (#1480 #1571)
- Detailed support for Tornado/Sanyo 88-bit A/C protocol (#1503 #1568)
- Add support for new `TROTEC_3550` A/C protocol (#1563 #1566 #1507)
- SamsungAc: Use `sendExtended()` going forward. (#1484 #1562)
- SamsungAc: Redo/fix checksum calculations. (#1538 #1554)
- LG: Add support for `AKB73757604` model (#1531 #1545)
- Daikin176: Add support for Unit Id. (#1543 #1544)
- Daikin2: Add support for Humidity setting/operation. (#1535 #1540)
- TCL112AC: Add support for quiet/mute setting. (#1528 #1529)
- LG2: Add Fan speed, Swing, & Light support for new `AKB74955603` model (#1513 #1530)
- Add Mitsubishi AC "fan only" mode (#1527)

**[Misc]**
- Change when some github workflows run (#1583)
- Add/update supported device info (#1580 #1581 #1585)
- Fix pylint issues due to pylint update. (#1569 #1570)
- DAIKIN216: Update supported models. (#1552 #1567)
- IRMQTTServer: Build a minimal OTA image via PlatformIO. (#1513 #1541)
- Reduce memory fragmentation cause by String usage. (#1493 #1536)
- Refactor `decodeMitsubishiAC()` (#1523 #1532)
- Fix incorrect comment.
- Migrate from Travis to GitHub Actions (#1522 #1526)
- Documentation update with additional supported Panasonic AC models (#1525)
@crankyoldgit
Copy link
Owner

FYI, the changes mentioned above have been included in the just released v2.7.20 of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants