From b3691d5d907cafabf537d54c61789f2e513089e0 Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 22 Sep 2020 11:01:52 +1000 Subject: [PATCH] Improve timeout error handling for Splunk (#40384) * Bugfix to catch asyncio.timeout * Better asyncio.timeout warning message --- homeassistant/components/splunk/__init__.py | 3 +++ homeassistant/components/splunk/manifest.json | 2 +- requirements_all.txt | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/splunk/__init__.py b/homeassistant/components/splunk/__init__.py index ec1471a2272..a3ec307d67b 100644 --- a/homeassistant/components/splunk/__init__.py +++ b/homeassistant/components/splunk/__init__.py @@ -1,4 +1,5 @@ """Support to send data to a Splunk instance.""" +import asyncio import json import logging import time @@ -116,6 +117,8 @@ async def async_setup(hass, config): _LOGGER.warning(err) except ClientConnectionError as err: _LOGGER.warning(err) + except asyncio.TimeoutError: + _LOGGER.warning("Connection to %s:%s timed out", host, port) except ClientResponseError as err: _LOGGER.error(err.message) diff --git a/homeassistant/components/splunk/manifest.json b/homeassistant/components/splunk/manifest.json index aaddac2609d..d51d6c712de 100644 --- a/homeassistant/components/splunk/manifest.json +++ b/homeassistant/components/splunk/manifest.json @@ -3,7 +3,7 @@ "name": "Splunk", "documentation": "https://www.home-assistant.io/integrations/splunk", "requirements": [ - "hass_splunk==0.1.0" + "hass_splunk==0.1.1" ], "codeowners": [ "@Bre77" diff --git a/requirements_all.txt b/requirements_all.txt index 23c7a950fe3..ba2c86a00eb 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -723,7 +723,7 @@ hangups==0.4.11 hass-nabucasa==0.37.0 # homeassistant.components.splunk -hass_splunk==0.1.0 +hass_splunk==0.1.1 # homeassistant.components.jewish_calendar hdate==0.9.5