tillsteinbach / WeConnect-python

Python API for the Volkswagen WeConnect Services
MIT License
108 stars 30 forks source link

API Change causes exception #12

Closed tillsteinbach closed 3 years ago

tillsteinbach commented 3 years ago

Due to a new element in the API the retrieval of information is not possible anymore

To Reproduce Can be reproduced with ID.3 vehicles

Expected behavior No exception to be thrown

Logs log taken from WeConnect-mqtt: WARNING:weconnect:/vehicles/AAABBBCCCCDDD11122234: Unknown attribute chargeMode with value {'preferredChargeMode': 'manual'} ERROR:paho.mqtt.client:Caught exception in on_connect: 'chargeMode' Exception in thread Thread-2: Traceback (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/local/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3452, in _thread_main self.loop_forever(retry_first_connection=True) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1779, in loop_forever rc = self.loop(timeout, max_packets) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1181, in loop rc = self.loop_read(max_packets) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1572, in loop_read rc = self._packet_read() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2310, in _packet_read rc = self._packet_handle() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2942, in _packet_handle return self._handle_connack() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3029, in _handle_connack self.on_connect( File "/usr/local/lib/python3.9/site-packages/weconnect_mqtt/weconnect_mqtt.py", line 350, in on_connect_callback self.updateWeConnect() File "/usr/local/lib/python3.9/site-packages/weconnect_mqtt/weconnect_mqtt.py", line 282, in updateWeConnect self.weConnect.update(updateCapabilities=self.updateCapabilities, updatePictures=self.updatePictures) File "/usr/local/lib/python3.9/site-packages/weconnect/weconnect.py", line 403, in update self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force) File "/usr/local/lib/python3.9/site-packages/weconnect/weconnect.py", line 440, in updateVehicles vehicle = Vehicle(weConnect=self, vin=vin, parent=self.vehicles, fromDict=vehicleDict, File "/usr/local/lib/python3.9/site-packages/weconnect/elements.py", line 57, in init__ self.update(fromDict, updateCapabilities=updateCapabilities, updatePictures=updatePictures) File "/usr/local/lib/python3.9/site-packages/weconnect/elements.py", line 155, in update self.updateStatus(updateCapabilities=updateCapabilities, force=force) File "/usr/local/lib/python3.9/site-packages/weconnect/elements.py", line 247, in updateStatus self.statuses[status] = keyClassMap[status](vehicle=self, parent=self.statuses, statusId=status, KeyError: 'chargeMode'

tillsteinbach commented 3 years ago

Will try to push a fix as soon as possible

tillsteinbach commented 3 years ago

Fixed with 0.12.2