Skip to content

Commit

Permalink
fix: key error for CONF_API_PROXY_CERT (#890)
Browse files Browse the repository at this point in the history
closes #889
  • Loading branch information
llamafilm authored Mar 12, 2024
1 parent 2b53f48 commit b6c06d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/tesla_custom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async def async_setup_entry(hass, config_entry):
# Because users can have multiple accounts, we always
# create a new session so they have separate cookies

if config[CONF_API_PROXY_CERT]:
if config.get(CONF_API_PROXY_CERT):
try:
SSL_CONTEXT.load_verify_locations(config[CONF_API_PROXY_CERT])
_LOGGER.debug(SSL_CONTEXT)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/tesla_custom/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def async_step_user(self, user_input=None):
if CONF_API_PROXY_CERT in user_input:
return await self.async_step_credentials(user_input)

self.use_proxy = user_input[CONF_API_PROXY_ENABLE]
self.use_proxy = user_input.get(CONF_API_PROXY_ENABLE, False)
return await self.async_step_credentials()

async def async_step_credentials(self, user_input=None):
Expand Down

0 comments on commit b6c06d2

Please sign in to comment.