Skip to content

Conversation

@rytilahti
Copy link
Owner

This will make it simple for downstream users to construct device instances for all supported devices given only the host and its token.

All device subclasses register themselves automatically to the factory. The create(host, token, model=None) class method is the main entry point to use this.

Supersedes #1328
Fixes #1117

This will make it simple for downstream users to construct device instances
for all supported devices given only the host and its token.

All device subclasses register themselves automatically to the factory.
The create(host, token, model=None) class method is the main entry point to use this.
@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2022

Codecov Report

Merging #1556 (db807c0) into master (dc55eba) will decrease coverage by 0.00%.
The diff coverage is 83.60%.

@@            Coverage Diff             @@
##           master    #1556      +/-   ##
==========================================
- Coverage   81.05%   81.05%   -0.01%     
==========================================
  Files         153      154       +1     
  Lines       15024    15073      +49     
  Branches     3680     3697      +17     
==========================================
+ Hits        12178    12217      +39     
- Misses       2599     2609      +10     
  Partials      247      247              
Impacted Files Coverage Δ
miio/devicefactory.py 80.76% <80.76%> (ø)
miio/click_common.py 52.68% <100.00%> (+0.46%) ⬆️
miio/integrations/light/yeelight/spec_helper.py 100.00% <100.00%> (ø)
.../light/yeelight/tests/test_yeelight_spec_helper.py 100.00% <100.00%> (ø)
miio/integrations/light/yeelight/yeelight.py 88.39% <100.00%> (+1.16%) ⬆️
...integrations/light/yeelight/tests/test_yeelight.py 95.31% <0.00%> (-1.28%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rytilahti rytilahti merged commit 8270db5 into master Oct 23, 2022
@rytilahti rytilahti deleted the feat/device_factory branch October 23, 2022 21:39
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.

[meta] Add device registry & device factory facilities

3 participants