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

Add support for all Huizuo Lamps (w/ fans, heaters, and scenes) #881

Merged
merged 32 commits into from
Jan 20, 2021

Conversation

darckly
Copy link
Contributor

@darckly darckly commented Dec 3, 2020

Inspired by previous work (PR #868), I checked specifications for all HUIZUO lamps, mentioned in the #627 [meta] list of miot-enabled devices. In general, almost all of them have a similar schema for light management, and some models have additionally a fan, heater, or predefined scenes.
Code for additional features was written based on official specifications.

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

darckly commented Dec 14, 2020

Guys, RP is ready for review, if you have a time

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.

Nice work, that's plenty of support for new devices in a single PR! 🥇 See some commentary inline.

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 Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
@darckly darckly requested a review from rytilahti December 28, 2020 15:33
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.

Looks good to me, thanks! 🎉

@syssi, what do you think?

miio/huizuo.py Outdated Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
@rytilahti rytilahti changed the title Updates for Huizuo Lamps (added devices from #627 list) Add support for all Huizuo Lamps (w/ fans, heaters, and scenes) Dec 29, 2020
@darckly
Copy link
Contributor Author

darckly commented Jan 8, 2021

I accidentally saw that you requested two small changes.
Updated.

miio/huizuo.py Outdated Show resolved Hide resolved
Updated with the latest master
@darckly
Copy link
Contributor Author

darckly commented Jan 8, 2021

Good catch!
Also pulled the changes from master to resolve the conflicts

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/huizuo.py Show resolved Hide resolved
miio/huizuo.py Outdated Show resolved Hide resolved
miio/huizuo.py Show resolved Hide resolved
@rytilahti rytilahti merged commit 27afa31 into rytilahti:master Jan 20, 2021
@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
…lahti#881)

* 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

* Updated the list of devices, updated status

* fix wrong dict concatenation

* Dict concat fix 2

* Update mapping and status output

* Fix status issue

* is_fan_reverse update

* Added fan, heater, scene supports

* Updated unit test

* Update README.rst

* Split by classes

* Cut the basic status for lamp

* pre-commit

* Processing suggestions from PR#881

* Change the function name in scene management (request from PR rytilahti#881)

* Simplifying code (removing unnecessary 'else' statements)
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.

3 participants