This meta task will track the progress and tasks to do for the next major release, which aims to simplify the use of the library for downstream users and reorganize the organically grown code base to be more maintainable.
This issue will give an overview of the planned changes, which are discussed more in-depth under their corresponding issues linked below as they get written. This meta issue shall serve as a checklist for the changelog, and is open for discussions.
Repository structure
- Motivation: all source files are currently stored in the main miio directory for historical reasons, making it messy.
- Goal: by splitting each individual implementation (integration?) and files related to it (e.g., tests and some data files) will clean up the code base.
Tasks
"Device factory"
- Motivation: there is currently no way to construct device instances just by knowing their host and the token, making it necessary for downstreams to import the classes implementing the support and initializing it separately based on model information (or simply supporting a single implementation, like done by homeassistant's vacuum platform).
- Goal: allow initializing device-derived objects by simply knowing their host and the token which simplifies downstream implementations.
Tasks
Common APIs
- Motivation: adding support for devices of the same device class (e.g., vacuums) is cumbersome as there is no well-defined API among the different implementations.
- Goal: provide device-type based base classes to make adding support for new device integrations on downstream just a matter of upgrading the python-miio.
Tasks
MiOT support
- Motivation: all new devices are using miot instead of custom protocols to control devices, so it makes sense to add first class support to the library.
- Goal: all miot supporting devices can be controlled as long as internet-connectivity is available to fetch the required schema file.
Tasks
Other changes
This meta task will track the progress and tasks to do for the next major release, which aims to simplify the use of the library for downstream users and reorganize the organically grown code base to be more maintainable.
This issue will give an overview of the planned changes, which are discussed more in-depth under their corresponding issues linked below as they get written. This meta issue shall serve as a checklist for the changelog, and is open for discussions.
Repository structure
Tasks
miio/integrations/<name>ormiio/integrations/<type of device>/<name>. [meta] Restructure integrations to their own directories #1115__getattr__tomiioto inform about the breaking changes. #1696"Device factory"
Tasks
Add manifest files to integrations that describe supported models (miIO.info-based and mDNS entries) [meta] Add integration manifest files #1116Common APIs
Tasks
miIO.infoto consolidate handling of device-specific differences inside a single integration. Add model autodetection #1038supported_featuresor similar feature flags to allow integrations specify which features is supported by the device model. This will allow moving these checks from downstream (homeassistant most prominently) to where this information belongs.@commands.MiOT support
Tasks
Other changes
ValueErrorinstead of custom exception types) Clean up raised library exceptions #1558