-
-
Notifications
You must be signed in to change notification settings - Fork 568
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
Initial support for lumi.curtain.hagl05 #851
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, looks good! I left some minor changes that should be addressed prior merging this.
Hi! Thanks for reviewing the code! Changes have been made. |
Well done! |
Didn't notice the boolean suggestion, very good idea! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more comments, mostly:
- No newlines before ending the docstring, if it is a one-liner. Docstrings should end with a dot and be descriptive.
- Return boolean values as booleans for status container properties.
- All functionality should return something, simply add
return
s for commands, this way the library users can access the response payload if they wish to do so.
edit: Also, please update README.md accordingly!
lumi.curtain.hagl05 curtain: one-liner comments, returns for the setters Co-authored-by: Teemu R. <tpr@iki.fi>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for the PR, let's merge it! 🥇
Small fix required (no reason to make new PR for this): manual_enabled -> is_manual_enabled in the _MAPPING. P.S. I am currently working on supporting HA. |
@in7egral I would be happy about another PR nevertheless. :-) |
I'm going to add unit tests today before PR. |
I am still fighting with HomeKit support which will help me figure out how to properly work with this device. |
Sorry for bringing up an old PR on somewhat unrelated topic. Do you know if there is a component for Home Assistant, which uses this library and supports this curtain? If there is not, maybe you can point in the right direction? |
I have no immediate plans to support this type of curtain in HA. And it’s not that easy. HA has strict rules for styling code and styling plugins (and it's very cool), but I'm not a big python expert. I connected the curtain with HomeKit with this plug-in and I'm happy. The plugin itself will recieve a new version - some fixes and improvements, test patterns, etc. P.S. If I can help with HA - contact me please. |
* Added support for the Xiaomi Smart Curtain Motor (Wi-Fi version) * module refactoring: Xiaomi Smart Curtain Motor * lumi.curtain.hagl05 curtain: @rytilahti suggestions applied * fixed parameter naming * lumi.curtain.hagl05 curtain: removed unnecessary DeviceError processing * lumi.curtain.hagl05 curtain: added hints for the ValueError * lumi.curtain.hagl05 curtain: added boolean types for two-states parameters * Apply suggestions from code review lumi.curtain.hagl05 curtain: one-liner comments, returns for the setters Co-authored-by: Teemu R. <tpr@iki.fi> * lumi.curtain.hagl05: updated Readme, docstrings updated, returns for setters * lumi.curtain.hagl05 curtain: refactoring with code checks Co-authored-by: Teemu R. <tpr@iki.fi>
lumi.curtain.hagl05 is codename for the "Xiaomiyoupin Curtain Controller (Wi-Fi)" (sometimes referred as Aqara A1)
I finished a couple of tests on my own device (sorry, no python tests for this version yet).