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

Haier component update to support more protocol variations #7040

Merged
merged 2 commits into from
Jul 6, 2024

Conversation

paveldn
Copy link
Contributor

@paveldn paveldn commented Jul 4, 2024

What does this implement/fix?

Update for haier climate component. What is new:

  • Added support for self-cleaning and swing controls for hOn ACs that use single parameter control mode.
  • New parameters added to support more Haier protocol variations
  • on_status trigger added for both smartAir2 and hOn to be able to process raw AC status data. This will allow users to support features that are unique to the model.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#4020

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx

Example entry for config.yaml:

  # Example config.yaml
  climate:
    - platform: haier
      id: haier_ac
      protocol: hOn
      name: Haier AC
      status_message_header_size: 0
      control_packet_size: 10
      sensors_packet_size: 22
    on_status_message:
      then:
        - logger.log:
            level: INFO
            format: "New status message received, size=%d, subcmd=%02X%02X"
            args: [ 'data_size', 'data[0]', 'data[1]' ]

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.78%. Comparing base (4d8b5ed) to head (ba7aeed).
Report is 914 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #7040      +/-   ##
==========================================
+ Coverage   53.70%   53.78%   +0.07%     
==========================================
  Files          50       50              
  Lines        9408     9660     +252     
  Branches     1654     1704      +50     
==========================================
+ Hits         5053     5196     +143     
- Misses       4056     4140      +84     
- Partials      299      324      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -39,7 +39,7 @@ lib_deps =
bblanchon/ArduinoJson@6.18.5 ; json
wjtje/qr-code-generator-library@1.7.0 ; qr_code
functionpointer/arduino-MLX90393@1.0.0 ; mlx90393
pavlodn/HaierProtocol@0.9.28 ; haier
pavlodn/HaierProtocol@0.9.31 ; haier
Copy link
Member

Choose a reason for hiding this comment

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

Please add links to the releases so we can take a quick look over what is being changed. This is not for reviewing the library itself, but for making sure that there is no hidden malicious code in them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @jesserockz,

My library code is here: https://github.com/paveldn/HaierProtocol
Here you can see the difference between 28 and 31: https://github.com/paveldn/HaierProtocol/compare/7bab6a487cc0c77f7b0d5aba831de7580ca3bcbe..a356ba37cec091ad9c963e40f93f8f4125e8bb3c?diff=unified&w=
Changes are not that big. Most of the changes are related to tests and tools. The biggest change is I changed some headers to be able to build it for the host platform together with the UART component for the host. You can ignore everything that is not in src or include folders. As you can see in the library.json only those folders are included in the library itself.

Let me know if I can help or if you have questions.

Copy link
Member

Choose a reason for hiding this comment

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

Thank for that. Your diff url is backwards btw =)

Not required, but would be nice if you tagged the repo at the point of the package release too so it is clear to anyone else who wants to inspect. Otherwise they will not know what commit to look at.

@esphome esphome bot marked this pull request as draft July 5, 2024 01:36
@esphome
Copy link

esphome bot commented Jul 5, 2024

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@paveldn paveldn marked this pull request as ready for review July 5, 2024 05:22
@esphome esphome bot requested a review from jesserockz July 5, 2024 05:22
@jesserockz jesserockz merged commit ddaa846 into esphome:dev Jul 6, 2024
35 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 8, 2024
@paveldn paveldn deleted the haier_update branch July 17, 2024 19:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants