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

Library broken #177

Closed
thueske opened this issue Feb 28, 2024 · 3 comments
Closed

Library broken #177

thueske opened this issue Feb 28, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@thueske
Copy link

thueske commented Feb 28, 2024

if 'id' in fromDict and fromDict['id'] < len(self.parent.profiles):

 p-j58p0z @  [a-vwxfmm]  ~/files  weconnect-cli --username user@domain.tld --password secure list
Traceback (most recent call last):
  File "/files/.mwsoftware/python/pip/bin/weconnect-cli", line 8, in <module>
    sys.exit(main())
  File "/files/.mwsoftware/python/pip/weconnect_cli/weconnect_cli_base.py", line 223, in main
    weConnect.update(updateCapabilities=(not args.noCapabilities), updatePictures=(not args.noPictures), selective=args.selective)
  File "/files/.mwsoftware/python/pip/weconnect/weconnect.py", line 194, in update
    self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
  File "/files/.mwsoftware/python/pip/weconnect/weconnect.py", line 216, in updateVehicles
    vehicle = Vehicle(weConnect=self, vin=vin, parent=self.__vehicles, fromDict=vehicleDict, fixAPI=self.fixAPI,
  File "/files/.mwsoftware/python/pip/weconnect/elements/vehicle.py", line 133, in __init__
    self.update(fromDict, updateCapabilities=updateCapabilities, updatePictures=updatePictures, selective=selective)
  File "/files/.mwsoftware/python/pip/weconnect/elements/vehicle.py", line 227, in update
    self.updateStatus(updateCapabilities=updateCapabilities, force=force, selective=selective)
  File "/files/.mwsoftware/python/pip/weconnect/elements/vehicle.py", line 355, in updateStatus
    self.domains[domain.value][key] = className(vehicle=self, parent=self.domains[domain.value], statusId=key,
  File "/files/.mwsoftware/python/pip/weconnect/elements/charging_profiles.py", line 24, in __init__
    super().__init__(vehicle=vehicle, parent=parent, statusId=statusId, fromDict=fromDict, fixAPI=fixAPI)
  File "/files/.mwsoftware/python/pip/weconnect/elements/generic_status.py", line 38, in __init__
    self.update(fromDict=fromDict)
  File "/files/.mwsoftware/python/pip/weconnect/elements/charging_profiles.py", line 47, in update
    self.nextChargingTimer = ChargingProfiles.NextChargingTimer(parent=self, fromDict=fromDict['value']['nextChargingTimer'])
  File "/files/.mwsoftware/python/pip/weconnect/elements/charging_profiles.py", line 242, in __init__
    self.update(fromDict)
  File "/files/.mwsoftware/python/pip/weconnect/elements/charging_profiles.py", line 248, in update
    self.timer = self.parent.profiles[fromDict['id']]
KeyError: 0
@tillsteinbach
Copy link
Owner

Hi @thueske thank you for reporting. Actually I currently have no access to a car with charging profiles. could you test this fix by installing the version 0.60.2.dev1
pip install weconnect==0.60.2.dev1

@thueske
Copy link
Author

thueske commented Feb 28, 2024

Works! 💪🏼

@tillsteinbach
Copy link
Owner

Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants