From 7f71143b9c16bc30a895e9b61bb74434b45df92c Mon Sep 17 00:00:00 2001 From: ktdad Date: Wed, 29 May 2019 19:56:25 -0400 Subject: [PATCH] add timeout error --- homeassistant/components/nws/weather.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/nws/weather.py b/homeassistant/components/nws/weather.py index fb032557ebf..4ea38fbd95d 100644 --- a/homeassistant/components/nws/weather.py +++ b/homeassistant/components/nws/weather.py @@ -1,4 +1,5 @@ """Support for NWS weather service.""" +import asyncio from collections import OrderedDict from datetime import timedelta from json import JSONDecodeError @@ -149,7 +150,8 @@ async def async_setup_platform(hass, config, async_add_entities, try: with async_timeout.timeout(10, loop=hass.loop): stations = await nws.stations() - except aiohttp.ClientError, JSONDecodeError as status: + except (aiohttp.ClientError, JSONDecodeError, + asyncio.CancelledError) as status: _LOGGER.error("Error getting station list for %s: %s", nws.latlon, status) raise PlatformNotReady