-
Notifications
You must be signed in to change notification settings - Fork 52
chore: fix mypy errors #34
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
Conversation
|
a few things:
A whole lot of : Invalid index type "str" for "RoborockEnum"; expected type "Union[int, slice]" Perhaps we switch to using a backpropegated version of StrEnum from python 3.11? Then Variable "roborock.code_mappings.RoborockDockTypeCode" is not valid as a type finally, something with the superclasses for roborockmqttclient are wrong, it works runtime, but gives warnigns in ide: roborock/cloud_api.py:123: error: "RoborockMqttClient" has no attribute "_keepalive"; maybe "_check_keepalive"? roborock/cloud_api.py:128: error: "_check_keepalive" undefined in superclass |
|
Yeah - I'll probably look at some of the HA ones
I meant using our current version, but just importing StrEnum from a backpropagated package - adds another dependency but may have better luck?
Any idea why it doesn't think check_keepalive or even just _keepalive are valid in the superclass? I can see them, but something about the inheritance is weird |
|
@humbertogontijo This should be good to go as long as you don't have any reviews. I was able to fix some instances of the 'code' is not a type, but just setting the type hint to roborock enum and then check the name. But I couldn't fix the ones in the dataclasses without rewriting parts of the as dict or from dict functions. So I just ignored them for now. Regardless, this gives us a rather good foundation. I have tested it locally with no problems. |
Trying to get mypy fully functioning so it can be a step in our ci pipeline.
mypy checks and makes sure we are not making typing errors