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

Coolix improvements #944

Merged
merged 15 commits into from
Oct 22, 2019
Merged

Conversation

ribeirodanielf
Copy link
Contributor

Hi David,

After your comments, seems I've found the less intrusive way to improve and fix some issues with the code. I'm testing it on my real setup and so far is working fine.
My apologies but I don't know yet how to execute the automated tests.
Could you please check the code?
Regards,

Daniel Ribeiro

@crankyoldgit crankyoldgit self-requested a review October 3, 2019 23:40
@crankyoldgit crankyoldgit self-assigned this Oct 3, 2019
@crankyoldgit
Copy link
Owner

My apologies but I don't know yet how to execute the automated tests.

See https://github.com/crankyoldgit/IRremoteESP8266/wiki/Library-Maintainers-Guide#unit-tests for how to run them yourself locally.

Could you please check the code?

Will do.

@crankyoldgit crankyoldgit added the Hacktoberfest Hacktoberfest participation label Oct 3, 2019
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.

Much easier to read this time! Thanks!

src/ir_Coolix.cpp Show resolved Hide resolved
src/ir_Coolix.cpp Show resolved Hide resolved
test/ir_Coolix_test.cpp Outdated Show resolved Hide resolved
@ribeirodanielf
Copy link
Contributor Author

My apologies but I don't know yet how to execute the automated tests.

See https://github.com/crankyoldgit/IRremoteESP8266/wiki/Library-Maintainers-Guide#unit-tests for how to run them yourself locally.

Could you please check the code?

Will do.

Hi David, I've changed most of the points you raised and fixed the tests but seems something else is wrong and I cannot figure out.
Travis is giving an error but I can see no red lines for 2672.2 build job.

Could you please check and advise.
Thanks

@crankyoldgit
Copy link
Owner

There was a bunch of linter issues when I looked last time. Did you address those? Search for "exited with" in the Travis log.

@crankyoldgit
Copy link
Owner

Now I'm near a keyboard again, here are the current issues causing the Travis checks to fail:

https://travis-ci.org/crankyoldgit/IRremoteESP8266/jobs/593345709#L441-L450

src/ir_Coolix.h:78:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:79:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:80:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:81:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:82:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:83:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:84:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:85:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:86:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:141:  Missing spaces around =  [whitespace/operators] [4]

&
https://travis-ci.org/crankyoldgit/IRremoteESP8266/jobs/593345709#L486-L487

