Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle connection errors when connecting to Apple TVs #5829

Merged
merged 3 commits into from Feb 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion homeassistant/components/media_player/apple_tv.py
Expand Up @@ -8,6 +8,7 @@
import logging
import hashlib

import aiohttp
import voluptuous as vol

from homeassistant.components.media_player import (
Expand All @@ -21,7 +22,7 @@
import homeassistant.util.dt as dt_util


REQUIREMENTS = ['pyatv==0.1.1']
REQUIREMENTS = ['pyatv==0.1.2']

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -128,6 +129,8 @@ def async_update(self):
self._playing = playing
except exceptions.AuthenticationError as 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:
_LOGGER.warning('timed out while connecting to Apple TV')

Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Expand Up @@ -418,7 +418,7 @@ pyasn1-modules==0.0.8
pyasn1==0.2.2

# homeassistant.components.media_player.apple_tv
pyatv==0.1.1
pyatv==0.1.2

# homeassistant.components.device_tracker.bbox
# homeassistant.components.sensor.bbox
Expand Down