Farfar / homeassistant-seatconnect

Seat Connect - A home assistant plugin to add integration with your car
Apache License 2.0
61 stars 14 forks source link

SeatConnect: name 'atoken' is not defined #39

Open andig opened 12 months ago

andig commented 12 months ago

I was trying https://github.com/Farfar/seatconnect 1.1.8 directly; posting here since issues are not enabled. Fails with Leon Hybrid:

...
DEBUG:seatconnect.connection:User consent is valid, no missing information for profile
DEBUG:seatconnect.connection:Client "vwg" token is missing, call to authorize the client.
DEBUG:seatconnect.connection:Trying to fetch api tokens.
DEBUG:seatconnect.connection:Verifying token for ha-5a.prd.eu.vwg.vwautocloud.net
DEBUG:seatconnect.connection:VW-Group API token verified OK.
Traceback (most recent call last):
  File "/Users/andig/htdocs/seatconnect/seatconnect/connection.py", line 710, in get_vehicles
    exp = jwt.decode(atoken, options={'verify_signature': False}).get('sub', None)
                     ^^^^^^
NameError: name 'atoken' is not defined

Looking at the code it was not obvious for me where the atoken should come from.

andig commented 12 months ago

When patching the subject next step fails as well:

raise SeatConfigException("No vehicles were found for given account!")
yoku70 commented 12 months ago

Unfortunately, after upgrading to version 2023.09 of home assistant, the integration no longer works

andig commented 12 months ago

@Farfar also see https://github.com/evcc-io/evcc/pull/9703 for what had to be changed for evcc to retrieve list of vehicles.

ahivert commented 12 months ago

fixed with release 1.1.9

RamBra commented 12 months ago

Installed release 1.1.9 and all is well. Thanks.

yoku70 commented 12 months ago

thanks farfar, with the new version everything is working perfectly again