Skip to content

Commit

Permalink
fix: fix key error if entry exists
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Nov 23, 2021
1 parent f6fb70b commit 4f2a2b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/alexa_media/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,12 @@ async def _test_login(self):
self.hass.components.persistent_notification.async_dismiss(
f"alexa_media_{slugify(email)}{slugify(login.url[7:])}"
)
if not self.hass.data[DATA_ALEXAMEDIA]["accounts"].get(
self.config[CONF_EMAIL]
):
self.hass.data[DATA_ALEXAMEDIA]["accounts"][
self.config[CONF_EMAIL]
] = {}
self.hass.data[DATA_ALEXAMEDIA]["accounts"][self.config[CONF_EMAIL]][
"login_obj"
] = self.login
Expand Down

0 comments on commit 4f2a2b2

Please sign in to comment.