Fix Abode integration needing to reauthenticate after core update (#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>
This commit is contained in:
Kareem ElFaramawi 2024-09-27 05:43:29 -04:00 committed by Franck Nijhof
parent fdd8c0969b
commit ebfd442b51
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3

View file

@ -4,8 +4,10 @@ from __future__ import annotations
from dataclasses import dataclass, field
from functools import partial
from pathlib import Path
from jaraco.abode.client import Client as Abode
import jaraco.abode.config
from jaraco.abode.exceptions import (
AuthenticationException as AbodeAuthenticationException,
Exception as AbodeException,
@ -93,6 +95,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
password = entry.data[CONF_PASSWORD]
polling = entry.data[CONF_POLLING]
# Configure abode library to use config directory for storing data
jaraco.abode.config.paths.override(user_data=Path(hass.config.path("Abode")))
# For previous config entries where unique_id is None
if entry.unique_id is None:
hass.config_entries.async_update_entry(