mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
WebOS component fixes
* fixed some exceptions * add requirements to notify * added optimistic state to power off * run requirements script
This commit is contained in:
parent
3318c55c65
commit
2333c0ca3b
@ -69,7 +69,7 @@ def setup_tv(host, hass, add_devices):
|
|||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
'Connected to LG WebOS TV at %s but not paired.', host)
|
'Connected to LG WebOS TV at %s but not paired.', host)
|
||||||
return
|
return
|
||||||
except ConnectionRefusedError:
|
except OSError:
|
||||||
_LOGGER.error('Unable to connect to host %s.', host)
|
_LOGGER.error('Unable to connect to host %s.', host)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
@ -158,7 +158,7 @@ class LgWebOSDevice(MediaPlayerDevice):
|
|||||||
if source['appId'] == self._current_source_id:
|
if source['appId'] == self._current_source_id:
|
||||||
self._current_source = source['label']
|
self._current_source = source['label']
|
||||||
|
|
||||||
except ConnectionRefusedError:
|
except OSError:
|
||||||
self._state = STATE_OFF
|
self._state = STATE_OFF
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -208,6 +208,7 @@ class LgWebOSDevice(MediaPlayerDevice):
|
|||||||
|
|
||||||
def turn_off(self):
|
def turn_off(self):
|
||||||
"""Turn off media player."""
|
"""Turn off media player."""
|
||||||
|
self._state = STATE_OFF
|
||||||
self._client.power_off()
|
self._client.power_off()
|
||||||
|
|
||||||
def volume_up(self):
|
def volume_up(self):
|
||||||
|
@ -10,6 +10,10 @@ from homeassistant.components.notify import (BaseNotificationService, DOMAIN)
|
|||||||
from homeassistant.const import (CONF_HOST, CONF_NAME)
|
from homeassistant.const import (CONF_HOST, CONF_NAME)
|
||||||
from homeassistant.helpers import validate_config
|
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__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -35,7 +39,7 @@ def get_service(hass, config):
|
|||||||
except PyLGTVPairException:
|
except PyLGTVPairException:
|
||||||
_LOGGER.error('Pairing failed.')
|
_LOGGER.error('Pairing failed.')
|
||||||
return None
|
return None
|
||||||
except ConnectionRefusedError:
|
except OSError:
|
||||||
_LOGGER.error('Host unreachable.')
|
_LOGGER.error('Host unreachable.')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -58,5 +62,5 @@ class LgWebOSNotificationService(BaseNotificationService):
|
|||||||
self._client.send_message(message)
|
self._client.send_message(message)
|
||||||
except PyLGTVPairException:
|
except PyLGTVPairException:
|
||||||
_LOGGER.error('Pairing failed.')
|
_LOGGER.error('Pairing failed.')
|
||||||
except ConnectionRefusedError:
|
except OSError:
|
||||||
_LOGGER.error('Host unreachable.')
|
_LOGGER.error('Host unreachable.')
|
||||||
|
@ -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
|
https://github.com/LinuxChristian/pyW215/archive/v0.1.1.zip#pyW215==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.media_player.webostv
|
# homeassistant.components.media_player.webostv
|
||||||
|
# homeassistant.components.notify.webostv
|
||||||
https://github.com/TheRealLink/pylgtv/archive/v0.1.2.zip#pylgtv==0.1.2
|
https://github.com/TheRealLink/pylgtv/archive/v0.1.2.zip#pylgtv==0.1.2
|
||||||
|
|
||||||
# homeassistant.components.sensor.thinkingcleaner
|
# homeassistant.components.sensor.thinkingcleaner
|
||||||
|
Loading…
x
Reference in New Issue
Block a user