diff --git a/homeassistant/components/media_player/webostv.py b/homeassistant/components/media_player/webostv.py index 38c3b8b2830..4d3bb701586 100644 --- a/homeassistant/components/media_player/webostv.py +++ b/homeassistant/components/media_player/webostv.py @@ -69,7 +69,7 @@ def setup_tv(host, hass, add_devices): _LOGGER.warning( 'Connected to LG WebOS TV at %s but not paired.', host) return - except ConnectionRefusedError: + except OSError: _LOGGER.error('Unable to connect to host %s.', host) return else: @@ -158,7 +158,7 @@ class LgWebOSDevice(MediaPlayerDevice): if source['appId'] == self._current_source_id: self._current_source = source['label'] - except ConnectionRefusedError: + except OSError: self._state = STATE_OFF @property @@ -208,6 +208,7 @@ class LgWebOSDevice(MediaPlayerDevice): def turn_off(self): """Turn off media player.""" + self._state = STATE_OFF self._client.power_off() def volume_up(self): diff --git a/homeassistant/components/notify/webostv.py b/homeassistant/components/notify/webostv.py index fb6cf02c9c5..34463dc6e45 100644 --- a/homeassistant/components/notify/webostv.py +++ b/homeassistant/components/notify/webostv.py @@ -10,6 +10,10 @@ from homeassistant.components.notify import (BaseNotificationService, DOMAIN) from homeassistant.const import (CONF_HOST, CONF_NAME) from homeassistant.helpers import validate_config +REQUIREMENTS = ['https://github.com/TheRealLink/pylgtv' + '/archive/v0.1.2.zip' + '#pylgtv==0.1.2'] + _LOGGER = logging.getLogger(__name__) @@ -35,7 +39,7 @@ def get_service(hass, config): except PyLGTVPairException: _LOGGER.error('Pairing failed.') return None - except ConnectionRefusedError: + except OSError: _LOGGER.error('Host unreachable.') return None @@ -58,5 +62,5 @@ class LgWebOSNotificationService(BaseNotificationService): self._client.send_message(message) except PyLGTVPairException: _LOGGER.error('Pairing failed.') - except ConnectionRefusedError: + except OSError: _LOGGER.error('Host unreachable.') diff --git a/requirements_all.txt b/requirements_all.txt index 297bc01c127..cdddc4550e5 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -80,6 +80,7 @@ https://github.com/HydrelioxGitHub/netatmo-api-python/archive/43ff238a0122b0939a https://github.com/LinuxChristian/pyW215/archive/v0.1.1.zip#pyW215==0.1.1 # homeassistant.components.media_player.webostv +# homeassistant.components.notify.webostv https://github.com/TheRealLink/pylgtv/archive/v0.1.2.zip#pylgtv==0.1.2 # homeassistant.components.sensor.thinkingcleaner