diff --git a/homeassistant/components/api.py b/homeassistant/components/api.py index da8ad9f88ba..8e03133e032 100644 --- a/homeassistant/components/api.py +++ b/homeassistant/components/api.py @@ -133,6 +133,9 @@ class APIEventStream(HomeAssistantView): except asyncio.TimeoutError: yield from to_write.put(STREAM_PING_PAYLOAD) + except asyncio.CancelledError: + _LOGGER.debug('STREAM %s ABORT', id(stop_obj)) + finally: _LOGGER.debug('STREAM %s RESPONSE CLOSED', id(stop_obj)) unsub_stream()