Vedeneb / HA-SmartThings-Find

Home Assisstant custom integration to provide data from Samsung SmartThings Find, such as SmartTag locations
MIT License
30 stars 2 forks source link

Configurate/add another samsung acct will cause error #10

Closed liamlain closed 2 months ago

liamlain commented 3 months ago

i successful add my account to smartthing find,that work without any problem. when i add my wife samsung account ,it will error with my 1st added samsung account.

image

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 3:50:22 PM (1 occurrences)
Last logged: 3:50:22 PM

Error setting up entry SmartThings Find for smartthings_find
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartthings_find/__init__.py", line 33, in async_setup_entry
    await fetch_csrf(hass, session)
  File "/config/custom_components/smartthings_find/utils.py", line 215, in fetch_csrf
    hass.data[DOMAIN]["_csrf"] = csrf_token
    ~~~~~~~~~^^^^^^^^
KeyError: 'smartthings_find'
Vedeneb commented 3 months ago

As stated in the Readme, adding multiple accounts is not supported yet but I have it on the Roadmap. I'm not sure when I'll be able to implement it and test it though, as I currently have very limited free time.

In case anyone wants to help and implement it, pull requests are more than welcome.

Vedeneb commented 2 months ago

Hi, it should be possible now with the latest release. I could not test it however, because I do not have multiple samsung accounts with connected devices. So please let me know if it works for you.