Skip to content
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

Remove unnecessary subclass constructors, deprecate subclasses only setting the model #1146

Merged
merged 3 commits into from
Sep 18, 2021

Conversation

rytilahti
Copy link
Owner

@rytilahti rytilahti commented Sep 17, 2021

In order to simplify refactoring the constructor parameters in the future, this PR will remove the unnecessary constructors.
This PR also deprecates subclasses that were merely used to expose the parent device using a given model to miiocli, which is no longer necessary thanks to #1038.

The device class requires better handling for model specific properties (esp. for miotdevice which currently uses self.mapping which makes it harder to get rid of those extra classes), but that's a task for another PR.

…etting the model

* Remove constructors that just called the super class constructor with the model information
* Deprecate subclasses that were previously there to allow miiocli usage when no model parameter passing was possible
@rytilahti rytilahti requested a review from syssi September 17, 2021 14:50
@codecov-commenter
Copy link

codecov-commenter commented Sep 17, 2021

Codecov Report

Merging #1146 (ea67e3f) into master (34bcddd) will decrease coverage by 0.01%.
The diff coverage is 96.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1146      +/-   ##
==========================================
- Coverage   76.08%   76.06%   -0.02%     
==========================================
  Files          76       76              
  Lines        8961     8921      -40     
  Branches      747      748       +1     
==========================================
- Hits         6818     6786      -32     
+ Misses       1957     1951       -6     
+ Partials      186      184       -2     
Impacted Files Coverage Δ
miio/g1vacuum.py 0.00% <ø> (ø)
miio/pwzn_relay.py 60.78% <0.00%> (-1.48%) ⬇️
miio/wifispeaker.py 75.00% <ø> (-1.20%) ⬇️
miio/airdehumidifier.py 85.03% <100.00%> (-0.57%) ⬇️
miio/airfresh.py 90.90% <100.00%> (ø)
miio/airfresh_t2017.py 96.15% <100.00%> (+0.47%) ⬆️
miio/airhumidifier.py 89.89% <100.00%> (-0.06%) ⬇️
miio/airhumidifier_mjjsq.py 93.25% <100.00%> (-0.15%) ⬇️
miio/airpurifier_airdog.py 92.39% <100.00%> (+0.08%) ⬆️
miio/airqualitymonitor.py 83.62% <100.00%> (+0.28%) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34bcddd...ea67e3f. Read the comment docs.

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.

2 participants