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 initial zhimi.humidifier.ca6 support #1885

Merged
merged 15 commits into from
May 4, 2024
Merged

Conversation

smmoroz
Copy link
Contributor

@smmoroz smmoroz commented Jan 9, 2024

Adds support for zhimi.humidifier.ca6 and status container descriptors for airhumidifier_miot.
Closes #1884.

Copy link

codecov bot commented Jan 9, 2024

Codecov Report

Attention: Patch coverage is 91.97080% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 81.58%. Comparing base (8643a57) to head (252e49c).
Report is 3 commits behind head on master.

Files Patch % Lines
...ntegrations/zhimi/humidifier/airhumidifier_miot.py 86.70% 13 Missing and 8 partials ⚠️
...mi/humidifier/tests/test_airhumidifier_miot_ca6.py 99.12% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1885      +/-   ##
==========================================
+ Coverage   81.41%   81.58%   +0.16%     
==========================================
  Files         193      194       +1     
  Lines       18636    18857     +221     
  Branches     4045     4114      +69     
==========================================
+ Hits        15173    15384     +211     
- Misses       3180     3185       +5     
- Partials      283      288       +5     

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

@smmoroz
Copy link
Contributor Author

smmoroz commented Jan 13, 2024

Dear @rytilahti and @syssi , first of all, I have to say that I'm not a professional software developer for a long time. Thus please excuse me for my way of working with GitHub (branching, PR, etc.)

In addition to this PR I have implemented initial support of zhimi.humidifier.ca6 in home-assistant/core in this branch. All zhimi.humidifier.ca6 features work well. Below are a couple of screenshots.

But I can't make PR to home-assistant/core because of the manifest.json. I have to use custom requirements (see below), which I can't commit to home-assistant/core repo:

  "requirements": ["construct==2.10.68", "micloud==0.5", "git+https://github.com/smmoroz/python-miio.git#python-miio==0.6.0"],

So, I don't know how to proceed. Maybe you can backport my changes and release 0.5.13 of python-miio?

Here are a few screenshots from HA:

CleanShot 2024-01-13 at 11 12 11@2x
CleanShot 2024-01-13 at 11 13 46@2x

Copy link
Owner

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

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

Sorry for the late reply, but instead of creating a new file to maintain, it would be better to either use genericmiot or adapt the airhumidifer_miot as necessary.

@smmoroz
Copy link
Contributor Author

smmoroz commented Feb 18, 2024

Sorry for the late reply, but instead of creating a new file to maintain, it would be better to either use genericmiot or adapt the airhumidifer_miot as necessary.

I moved CA6 support to airhumidifer_miot file. Please review.

I also noticed that in order to support status command of miiocli, I need to implement @sensor and @setting. This is not yet done. BTW, status doesn't work even for CA4 devices.

@smmoroz
Copy link
Contributor Author

smmoroz commented Feb 18, 2024

I added @sensor and @setting to AirHumidifierMiot and its subclasses. But I'm not sure I did it in the most elegant way, because I had to use embed method in subclasses.

@tomaszzmuda
Copy link

+1

1 similar comment
@TB-SE
Copy link

TB-SE commented Mar 12, 2024

+1

@rytilahti
Copy link
Owner

Looks much better, thanks. I'm wondering, are these devices so different that they wouldn't fit in the same implementation class?

Copy link
Owner

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

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

LGTM, this can be revisited and polished if need to be, thanks @smmoroz! 👍

@rytilahti rytilahti merged commit 35b1ab2 into rytilahti:master May 4, 2024
23 of 24 checks passed
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.

Add support for Smartmi Evaporative Humidifier 3 (zhimi.humidifier.ca6) support to xiaomi_miio
4 participants