mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
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:
parent
85e3dfe6a6
commit
978ebb9c59
@ -17,8 +17,8 @@ from homeassistant.const import (
|
|||||||
CONF_HOST, CONF_NAME, STATE_OFF, STATE_ON)
|
CONF_HOST, CONF_NAME, STATE_OFF, STATE_ON)
|
||||||
|
|
||||||
REQUIREMENTS = [
|
REQUIREMENTS = [
|
||||||
'https://github.com/aparraga/braviarc/archive/0.3.2.zip'
|
'https://github.com/aparraga/braviarc/archive/0.3.3.zip'
|
||||||
'#braviarc==0.3.2']
|
'#braviarc==0.3.3']
|
||||||
|
|
||||||
BRAVIA_CONFIG_FILE = 'bravia.conf'
|
BRAVIA_CONFIG_FILE = 'bravia.conf'
|
||||||
CLIENTID_PREFIX = 'HomeAssistant'
|
CLIENTID_PREFIX = 'HomeAssistant'
|
||||||
@ -220,20 +220,24 @@ class BraviaTVDevice(MediaPlayerDevice):
|
|||||||
self._refresh_volume()
|
self._refresh_volume()
|
||||||
self._refresh_channels()
|
self._refresh_channels()
|
||||||
|
|
||||||
playing_info = self._braviarc.get_playing_info()
|
power_status = self._braviarc.get_power_status()
|
||||||
if playing_info is None or len(playing_info) == 0:
|
if power_status == 'active':
|
||||||
self._state = STATE_OFF
|
|
||||||
else:
|
|
||||||
self._state = STATE_ON
|
self._state = STATE_ON
|
||||||
self._program_name = playing_info.get('programTitle')
|
playing_info = self._braviarc.get_playing_info()
|
||||||
self._channel_name = playing_info.get('title')
|
if playing_info is None or len(playing_info) == 0:
|
||||||
self._program_media_type = playing_info.get(
|
self._channel_name = 'App'
|
||||||
'programMediaType')
|
else:
|
||||||
self._channel_number = playing_info.get('dispNum')
|
self._program_name = playing_info.get('programTitle')
|
||||||
self._source = playing_info.get('source')
|
self._channel_name = playing_info.get('title')
|
||||||
self._content_uri = playing_info.get('uri')
|
self._program_media_type = playing_info.get(
|
||||||
self._duration = playing_info.get('durationSec')
|
'programMediaType')
|
||||||
self._start_date_time = playing_info.get('startDateTime')
|
self._channel_number = playing_info.get('dispNum')
|
||||||
|
self._source = playing_info.get('source')
|
||||||
|
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
|
except Exception as exception_instance: # pylint: disable=broad-except
|
||||||
_LOGGER.error(exception_instance)
|
_LOGGER.error(exception_instance)
|
||||||
|
@ -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
|
https://github.com/Xorso/pyalarmdotcom/archive/0.1.1.zip#pyalarmdotcom==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.media_player.braviatv
|
# 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
|
# homeassistant.components.media_player.roku
|
||||||
https://github.com/bah2830/python-roku/archive/3.1.2.zip#roku==3.1.2
|
https://github.com/bah2830/python-roku/archive/3.1.2.zip#roku==3.1.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user