Add support for viomi.waterheater.e1 devices - #834
Conversation
rytilahti
left a comment
There was a problem hiding this comment.
Thanks for the PR! A brief initial review: please add an example response, follow the python naming conventions (foo_bar instead of camelcased fooBar). The property names should be descriptive instead of using the naming used by the protocol itself.
|
@rytilahti Thanks for great code review! I will make the code better as you request. |
|
@Zuz666 , any progress on this pr? 🙂 |
@rytilahti, yep, just check the latest commits! |
rytilahti
left a comment
There was a problem hiding this comment.
Thanks for the update! I added a couple of more comments. Could you also do the following:
- Add an entry to README.md
- Move the code to be under
miio/integrations/heater/viomiwaterheater/- there are other heaters so we may have a common API among all of them at some point :-)
@rytilahti Job done! Please perform a code review. |
rytilahti
left a comment
There was a problem hiding this comment.
Looking good, I added a couple of very minor changes.
Could you also please add at least tests to the container functionality (see #1174 (review))?
Some code for testing done but how can I run this test? Newbie to python. ))) |
|
Simply execute You can also run the linting tests locally ( |
…terheater.e1) - Modernize device integration under miio.integrations.viomi.waterheater - Update ViomiWaterHeaterStatus to use @sensor and @setting decorators - Add container unit tests based on DummyDevice - Simplify control methods and error handling - Register device export in miio.__init__ and README.md
|
Hi @rytilahti, I have fully rebased this PR on top of the current Here is a summary of the updates:
Please take a look and let me know if anything else is needed! |
|
Pushed a fix for the CI linting issues (pre-commit hooks: docstring placement, zip strict parameter, and f-strings). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #834 +/- ##
==========================================
+ Coverage 84.31% 84.45% +0.13%
==========================================
Files 201 204 +3
Lines 20656 20836 +180
Branches 1121 1126 +5
==========================================
+ Hits 17417 17597 +180
Misses 3047 3047
Partials 192 192 ☔ View full report in Codecov by Harness. |
|
Added unit tests for |
|
Also added a computed |
Just added basic support for 'Viomi Electric Water Heater' devices (viomi.waterheater.e1*): power on/off + status (retrieve properties). Fully tested on real device, works fine.