hacf-fr / renault-api

https://readthedocs.org/projects/renault-api/
MIT License
109 stars 38 forks source link

JSON option not working? #467

Closed wivaku closed 2 years ago

wivaku commented 2 years ago

I tried: renault-api --json status

----------------  -------------------
Total mileage     xxx.xx km
GPS Latitude      xxx
GPS Longitude     xxx
GPS last updated  2022-01-10 13:36:19
HVAC status       off
----------------  -------------------

Was expecting JSON output (and -for my Dacia Spring EV car-: was hoping for more output, especially charge status)

usky73 commented 2 years ago

same for me

epenet commented 2 years ago

The JSON output doesn't apply to the "status" command. The status command talks to multiple endpoints, and formats the result automatically.

If you wish to return JSON, you should query the endpoints individually:

renault-api --json http get "/commerce/v1/accounts/{account_id}/kamereon/kca/car-adapter/v2/cars/{vin}/battery-status"
renault-api --json http get "/commerce/v1/accounts/{account_id}/kamereon/kca/car-adapter/v1/cars/{vin}/charge-mode"
renault-api --json http get "/commerce/v1/accounts/{account_id}/kamereon/kca/car-adapter/v2/cars/{vin}/cockpit"
renault-api --json http get "/commerce/v1/accounts/{account_id}/kamereon/kca/car-adapter/v1/cars/{vin}/location"
renault-api --json http get "/commerce/v1/accounts/{account_id}/kamereon/kca/car-adapter/v1/cars/{vin}/hvac-status"
epenet commented 2 years ago

We also have this PR open regarding the support for Dacia Spring: #459

epenet commented 2 years ago

Note: this is a duplicate of #188