Updated braviatv media player to support power status (#2470)

* Updated braviatv media player to support power status

* Updated requirements_all.txt
This commit is contained in:
Neil Lathwood 2016-07-08 02:28:01 +01:00 committed by Paulus Schoutsen
parent 85e3dfe6a6
commit 978ebb9c59
2 changed files with 20 additions and 16 deletions

View File

@ -17,8 +17,8 @@ from homeassistant.const import (
CONF_HOST, CONF_NAME, STATE_OFF, STATE_ON)
REQUIREMENTS = [
'https://github.com/aparraga/braviarc/archive/0.3.2.zip'
'#braviarc==0.3.2']
'https://github.com/aparraga/braviarc/archive/0.3.3.zip'
'#braviarc==0.3.3']
BRAVIA_CONFIG_FILE = 'bravia.conf'
CLIENTID_PREFIX = 'HomeAssistant'
@ -220,11 +220,13 @@ class BraviaTVDevice(MediaPlayerDevice):
self._refresh_volume()
self._refresh_channels()
power_status = self._braviarc.get_power_status()
if power_status == 'active':
self._state = STATE_ON
playing_info = self._braviarc.get_playing_info()
if playing_info is None or len(playing_info) == 0:
self._state = STATE_OFF
self._channel_name = 'App'
else:
self._state = STATE_ON
self._program_name = playing_info.get('programTitle')
self._channel_name = playing_info.get('title')
self._program_media_type = playing_info.get(
@ -234,6 +236,8 @@ class BraviaTVDevice(MediaPlayerDevice):
self._content_uri = playing_info.get('uri')
self._duration = playing_info.get('durationSec')
self._start_date_time = playing_info.get('startDateTime')
else:
self._state = STATE_OFF
except Exception as exception_instance: # pylint: disable=broad-except
_LOGGER.error(exception_instance)

View File

@ -114,7 +114,7 @@ https://github.com/TheRealLink/pythinkingcleaner/archive/v0.0.2.zip#pythinkingcl
https://github.com/Xorso/pyalarmdotcom/archive/0.1.1.zip#pyalarmdotcom==0.1.1
# homeassistant.components.media_player.braviatv
https://github.com/aparraga/braviarc/archive/0.3.2.zip#braviarc==0.3.2
https://github.com/aparraga/braviarc/archive/0.3.3.zip#braviarc==0.3.3
# homeassistant.components.media_player.roku
https://github.com/bah2830/python-roku/archive/3.1.2.zip#roku==3.1.2