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

Use _mappings for all miot integrations #1349

Merged
merged 1 commit into from
Mar 7, 2022
Merged

Conversation

rytilahti
Copy link
Owner

  • Simplifies the code as there is no need to define supported models separately
    • The keys from mappings are used as supported models, this will be extended to miio devices in the future, too.
  • Mass convert miot devices to use _mappings instead of mapping
  • Add tests to verify that deprecated 'mapping' is not used and the data structure is what is expected, re Found an unsupported model 'zhimi.fan.za5' for class 'FanZA5' #1344
  • As class properties are supported only from python3.9 onwards, the supported_models is now defined in the meta class.

* Simplifies the code as there is no need to define supported models separately
  * The keys from mappings are used as supported models, this will be extended to miio devices in the future, too.
* Mass convert miot devices to use _mappings instead of mapping
* Add tests to verify that deprecated 'mapping' is not used and the data structure is what is expected, re #1344
* As class properties are supported only from python3.9 onwards, the supported_models is now defined in the meta class.
@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2022

Codecov Report

Merging #1349 (032e3b1) into master (6e5b153) will decrease coverage by 0.18%.
The diff coverage is 96.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1349      +/-   ##
==========================================
- Coverage   82.35%   82.17%   -0.19%     
==========================================
  Files         109      109              
  Lines       11789    11784       -5     
  Branches     1382     1386       +4     
==========================================
- Hits         9709     9683      -26     
- Misses       1869     1893      +24     
+ Partials      211      208       -3     
Impacted Files Coverage Δ
miio/airpurifier_miot.py 83.08% <ø> (-0.09%) ⬇️
miio/heater_miot.py 87.35% <ø> (-0.15%) ⬇️
miio/integrations/fan/zhimi/zhimi_miot.py 82.03% <ø> (-0.14%) ⬇️
...io/integrations/vacuum/dreame/dreamevacuum_miot.py 74.91% <ø> (-0.09%) ⬇️
...io/integrations/vacuum/roidmi/roidmivacuum_miot.py 89.45% <66.66%> (-0.04%) ⬇️
miio/airconditioner_miot.py 91.90% <100.00%> (ø)
miio/airhumidifier_miot.py 84.61% <100.00%> (-0.20%) ⬇️
miio/airqualitymonitor_miot.py 98.94% <100.00%> (-0.02%) ⬇️
miio/click_common.py 51.98% <100.00%> (+0.72%) ⬆️
miio/curtain_youpin.py 72.83% <100.00%> (-0.34%) ⬇️
... and 9 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 6e5b153...032e3b1. Read the comment docs.

@rytilahti rytilahti merged commit 5676303 into master Mar 7, 2022
@rytilahti rytilahti deleted the fix/add_mapping_tests branch March 7, 2022 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants