Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Convert codebase to pass mypy checks #1046

Merged
merged 6 commits into from
May 24, 2021
Merged

Convert codebase to pass mypy checks #1046

merged 6 commits into from
May 24, 2021

Conversation

rytilahti
Copy link
Owner

@rytilahti rytilahti commented May 12, 2021

This involves changes throughout the code base to make mypy happy,
which involved some minor refactoring in parts of the codebase.

Also included:

  • Adapts the CI & the pre-commit hooks to use mypy.
  • ViomiVacuum consumable container shares now more code with vacuumcontainer's impl
  • Gateway discovery no more advertises pyxiaomigateway
  • Yeelight initialization doesn't put up a warning about python-yeelight recommendation

Ping @syssi, @starkillerOG - it would be great if you'd give this PR a try to make sure it doesn't break anything of yours :-)

@rytilahti rytilahti requested a review from syssi May 12, 2021 02:09
@rytilahti rytilahti force-pushed the janitor/mypyfication branch 2 times, most recently from 59a0a4c to 5588c25 Compare May 17, 2021 15:03
@codecov-commenter
Copy link

codecov-commenter commented May 17, 2021

Codecov Report

Attention: Patch coverage is 66.43836% with 49 lines in your changes missing coverage. Please review.

Project coverage is 75.42%. Comparing base (dd0124c) to head (56c2a1e).
Report is 385 commits behind head on master.

Files Patch % Lines
miio/cooker.py 66.66% 10 Missing ⚠️
miio/viomivacuum.py 33.33% 10 Missing ⚠️
miio/gateway/gatewaydevice.py 25.00% 5 Missing and 1 partial ⚠️
miio/miioprotocol.py 50.00% 5 Missing ⚠️
miio/airhumidifier.py 0.00% 2 Missing and 1 partial ⚠️
miio/miot_device.py 70.00% 3 Missing ⚠️
miio/chuangmi_plug.py 33.33% 1 Missing and 1 partial ⚠️
miio/fan.py 33.33% 2 Missing ⚠️
miio/pwzn_relay.py 60.00% 2 Missing ⚠️
miio/vacuumcontainers.py 66.66% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1046      +/-   ##
==========================================
- Coverage   75.45%   75.42%   -0.04%     
==========================================
  Files          73       73              
  Lines        8357     8359       +2     
  Branches      743      744       +1     
==========================================
- Hits         6306     6305       -1     
- Misses       1868     1870       +2     
- Partials      183      184       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

rytilahti added 6 commits May 24, 2021 16:48
This involves changes throughout the code base to make mypy happy,
which involved some minor refactoring in parts of the codebase.

This PR also adapts the CI & the pre-commit hooks to use mypy.
@rytilahti rytilahti force-pushed the janitor/mypyfication branch from 24b3977 to 56c2a1e Compare May 24, 2021 14:49
@rytilahti rytilahti merged commit 6453bfe into master May 24, 2021
@rytilahti rytilahti deleted the janitor/mypyfication branch May 24, 2021 14:58
@starkillerOG
Copy link
Contributor

Sorry for taking so long.
I just tested this PR, and it seems to work just fine with respect to the gateway.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants