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

Installation error #54

Open
Grams49 opened this issue May 28, 2024 · 5 comments
Open

Installation error #54

Grams49 opened this issue May 28, 2024 · 5 comments

Comments

@Grams49
Copy link

Grams49 commented May 28, 2024

Hello,
When I try to install the integration I get this error:

Error
The configuration flow could not be loaded: {“message”: “Invalid handler specified”}

Recorder: homeassistant.config_entries
Source: config_entries.py:2684
First occurred: 16:01:00 (5 occurrences)
Last recorded: 16:27:29

Error occurred loading flow for integration cupra_we_connect: cannot import name 'imgToASCIIArt' from 'weconnect_cupra.util' (/usr/local/lib/python3.12/site-packages/weconnect_cupra/util.py)

Thanks for your help!

@daernsinstantfortress
Copy link
Owner

daernsinstantfortress commented May 28, 2024

What version of HA are you using and how are you installing the integration?

@Grams49
Copy link
Author

Grams49 commented May 28, 2024

Thank you for your reply.

My HA version:
Core
2024.5.5
Supervisor
2024.05.1
Operating System
12.3
User interface
20240501.1

I just installed “Volkswagen We Connect” then uninstalled the module and since then the integration (cupra) has been working fine.

@Grams49
Copy link
Author

Grams49 commented May 28, 2024

I get this type of error when configuring the vehicle (after adding the login and password).
My vehicle is a Cupra Formentor, maybe that's why? I tried :)

Enregistreur: homeassistant.config_entries
Source: config_entries.py:584
S'est produit pour la première fois: 17:17:10 (2 occurrences)
Dernier enregistrement: 17:17:50

Error setting up entry Cupra We Connect for cupra_we_connect
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 584, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/cupra_we_connect/__init__.py", line 46, in async_setup_entry
    await hass.async_add_executor_job(_we_connect.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/weconnect_cupra.py", line 176, in update
    self.__api.update(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/api.py", line 39, in update
    self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/api.py", line 55, in updateVehicles
    vehicle = Vehicle(
              ^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/vehicle.py", line 98, in __init__
    self.update(fromDict, updateCapabilities=updateCapabilities, updatePictures=updatePictures, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/vehicle.py", line 207, in update
    self.updateStatus(updateCapabilities=updateCapabilities, force=force, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/vehicle.py", line 248, in updateStatus
    self.assign_properties_to_domain(
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/vehicle.py", line 127, in assign_properties_to_domain
    self.domains[domain_value][settings_key] = klass(vehicle=self,
                                               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/charging_status.py", line 32, in __init__
    super().__init__(vehicle=vehicle, parent=parent, statusId=statusId, fromDict=fromDict, fixAPI=fixAPI)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/elements/generic_status.py", line 36, in __init__
    self.update(fromDict=fromDict)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/charging_status.py", line 48, in update
    chargePower_kW = float(fromDict['value']['chargePower_kW'])
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'
Enregistreur: weconnect_cupra
Source: /usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/api.py:73
S'est produit pour la première fois: 17:16:57 (1 occurrences)
Dernier enregistrement: 17:16:57

Failed to retrieve data for VIN VSSXXXX7RXXXXXXXX: Could not fetch data. Status Code was: 504

I have anonymized the VIN.

@Grams49
Copy link
Author

Grams49 commented May 31, 2024

Here is the modified code for charging_status.py:

# File: weconnect_cupra/api/cupra/elements/charging_status.py

class ChargingStatus(GenericStatus):
    def update(self, fromDict=None):
        super().update(fromDict=fromDict)
        if fromDict is not None:
            chargePower_kW = fromDict['value'].get('chargePower_kW')
            if chargePower_kW is not None:
                self.chargePower_kW = float(chargePower_kW)
            else:
                self.chargePower_kW = 0.0  # or another appropriate default value

Do you think it's possible to make this correction?

@xxMario1995xx
Copy link

I have the same Issue... But I don't know how to find those Files to edit....

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.cupra_we_connect.config_flow
Quelle: custom_components/cupra_we_connect/config_flow.py:75
Integration: cupra_we_connect (Dokumentation, Probleme)
Erstmals aufgetreten: 23:13:30 (1 Vorkommnisse)
Zuletzt protokolliert: 23:13:30

Unexpected exception during setup
Traceback (most recent call last):
  File "/config/custom_components/cupra_we_connect/config_flow.py", line 75, in async_step_user
    info = await validate_input(self.hass, user_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/cupra_we_connect/config_flow.py", line 51, in validate_input
    await hass.async_add_executor_job(we_connect.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/weconnect_cupra.py", line 176, in update
    self.__api.update(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/api.py", line 39, in update
    self.updateVehicles(updateCapabilities=updateCapabilities, updatePictures=updatePictures, force=force, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/api.py", line 55, in updateVehicles
    vehicle = Vehicle(
              ^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/vehicle.py", line 98, in __init__
    self.update(fromDict, updateCapabilities=updateCapabilities, updatePictures=updatePictures, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/vehicle.py", line 207, in update
    self.updateStatus(updateCapabilities=updateCapabilities, force=force, selective=selective)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/vehicle.py", line 248, in updateStatus
    self.assign_properties_to_domain(
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/vehicle.py", line 127, in assign_properties_to_domain
    self.domains[domain_value][settings_key] = klass(vehicle=self,
                                               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/charging_status.py", line 32, in __init__
    super().__init__(vehicle=vehicle, parent=parent, statusId=statusId, fromDict=fromDict, fixAPI=fixAPI)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/elements/generic_status.py", line 36, in __init__
    self.update(fromDict=fromDict)
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/elements/charging_status.py", line 48, in update
    chargePower_kW = float(fromDict['value']['chargePower_kW'])
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'

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

No branches or pull requests

3 participants