Skip to content

Commit

Permalink
Forcing state_yaml path to config directory
Browse files Browse the repository at this point in the history
Ideally, we'd use the home assistant store classes but the state is
managed via the pyhilo package.
  • Loading branch information
valleedelisle committed Jan 4, 2022
1 parent 6991896 commit 9a3618f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/hilo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ async def async_setup_entry( # noqa: C901
current_options = {**entry.options}
log_traces = current_options.get(CONF_LOG_TRACES, DEFAULT_LOG_TRACES)
scan_interval = current_options.get(CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL)
state_yaml = hass.config.path("hilo_state.yaml")

websession = aiohttp_client.async_get_clientsession(hass)

Expand All @@ -124,6 +125,7 @@ async def async_setup_entry( # noqa: C901
session=websession,
provided_refresh_token=entry.data[CONF_TOKEN],
log_traces=log_traces,
state_yaml=state_yaml,
)
else:
raise InvalidCredentialsError
Expand All @@ -135,6 +137,7 @@ async def async_setup_entry( # noqa: C901
entry.data[CONF_PASSWORD],
session=websession,
log_traces=log_traces,
state_yaml=state_yaml,
)
except InvalidCredentialsError as err:
raise ConfigEntryAuthFailed from err
Expand Down

0 comments on commit 9a3618f

Please sign in to comment.