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

[homeassistant.config_entries] Error unloading entry Sodexo NIF #4

Open
taduo opened this issue Aug 19, 2023 · 1 comment
Open

[homeassistant.config_entries] Error unloading entry Sodexo NIF #4

taduo opened this issue Aug 19, 2023 · 1 comment

Comments

@taduo
Copy link

taduo commented Aug 19, 2023

Hi,

It was not working so I've deleted the Integration entrie and re-added, as worked in the past, but this time it did not.

Home Assistant 2023.8.2
Supervisor 2023.08.1
Operating System 10.4
Frontend 20230802.0 - latest

2023-08-19 21:17:06.289 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Sodexo 2xxxxxxx0 for sodexo
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 544, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sodexo/__init__.py", line 34, in async_unload_entry
    hass.data[DOMAIN].pop(entry.entry_id)
KeyError: 'd6777b122a633a3e769083f6a664b0d3'
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sodexo/__init__.py", line 34, in async_unload_entry
    hass.data[DOMAIN].pop(entry.entry_id)
KeyError: 'd6777b122a633a3e769083f6a664b0d3'
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sodexo/__init__.py", line 34, in async_unload_entry
    hass.data[DOMAIN].pop(entry.entry_id)
KeyError: 'd6777b122a633a3e769083f6a664b0d3

And retried delete, redownload integration, restart HA, added again:

2023-08-19 21:32:13.714 DEBUG (MainThread) [custom_components.myedenred.api.myedenred] Done getting card details and their movements.
2023-08-19 21:34:08.574 DEBUG (MainThread) [custom_components.sodexo.config_flow] Starting async_step_user...
2023-08-19 21:34:21.932 DEBUG (MainThread) [custom_components.sodexo.config_flow] Starting async_step_user...
2023-08-19 21:34:21.932 DEBUG (MainThread) [custom_components.sodexo.api] Logging in...
2023-08-19 21:34:22.360 DEBUG (MainThread) [custom_components.sodexo.config_flow] Config is valid!
2023-08-19 21:34:22.362 DEBUG (MainThread) [custom_components.sodexo] async_setup
2023-08-19 21:34:22.368 DEBUG (MainThread) [custom_components.sodexo.api] Logging in...
2023-08-19 21:34:22.418 DEBUG (MainThread) [custom_components.sodexo.api] Getting account details...
2023-08-19 21:34:23.349 ERROR (MainThread) [homeassistant.components.sensor] sodexo: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 576, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 938, in async_device_update
    await self.async_update()
  File "/config/custom_components/sodexo/sensor.py", line 117, in async_update
    account = await api.getAccountDetails(token)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/sodexo/api.py", line 53, in getAccountDetails
    amount = float(data[2].strip().replace(",", "."))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: could not convert string to float: 'Cartão: ************XXX9'
@taduo taduo closed this as completed Sep 28, 2023
@taduo
Copy link
Author

taduo commented Sep 28, 2023

This is due to the new system they have I believe.
As I have an old card "Cartão Antigo" and a new card "Novo Cartão", on https://minhaconta.sodexobeneficios.pt/

/?cardSource=b
image

/?cardSource=f
image

Is this possible to fix or add to handle this?

@taduo taduo reopened this Sep 28, 2023
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

1 participant