-
-
Notifications
You must be signed in to change notification settings - Fork 566
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
Refactor & improve support for gateway devices #924
Conversation
@rytilahti I finally got around to implementing the changes as you suggested in your rivieuw: #782 (comment) I think this is now ready for merging. |
@rytilahti can you merge this? If this is merged I can continue with implementing the subdevices in HomeAssistant (such as the switches and relays etc.) |
Add command to set vibration sensitivity of vibration sensor
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.
Sorry for the delay @starkillerOG, this looks great! Just a couple of very minor changes and then we can merge this.
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.
Sorry, I forgot that the checkers will require the import anyway. Here's what you can do to fix that flake8 error about the gateway class.
Btw, if you run pre-commit install
the repository, the linting checks will be run locally before you can even commit (makes it faster than waiting for CI to check for isort/black/others) :-)
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Teemu R. <tpr@iki.fi>
Thanks for the tip, but I use Github Desktop, Not that fimiliar with the github command line yet. nvm, just saw that it also works with Github Desktop, that is very nice!!! |
@rytilahti all checks now pass |
Great! Thanks for your patience and hard work on refactoring this! 🎉 |
* re-structure gateway devices * re-apply already merged commit * black formatting * fix isort and flake8 * fix black * fix issort * fix magnet sensor zigbee id * update zigbee ids * vibration sensitivity Add command to set vibration sensitivity of vibration sensor * fix issort * simplify subdevice_model_map * remove unnesesarry comment * move imports to the top * fix black * Update miio/gateway/devices/subdevice.py Co-authored-by: Teemu R. <tpr@iki.fi> * Update miio/gateway/devices/subdevice.py Co-authored-by: Teemu R. <tpr@iki.fi> * fix black * fix isort and flake8 wanting to move above GatewayException class Co-authored-by: Teemu R. <tpr@iki.fi>
Due to a merge conflict PR #782 was closed, this is the continueation of that PR.
Restructure the gateway devices to put everything with simular API together.
This PR also creates the base classes for switches and light bulbs, so all known models are now fully supported, although some models have not been tested (they are assummed to have simular API calls as devices that are closely related).
This PR also adds subdevice support for the lumi.gateway.mgl03 and is a first step towards subdevice support for the lumi.gateway.mieu01