Closed ColinRobbins closed 2 years ago
Hi. I installed using
python3 setup.py install
I then ran
python3 examples/allVehicles.py -u XX -p XX
and got an error PIL
was not installed.
I installed PIL
, via pip3 then got an error with ascii_magic
.
I intalled that via pip3 and it all worked.
I also note that where using it in Home Assistant, ascii_magic
had to be added: https://github.com/mitch-dc/volkswagen_we_connect_id/blob/main/custom_components/volkswagen_we_connect_id/manifest.json although not using it directly.
Its not a big deal but something is not quite right. I agree this PR may not be the right soluion.
I don’t know how this manifest.json works. Maybe you can do it like in pip with weconnect[Images]==0.45.1
regarding the PIL error I need to take a look. The intend is that there is no error but the images should be omitted.
Hi, the issue is, the integration does not use the images feature, so should not need to pull image support in.
Hmmm, and it should not be necessary. Ok I will have a look later. This sounds like it may be a bug.
I think the issue are functions like toBool
in util.py
.
$ python3 examples/allVehicles.py -u XXX -p ZZZ
Traceback (most recent call last):
File "/home/colin/github/WeConnect-python/examples/allVehicles.py", line 3, in <module>
from weconnect import weconnect
File "/usr/local/lib/python3.9/site-packages/weconnect-develop-py3.9.egg/weconnect/weconnect.py", line 14, in <module>
from weconnect.elements.vehicle import Vehicle
File "/usr/local/lib/python3.9/site-packages/weconnect-develop-py3.9.egg/weconnect/elements/vehicle.py", line 10, in <module>
from weconnect.elements.generic_settings import GenericSettings
File "/usr/local/lib/python3.9/site-packages/weconnect-develop-py3.9.egg/weconnect/elements/generic_settings.py", line 7, in <module>
from weconnect.addressable import AddressableLeaf, ChangeableAttribute, AliasChangeableAttribute
File "/usr/local/lib/python3.9/site-packages/weconnect-develop-py3.9.egg/weconnect/addressable.py", line 10, in <module>
from weconnect.util import toBool, imgToASCIIArt, robustTimeParse, ExtendedWithNullEncoder
File "/usr/local/lib/python3.9/site-packages/weconnect-develop-py3.9.egg/weconnect/util.py", line 14, in <module>
from PIL import Image # type: ignore
ModuleNotFoundError: No module named 'PIL'
Can you check again?
Yes that works. Thank you. I'll close the PR.
Hey, thanks for your PR, but the dependencies are there: https://github.com/tillsteinbach/WeConnect-python/blob/main/image_extra_requirements.txt You can install WeConnect-python with or without support for images.