From b5e189456cb3bfcf3f12ad2de773dec048e6849c Mon Sep 17 00:00:00 2001 From: "Alan D. Tse" Date: Wed, 4 Sep 2019 01:14:17 -0700 Subject: [PATCH] fix: clean discovery_info of unneeded values prior to passing --- custom_components/alexa_media/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/custom_components/alexa_media/__init__.py b/custom_components/alexa_media/__init__.py index 0f0969f7..d26336f2 100644 --- a/custom_components/alexa_media/__init__.py +++ b/custom_components/alexa_media/__init__.py @@ -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