G-Two / subarulink

A python package for interacting with Subaru STARLINK remote vehicle services.
Apache License 2.0
82 stars 14 forks source link

Multiple vehicles in account but VIN not specified in config #54

Closed mpalermo73 closed 2 years ago

mpalermo73 commented 2 years ago

Hey!

I'm getting:

2022-03-24 08:29:45,439 - subarulink - ERROR - Multiple vehicles in account but VIN not specified in config or command line

however:

-> % cat ~/.subarulink.cfg
{
    "country": "USA",
    "username": "my.email@gmail.com",
    "password": "53cr3tp455w0rd",
    "pin": "1234",
    "device_name": "subarulink",
    "save_creds": "Y",
    "device_id": 1628400000,
    "default_vin": "JF2XXXXX1XX123456",
    "remote_start_preset": "FULL HEAT"
}

Obviously I've masked out sensitive values, but that is otherwise my config. I'm no sure how to specify key/value on the command line as it's not mentioned in --help. My checkout is current:

-> % git pull
Already up to date.

-> % git log | head -n1
commit e60d054cb9b68cd6898fa4b7a53cae108188992f

-> % python --version
Python 3.9.5

I also really only have one car in my account Screen Shot 2022-03-24 at 8 35 52 AM

THANK YOU! M.

mpalermo73 commented 2 years ago

Little more details

I ran it a couple more times, and also added -v 2. It is indeed returning current json, and even. I ten ran it without verbose and it hung and died

-> % ./subarulink.py status
Traceback (most recent call last):
  File "/Users/username/GIT/subarulink/./subarulink.py", line 10, in <module>
    sys.exit(main())
  File "/Users/username/GIT/subarulink/subarulink/app/cli.py", line 674, in main
    LOOP.run_until_complete(cli.single_command(args.command, args.vin, cli.config))
  File "/Users/username/.pyenv/versions/3.9.5/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/Users/username/GIT/subarulink/subarulink/app/cli.py", line 489, in single_command
    if await self._connect(interactive=False, vin=vin):
  File "/Users/username/GIT/subarulink/subarulink/app/cli.py", line 373, in _connect
    if await self._ctrl.connect():
  File "/Users/username/GIT/subarulink/subarulink/controller.py", line 88, in connect
    self._parse_vehicle(vehicle)
  File "/Users/username/GIT/subarulink/subarulink/controller.py", line 801, in _parse_vehicle
    vin = vehicle["vin"].upper()
TypeError: 'NoneType' object is not subscriptable
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x1066fef10>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x1066d1f40>, 60.56923537)]']
connector: <aiohttp.connector.TCPConnector object at 0x1066fe040>

But now it's running OK.

 'subscriptionFeatures': ['SAFETY', 'Retail', 'REMOTE'],
 'subscriptionStatus': 'ACTIVE'}
Command 'status' completed for Crosstrek

(massively truncated, of course)

¯\(ツ)

I guess them?

M.

G-Two commented 2 years ago

@mpalermo73 It looks like this was a combination of something going wrong on Subaru's end (reporting that you have zero vehicles) combined with a logic bug in the CLI code. I can't do anything about the Subaru side, but I did fix the bug in the CLI, so you'll get a correct error message the next time it happens.