hacf-fr / renault-api

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

--json output for status command #531

Closed slater0013 closed 2 years ago

slater0013 commented 2 years ago

Hello,

Implementing a telegraf/influxdb/grafana stack for my car based on renault-api ! Second goal is to create a charge schedule feature which is not available on DaciaSpring :(

status command gives human readable output even when --json is specified (and errors by the way)

`~# renault-api --json status charge-mode: Access is denied for this resource lock status: VNEXT an internal error occured while processing request : 403 FORBIDDEN res state: Access is denied for this resource


Battery level 49 % Last updated 2022-02-28 07:40:56 Available energy 12 kWh Range estimate 93 km Plug state PlugState.UNPLUGGED Charging state ChargeState.NOT_IN_CHARGE Time remaining 320 min Total mileage 1133.28 km GPS Latitude somewhere GPS Longitude somewhere GPS last updated 2022-02-28 07:39:23 HVAC status off ---------------- -------------------------`

Don't know if It's a bug or a feature here :)

Thanks, GS.

epenet commented 2 years ago

--json is currently not available on the status command. You can create a PR and I will happily review/merge it.

This is an example for how to check if the argument was passed: https://github.com/hacf-fr/renault-api/blob/13c784b6af09331368341c93888f1eb32c46cb19/src/renault_api/cli/renault_client.py#L160-L163