src/ir_Coolix.cpp:131:  Missing space before {  [whitespace/braces] [5]
src/ir_Coolix.cpp:133:  Missing space before {  [whitespace/braces] [5]

They are just minor linter issues.

@ribeirodanielf
Copy link
Contributor Author

Now I'm near a keyboard again, here are the current issues causing the Travis checks to fail:

https://travis-ci.org/crankyoldgit/IRremoteESP8266/jobs/593345709#L441-L450

src/ir_Coolix.h:78:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:79:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:80:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:81:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:82:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:83:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:84:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:85:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:86:  At least two spaces is best between code and comments  [whitespace/comments] [2]
src/ir_Coolix.h:141:  Missing spaces around =  [whitespace/operators] [4]

&
https://travis-ci.org/crankyoldgit/IRremoteESP8266/jobs/593345709#L486-L487

src/ir_Coolix.cpp:131:  Missing space before {  [whitespace/braces] [5]
src/ir_Coolix.cpp:133:  Missing space before {  [whitespace/braces] [5]

They are just minor linter issues.

My bad! I was so focused to solve the Test issues that I forgot to check linter :(
Just submitted the minor fixes.
Thanks

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.

Code wise, I'm fine with this. Just a few questions to clarify/confirm what you are proposing is correct.
Once confirmed, I'm happy to merge etc.

@@ -1905,6 +1910,7 @@ namespace IRAcUtils {
#if DECODE_COOLIX
case decode_type_t::COOLIX: {
IRCoolixAC ac(0);
ac.on();
Copy link
Owner

Choose a reason for hiding this comment

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

Why is this statement required? setRaw() should (in theory) generate the correct internal state for setPower() from result->value.
As I understand it (I don't have access to a "Coolix" compatible A/C system), every IR message that is NOT an "off" command is considered an "on" message. Is that a correct assumption?

src/ir_Coolix.cpp Outdated Show resolved Hide resolved
@@ -170,11 +218,10 @@ uint8_t IRCoolixAC::getTemp() {
uint8_t i;
for (i = 0; i < kCoolixTempRange; i++)
if (kCoolixTempMap[i] == code) return kCoolixTempMin + i;
return kCoolixUnknown; // Not a temp we expected.
return kCoolixTempMax; // Not a temp we expected.
Copy link
Owner

Choose a reason for hiding this comment

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

Might this hide when we are getting a value we don't (yet) understand, and perhaps should?

@@ -278,43 +344,41 @@ void IRCoolixAC::setMode(const uint8_t mode) {
switch (actualmode) {
case kCoolixAuto:
case kCoolixDry:
if (this->getFan() == kCoolixFanAuto)
// No kCoolixFanAuto in Dry/Auto mode.
Copy link
Owner

Choose a reason for hiding this comment

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

Is this comment/assumption incorrect? IIRC when I added this, the person said there was no "auto" fan speed when in dry/auto operation modes.
Can you confirm that isn't the case? If you can have fan set to auto in dry/auto operation mode, then this is obviously fine as is.

src/ir_Coolix.cpp Outdated Show resolved Hide resolved
src/ir_Coolix.h Outdated Show resolved Hide resolved
@crankyoldgit
Copy link
Owner

@ribeirodanielf Could you please answer some of my code review questions?

@crankyoldgit crankyoldgit merged commit 6d3269a into crankyoldgit:master Oct 22, 2019
crankyoldgit added a commit that referenced this pull request Oct 30, 2019
_v2.7.0 (20191030)_

**[Bug Fixes]**
- auto_analyse: Fix > 64 bit send code generation. (#976)
- auto_analyse: Fix missing arguments in generated code for send64+ (#972)
- IRsendProntoDemo: Fix compile issue on ESP32 platform. (#938)
- IRMQTTServer: Fix compile error when `MQTT_ENABLE` is false. (#933)

**[Features]**
- Add Hitachi 424 bit A/C support. (#975, #980, #981)
- Experimental detailed support for `DAIKIN152` (#971)
- Mitsubishi 112bit A/C support (#947, #968)
- gc_decode: Adding Support for Decoding codes in raw code format (#963)
- Refactor to use common routines/macros to handle bit manipulation. (#934)
- Use centralised common strings. Saves ~1.5k of program space. (#946)
- Add Internationalisation (i18n) / Locale support. (#946, #955, #966)
  - `de-CH`: Swiss German. (#949, #954)
  - `de-DE`: German. (#946, #950, #952)
  - `en-AU`: English/Australian (Default locale) (#946)
  - `en-IE`: English/Irish (#946)
  - `en-UK`: English/United Kingdom (#946)
  - `en-US`: English/United States (#946)
  - `es-ES`: Spanish. (#953)
  - `fr-FR`: French. (#962)
- Port CI pipeline to PlatformIO (#936)

**[Misc]**
- Add DAIKIN128 & DAIKIN152 to `decodeToState()` (#982)
- auto_analyse: Produce better code when leader is detected. (#977)
- Coolix A/C improvements (#944)
- A/C setRaw/getRaw/stateReset() cleanup. (#967)
- Add documentation on how to use & support the i18n aspects of the library.
- Make travis checks faster. (#957)
- Translate README.md to french (#959)
- Fixed Coolix kCoolixDefaultState (#941)
- Improve generation of list of pio projects. (#940)
@crankyoldgit crankyoldgit mentioned this pull request Oct 30, 2019
crankyoldgit added a commit that referenced this pull request Oct 30, 2019
_v2.7.0 (20191030)_

**[Bug Fixes]**
- auto_analyse: Fix > 64 bit send code generation. (#976)
- auto_analyse: Fix missing arguments in generated code for send64+ (#972)
- IRsendProntoDemo: Fix compile issue on ESP32 platform. (#938)
- IRMQTTServer: Fix compile error when `MQTT_ENABLE` is false. (#933)

**[Features]**
- Add Hitachi 424 bit A/C support. (#975, #980, #981)
- Experimental detailed support for `DAIKIN152` (#971)
- Mitsubishi 112bit A/C support (#947, #968)
- gc_decode: Adding Support for Decoding codes in raw code format (#963)
- Refactor to use common routines/macros to handle bit manipulation. (#934)
- Use centralised common strings. Saves ~1.5k of program space. (#946)
- Add Internationalisation (i18n) / Locale support. (#946, #955, #966)
  - `de-CH`: Swiss German. (#949, #954)
  - `de-DE`: German. (#946, #950, #952)
  - `en-AU`: English/Australia (Default locale) (#946)
  - `en-IE`: English/Ireland (#946)
  - `en-UK`: English/United Kingdom (#946)
  - `en-US`: English/United States (#946)
  - `es-ES`: Spanish. (#953)
  - `fr-FR`: French. (#962)
- Port CI pipeline to PlatformIO (#936)

**[Misc]**
- Add DAIKIN128 & DAIKIN152 to `decodeToState()` (#982)
- auto_analyse: Produce better code when leader is detected. (#977)
- Coolix A/C improvements (#944)
- A/C setRaw/getRaw/stateReset() cleanup. (#967)
- Add documentation on how to use & support the i18n aspects of the library.
- Make travis checks faster. (#957)
- Translate README.md to french (#959)
- Fixed Coolix kCoolixDefaultState (#941)
- Improve generation of list of pio projects. (#940)
@crankyoldgit
Copy link
Owner

FYI, the changes mention above have been included in the v2.7.0 release of the library.

@CRCinAU
Copy link

CRCinAU commented Nov 1, 2019

Just to be annoying, this seems to have broken the Off function at a bare minimum.

I'm trying to debug to see what the story is - but I currently can't turn off my coolix based unit :)

@CRCinAU
Copy link

CRCinAU commented Nov 1, 2019

Ah - if I understand this right, I can no longer use ac.setpower(false) - but I have to use ac.off()

Is there any updated examples of the Coolix functionality now that I can check the rest of my code against?

@crankyoldgit
Copy link
Owner

Ah - if I understand this right, I can no longer use ac.setpower(false) - but I have to use ac.off()

In ir_Coolix.cpp:

void IRCoolixAC::off(void) { this->setPower(false); }

So all ac.off() is doing for Coolix is setPower(false) i.e. the should be interchangeable and identical.

Is there any updated examples of the Coolix functionality now that I can check the rest of my code against?

Not sure what you mean, but I think we can address this in your new issue you've logged.

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

Successfully merging this pull request may close these issues.

3 participants