Skip to content

Commit

Permalink
fix: clean discovery_info of unneeded values prior to passing
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Sep 4, 2019
1 parent ad9b95b commit b5e1894
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,19 @@ async def update_devices(login_obj):
exclude_filter)

if new_alexa_clients:
cleaned_config = config.copy()
cleaned_config.pop(CONF_SCAN_INTERVAL, None)
# CONF_SCAN_INTERVAL causes a json error in the recorder because it
# is a timedelta object.
cleaned_config.pop(CONF_PASSWORD, None)
# CONF_PASSWORD contains sensitive info which is no longer needed
for component in ALEXA_COMPONENTS:
hass.async_create_task(
async_load_platform(hass,
component,
DOMAIN,
{CONF_NAME: DOMAIN, "config": config},
{CONF_NAME: DOMAIN,
"config": cleaned_config},
config))

# Process last_called data to fire events
Expand Down

0 comments on commit b5e1894

Please sign in to comment.