-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Fix Abode integration needing to reauthenticate after core update #123035
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Hey there @shred86, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
90682d1
to
058d46e
Compare
Isn't it possible to store this in |
Another possibility -
I'm not a fan of the approach proposed, as it violates custodial norms. I think I agree it would be preferable for HA to somehow override the data path so Is it possible for the container-based deployment to configure |
I am not 100% sure on this, but we always want files from integrations to exist in the |
Well, these files are "data", distinct from "config". I honestly wouldn't expect them to be backed up or transferred from host to host. When I think of Mozilla Firefox, it syncs config, but it doesn't include in that config the session cookies - those are kept local to a browser instance (I think). But it sounds like HA doesn't have a distinct concept for data separate from config. Since these files essentially contain credentials to connect to the API as that user, I'd be concerned about copying them and saving them as config. |
I'll discuss with the core team on what is best here, so we don't break other systems. Thanks for your input :) |
Would it be possible to add an option for jaraco.abode to set a custom path via the Python API? I think that would be the best way forward here :) |
With import jaraco.abode.config
jaraco.abode.config.paths.override(user_data=pathlib.Path('/alt/user/data/path')) Note that the value must be a If you want to implement that behavior early (prior to adopting import jaraco.abode.config
# TODO: replace with `.override(user_data=)` on jaraco.abode 6.2; home-assistant/core#123035
vars(jaraco.abode.config.paths).update(user_data_path=pathlib.Path('/alt/user/data/path')) |
Let me directly try to give a stab at upgrading the library |
+1 |
With |
On 6.2, this doesn't seem to update correctly since In [1]: from jaraco.abode import config
In [2]: from pathlib import Path
In [3]: config.paths.override(user_data=Path('/config/Abode'))
In [4]: config.paths.user_data
Out[4]: PosixPath('/home/krx/.local/share/Abode')
In [5]: config.paths.user_data_path
Out[5]: PosixPath('/home/krx/.local/share/Abode')
In [6]: vars(config.paths)['user_data_path']
Out[6]: PosixPath('/config/Abode') If I've understood you correctly, adding this call in jaraco.abode.config.paths.override(user_data=Path(hass.config.path('Abode'))) |
I'd swear I tested that, but it seems I've somehow tricked myself into thinking I had when in fact I hadn't. I've filed jaraco/jaraco.abode#37 to track.
Yes, that's the intention. |
I have added this PR to my todo list, so when that bug gets fixed I will try to open a PR for it |
058d46e
to
1d45569
Compare
…23035) * bump jaraco.abode to 6.2.1 * update abode user_data path to HA config * Move abode config call out of try block --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
…me-assistant#123035) * bump jaraco.abode to 6.2.1 * update abode user_data path to HA config * Move abode config call out of try block --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Proposed change
The
jaraco.abode
library being used for the Abode integration usesjaraco.net.http.cookies.ShelvedCookieJar
to save the session information to disk (session ID and UUID). When these are available and unexpired, subsequent logins do not need to do MFA to be able to request an oauth token.Currently, that library saves the session information to
~/.local/share/Abode/
in the core container, which will not persist if the container is recreated, causing the Abode login to fail when launched again. This fix moves the session information to home assistant's config directory and creates a symlink to it where the library expects to find it.Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: