from miio import DeviceException, gateway
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Others\Python37\lib\site-packages\miio\gateway.py", line 8, in <module>
from .utils import int_to_rgb, int_to_brightness, brightness_and_color_to_int
ImportError: cannot import name 'int_to_brightness' from 'miio.utils' (...\Python37\lib\site-packages\miio\utils.py)
When I look at the master branch of rytilahti/python-miio in the file:
python-miio/miio/utils.pythe functionint_to_brightnessis there.However when I download the source_code of the v0.5.0 release from: https://github.com/rytilahti/python-miio/archive/0.5.0.zip
And extract the files and then look into
python-miio/miio/utils.pythe functionint_to_brightnessis not there.This causes an import error when installing python-miio through
pip3 install --upgrade python-miioand then trying to import the gateway class: