python-miio
python-miio copied to clipboard
Add common API for constructing device instances, improve introspection
New class methods in Device:
- all_supported_models() to return a dictionary model=>implementation class
- class_for_model(model: str) to return implementation class for the given model
- create(host: str, token: str, model: Optional[str]) to create a device instance
New cli commands:
-
miiocli supported-models
will print a list of supported models
TBD:
- [x] Tests
- [ ] Extract the factory into its own class
- [ ] Update README and docs for changes
Fixes #1117