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

Getting status fails on 'hvacStatus' being 'Not a valid integer' #1237

Closed
klokop opened this issue Jun 25, 2024 · 3 comments · Fixed by #1242
Closed

Getting status fails on 'hvacStatus' being 'Not a valid integer' #1237

klokop opened this issue Jun 25, 2024 · 3 comments · Fixed by #1242

Comments

@klokop
Copy link

klokop commented Jun 25, 2024

As of about june 10th 2024, this this doesn't seem to be working anymore.

$ renault-api --version
renault-api, version 0.2.3
$ renault-api vehicles
Registration    Brand    Model            VIN
--------------  -------  ---------------  -----------------
xxxxxxx         RENAULT  MEGANE IV BREAK  xxxx

$ renault-api status
lock status: {"errors":[{"errorCode":404,"errorMessage":"There is no data for this vin and uid","errorLevel":"error","errorType":"functional"}],"error_reference":"rrt-xxxx"}
res state: The access is forbidden
Traceback (most recent call last):
  File "/usr/local/bin/renault-api", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/decorators.py", line 45, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/renault_api/cli/helpers.py", line 39, in wrapper
    asyncio.run(run_command(func, *args, **kwargs))
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/dist-packages/renault_api/cli/helpers.py", line 30, in run_command
    await func(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/renault_api/cli/__main__.py", line 178, in status
    await renault_vehicle.display_status(websession, ctx_data)
  File "/usr/local/lib/python3.9/dist-packages/renault_api/cli/renault_vehicle.py", line 164, in display_status
    await update_hvac_status(vehicle, status_table, ctx_data)
  File "/usr/local/lib/python3.9/dist-packages/renault_api/cli/renault_vehicle.py", line 362, in update_hvac_status
    response = await vehicle.get_hvac_status()
  File "/usr/local/lib/python3.9/dist-packages/renault_api/renault_vehicle.py", line 160, in get_hvac_status
    response.get_attributes(schemas.KamereonVehicleHvacStatusDataSchema),
  File "/usr/local/lib/python3.9/dist-packages/renault_api/kamereon/models.py", line 353, in get_attributes
    cast(KamereonVehicleDataAttributes, schema.load(self.data.attributes))
  File "/usr/local/lib/python3.9/dist-packages/marshmallow_dataclass/__init__.py", line 973, in load
    all_loaded = super().load(data, many=many, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/marshmallow/schema.py", line 722, in load
    return self._do_load(
  File "/usr/local/lib/python3.9/dist-packages/marshmallow/schema.py", line 909, in _do_load
    raise exc
marshmallow.exceptions.ValidationError: {'hvacStatus': ['Not a valid integer.']}

@jwatzk
Copy link

jwatzk commented Jun 28, 2024

Looks like hvacStatus type changed from integer to string in class KamereonVehicleHvacStatusData:
HVAC status information: KamereonVehicleHvacStatusData(raw_data={'hvacStatus': 'off', 'lastUpdateTime': '2024-06-28T05:14:57Z'}, lastUpdateTime='2024-06-28T05:14:57Z', externalTemperature=None, hvacStatus='off', nextHvacStartDate=None, socThreshold=None)

@epenet
Copy link
Collaborator

epenet commented Jun 28, 2024

Duplicate of #1223

@epenet
Copy link
Collaborator

epenet commented Jun 28, 2024

Sorry - this was not a duplicate of #1223. The issue there is different.

The issue here was fixed via #1242, and a new release was published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants