Skip to content

Commit 390d9c6

Browse files
committed
fix: config flow when CONF_API_PROXY_CERT doesn't exist
1 parent 2b53f48 commit 390d9c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

custom_components/tesla_custom/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ async def async_setup_entry(hass, config_entry):
141141
# Because users can have multiple accounts, we always
142142
# create a new session so they have separate cookies
143143

144-
if config[CONF_API_PROXY_CERT]:
144+
if config.get(CONF_API_PROXY_CERT):
145145
try:
146146
SSL_CONTEXT.load_verify_locations(config[CONF_API_PROXY_CERT])
147147
_LOGGER.debug(SSL_CONTEXT)

custom_components/tesla_custom/config_flow.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async def async_step_user(self, user_input=None):
8080
if CONF_API_PROXY_CERT in user_input:
8181
return await self.async_step_credentials(user_input)
8282

83-
self.use_proxy = user_input[CONF_API_PROXY_ENABLE]
83+
self.use_proxy = user_input.get(CONF_API_PROXY_ENABLE, False)
8484
return await self.async_step_credentials()
8585

8686
async def async_step_credentials(self, user_input=None):

0 commit comments

Comments
 (0)