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

Support for dmaker.fan.p11 #838

Closed
wants to merge 9 commits into from
Closed

Conversation

swim2sun
Copy link
Contributor

  1. Refactor FanMiot code.
  2. Support dmaker.fan.p11

@swim2sun
Copy link
Contributor Author

hi, @rytilahti I don't know how to fix the pipeline, the test is passed in my local environment 😥, could you help to review the code?

@iquix
Copy link
Contributor

iquix commented Oct 21, 2020

One reason that your new code fails to run in other environment is that
filenames in the miot_specs directory contains ':' (colon), which is not allowed in some filesystems
(I had that problem while testing your code, when I was repackaging your whl file in Windows)

Anyway, you can check error messages in the pipeline here
https://dev.azure.com/python-miio/python-miio/_build/results?buildId=567&view=results

@iquix
Copy link
Contributor

iquix commented Oct 27, 2020

I'm not sure that it will pass the test, but my suggestion is

In the miot_spec_v2.py line 203, instead of
from . import miot_specs
you can try
from miio import miot_specs

add a blank _ _ init _ _.py file in miot_specs directory, if it is needed.

@swim2sun
Copy link
Contributor Author

@iquix not working ;(

@syssi
Copy link
Collaborator

syssi commented Oct 30, 2020

________________________________________________________________________________________________________ ERROR collecting miio/tests/test_airconditioningcompanion.py _________________________________________________________________________________________________________
../.cache/pypoetry/virtualenvs/python-miio-S_yPVV_M-py3.6/lib/python3.6/site-packages/dataclasses_json/core.py:263: in _decode_generic
    res = _get_type_cons(type_)(xs)
../.cache/pypoetry/virtualenvs/python-miio-S_yPVV_M-py3.6/lib/python3.6/site-packages/dataclasses_json/core.py:307: in <genexpr>
    for x in xs)
../.cache/pypoetry/virtualenvs/python-miio-S_yPVV_M-py3.6/lib/python3.6/site-packages/dataclasses_json/core.py:200: in _decode_dataclass
    elif _is_supported_generic(field_type) and field_type != str:
../.cache/pypoetry/virtualenvs/python-miio-S_yPVV_M-py3.6/lib/python3.6/site-packages/dataclasses_json/core.py:238: in _is_supported_generic
    type_) or is_union_type(type_) or is_enum
../.cache/pypoetry/virtualenvs/python-miio-S_yPVV_M-py3.6/lib/python3.6/site-packages/dataclasses_json/utils.py:92: in _is_optional
    _hasargs(type_, type(None)) or
../.cache/pypoetry/virtualenvs/python-miio-S_yPVV_M-py3.6/lib/python3.6/site-packages/dataclasses_json/utils.py:49: in _hasargs
    res = all(arg in type_.__args__ for arg in args)
../.cache/pypoetry/virtualenvs/python-miio-S_yPVV_M-py3.6/lib/python3.6/site-packages/dataclasses_json/utils.py:49: in <genexpr>
    res = all(arg in type_.__args__ for arg in args)
E   TypeError: argument of type 'NoneType' is not iterable

It looks like you hit this issue: lidatong/dataclasses-json#232

Can be reproduced locally if you run the tests with python 3.6.

@swim2sun
Copy link
Contributor Author

dmaker.fan.p11 is supported by #850

@swim2sun swim2sun closed this Nov 16, 2020
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.

4 participants