8000 [meta] Add device registry & device factory facilities · Issue #1117 · rytilahti/python-miio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[meta] Add device registry & device factory facilities #1117
Closed
@rytilahti

Description

@rytilahti

There is no way to initialize an implementation for the given model, forcing downstreams to hardcode imports & initialization for specific devices. There is also currently no way to obtain a list of supported models, which can be useful for other tasks.

The goal of this issue is two-fold: 1) provide a registry that allows accessing the information about supported devices and 2) provide facilities to allow initializing device-derived implementations for a given host&token combination (with optional model to skip the miIO.info query). This issue depends on #1116.

Potential signature for the factory method:

class Device:
    @classmethod
    def create(cls, host, token, model=None):
        pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0