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

Unnecessary error output for vehicles for which the APIs do not output any data #248

Open
JHCD opened this issue Oct 14, 2021 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@JHCD
Copy link

JHCD commented Oct 14, 2021

Describe the bug
In addition to an electric vehicle, there is another vehicle with classic diesel fuel in my account. Even if it is a vehicle on a PSA platform, unfortunately no data is offered in the PSA APIs, so that various "errors" and exceptions occur.

As described here, I would like to be able to ignore not relevant vehicles.
The calls are unnecessary and the error messages only make the log file confusing.

To Reproduce
Steps to reproduce the behavior:
An account with a vehicle is required for which the API does not display any meaningful data.

Log file

2021-10-14 21:54:20,291 :: ERROR :: get_vehicle_info: ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'X-Backside-Transport': 'OK OK', 'Connection': 'close', 'Content-Type': 'application/hal+json', 'Date': 'Thu, 14 Oct 2021 21:54:20 GMT', 'X-Global-Transaction-ID': 'xxx', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Expires': '0', 'Access-Control-Expose-Headers': 'APIm-Debug-Trans-Id, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Global-Transaction-ID', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Wed, 13-Oct-2021 21:54:20 GMT, JSESSIONID=xxx; path=/, PSACountry=DE;Domain=.groupe-psa.com;Path=/'})
HTTP response body: {"uuid":"xxx","code":40400,"message":"Not Found: We didn't find the status for this vehicule."}

2021-10-14 21:54:21,395 :: ERROR :: get_vehicle_info: ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'X-Backside-Transport': 'OK OK', 'Connection': 'close', 'Content-Type': 'application/hal+json', 'Date': 'Thu, 14 Oct 2021 21:54:21 GMT', 'X-Global-Transaction-ID': 'xxx', 'Cache-Control': 'no-store, no-cache, must-revalidate, private', 'Expires': '0', 'Access-Control-Expose-Headers': 'APIm-Debug-Trans-Id, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-Global-Transaction-ID', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET', 'Set-Cookie': 'rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Wed, 13-Oct-2021 21:54:20 GMT, JSESSIONID=xxx; path=/, PSACountry=DE;Domain=.groupe-psa.com;Path=/'})
HTTP response body: {"uuid":"xxx","code":40400,"message":"Not Found: We didn't find the status for this vehicule."}

2021-10-14 21:54:21,396 :: ERROR :: status of VXEVEEHZ is None
2021-10-14 21:54:21,397 :: ERROR :: Probably can't retrieve all information from API:
Traceback (most recent call last):
  File "/psa_car_controller/charge_control.py", line 68, in process
    vehicle_status = self.psacc.vehicles_list.get_car_by_vin(self.vin).get_status()
  File "/psa_car_controller/libs/car.py", line 51, in get_status
    raise ValueError("status of {} is None".format(self.vin))
ValueError: status of VXEVEEHZ is None

Cars file

[
    {
        "abrp_name": "opel:corsae:20:50",
        "battery_power": 46,
        "brand": "C",
        "fuel_capacity": 0,
        "label": "corsa-e",
        "max_elec_consumption": 70,
        "max_fuel_consumption": 0,
        "vehicle_id": "xxx",
        "vin": "VXKUHZKX"
    },
    {
        "abrp_name": null,
        "battery_power": 46,
        "brand": "C",
        "fuel_capacity": 0,
        "label": "unknown",
        "max_elec_consumption": 70,
        "max_fuel_consumption": 30,
        "vehicle_id": "xxx",
        "vin": "VXEVEEHZ"
    }
]

UI
grafik

get_vehicleinfo
grafik

@flobz flobz added the help wanted Extra attention is needed label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants