mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Handle connection errors when connecting to Apple TVs (#5829)
* Handle connection errors when connecting to Apple TVs Also bump pyatv to 0.1.2 which fixes a request leak. * Fix pylint error * Fix import order
This commit is contained in:
parent
c54517de90
commit
ecbbb06b2f
@ -8,6 +8,7 @@ import asyncio
|
|||||||
import logging
|
import logging
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
|
import aiohttp
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
@ -21,7 +22,7 @@ import homeassistant.helpers.config_validation as cv
|
|||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
|
|
||||||
|
|
||||||
REQUIREMENTS = ['pyatv==0.1.1']
|
REQUIREMENTS = ['pyatv==0.1.2']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -128,6 +129,8 @@ class AppleTvDevice(MediaPlayerDevice):
|
|||||||
self._playing = playing
|
self._playing = playing
|
||||||
except exceptions.AuthenticationError as ex:
|
except exceptions.AuthenticationError as ex:
|
||||||
_LOGGER.warning('%s (bad login id?)', str(ex))
|
_LOGGER.warning('%s (bad login id?)', str(ex))
|
||||||
|
except aiohttp.errors.ClientOSError as ex:
|
||||||
|
_LOGGER.error('failed to connect to Apple TV (%s)', str(ex))
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
_LOGGER.warning('timed out while connecting to Apple TV')
|
_LOGGER.warning('timed out while connecting to Apple TV')
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ pyasn1-modules==0.0.8
|
|||||||
pyasn1==0.2.2
|
pyasn1==0.2.2
|
||||||
|
|
||||||
# homeassistant.components.media_player.apple_tv
|
# homeassistant.components.media_player.apple_tv
|
||||||
pyatv==0.1.1
|
pyatv==0.1.2
|
||||||
|
|
||||||
# homeassistant.components.device_tracker.bbox
|
# homeassistant.components.device_tracker.bbox
|
||||||
# homeassistant.components.sensor.bbox
|
# homeassistant.components.sensor.bbox
|
||||||
|
Loading…
x
Reference in New Issue
Block a user