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

Initial support for HUIZUO PISCES For Bedroom #868

Merged
merged 15 commits into from
Nov 27, 2020

Conversation

darckly
Copy link
Contributor

@darckly darckly commented Nov 25, 2020

I have such a lamp and wrote the basic library to support it. Please review.

miio/huizuo.py Outdated Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
2. Changing "color_temp" instead of "level" during manipulation with color temperature
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.

A quick review, this looks very straight forward, great work! Please run pre-commit run --all which will fix the linting issues automatically for you.

miio/discovery.py Outdated Show resolved Hide resolved
miio/huizuo.py Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
miio/huizuo.py Outdated

class HuizuoStatus:
def __init__(self, data):
# power = '{"siid":2,"piid":1}' values = true,false
Copy link
Owner

Choose a reason for hiding this comment

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

Could you add the complete response payload (miiocli -d) here for future reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in the file as comments (is this what you asked for? ;))

Copy link
Owner

Choose a reason for hiding this comment

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

Ah, sorry, just the json payload please, here's a good example: https://github.com/rytilahti/python-miio/blob/master/miio/airdehumidifier.py#L59

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it.
Updated by example

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.

Please also do not forget to update the README file and add a couple of tests!

miio/huizuo.py Outdated Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
@darckly
Copy link
Contributor Author

darckly commented Nov 26, 2020

Please also do not forget to update the README file and add a couple of tests!

Updated README. With the tests I have some troubles, can't get glue how to make it work, even test_get_status method.
Have no experience with unit tests yet...

miio/huizuo.py Outdated Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
miio/tests/test_huizuo.py Outdated Show resolved Hide resolved
miio/tests/test_huizuo.py Outdated Show resolved Hide resolved
miio/tests/test_huizuo.py Outdated Show resolved Hide resolved
miio/tests/test_huizuo.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@syssi syssi left a comment

Choose a reason for hiding this comment

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

LGTM!

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 too, thanks for the PR @darckly, and thanks @syssi for the reviews!

@rytilahti rytilahti merged commit f22a645 into rytilahti:master Nov 27, 2020
@rytilahti rytilahti mentioned this pull request Mar 13, 2021
xvlady pushed a commit to xvlady/python-miio that referenced this pull request May 9, 2021
* Adding Huizuo basic support

* Add huizuo.py to the repo

* Update __init__.py to the latest version

* Fix _LOGGER error

* Enabling iSort in VSCode on Save

* 1. Removed unnecessary click.argument calls
2. Changing "color_temp" instead of "level" during manipulation with color temperature

* 1. Removed Huizuo from discovery - devices are not mdns discoverable
2. Updated based on PR#868

* Re-arranged color_temp parameter for better understanding

* fixing linting issues

* Added only example of JSON payload from the lamp

* Updated README.rst, added separations

* 1. Use MiotDevice class
2. Add tests

* Fixing linting issues

* Fixing linting issue - second try...

* Processing comments from PR#868
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.

None yet

3 participants