Build frontend

pull/1727/head
Paulus Schoutsen 2016-04-08 21:28:59 -07:00
parent cac555fc69
commit 2ec9cc15f4
5 changed files with 51 additions and 44 deletions

View File

@ -1,2 +1,2 @@
"""DO NOT MODIFY. Auto-generated by build_frontend script."""
VERSION = "f634487360d4d0f77b67ff82b8e0fc17"
VERSION = "4062ab87999fd5e382074ba9d7a880d7"

File diff suppressed because one or more lines are too long

@ -1 +1 @@
Subproject commit cdfec7dc909fc26a3e6c937281f6c70ee38a0845
Subproject commit 017e38d5124b89ee394d11accaebb3f0718c9eea

View File

@ -20,7 +20,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
'Living Room', 'eyU3bRy2x44',
'♥♥ The Best Fireplace Video (3 hours)'),
DemoYoutubePlayer('Bedroom', 'kxopViU98Xo', 'Epic sax guy 10 hours'),
DemoMusicPlayer(), DemoTVShowPlayer(), DemoReceiver(),
DemoMusicPlayer(), DemoTVShowPlayer(),
])
@ -35,9 +35,7 @@ MUSIC_PLAYER_SUPPORT = \
SUPPORT_TURN_ON | SUPPORT_TURN_OFF
NETFLIX_PLAYER_SUPPORT = \
SUPPORT_PAUSE | SUPPORT_TURN_ON | SUPPORT_TURN_OFF
RECEIVER_SUPPORT = SUPPORT_SELECT_SOURCE
SUPPORT_PAUSE | SUPPORT_TURN_ON | SUPPORT_TURN_OFF | SUPPORT_SELECT_SOURCE
class AbstractDemoPlayer(MediaPlayerDevice):
@ -269,6 +267,7 @@ class DemoTVShowPlayer(AbstractDemoPlayer):
super().__init__('Lounge room')
self._cur_episode = 1
self._episode_count = 13
self._source = 'dvd'
@property
def media_content_id(self):
@ -315,6 +314,11 @@ class DemoTVShowPlayer(AbstractDemoPlayer):
"""Return the current running application."""
return "Netflix"
@property
def source(self):
"""Return the current input source."""
return self._source
@property
def supported_media_commands(self):
"""Flag of media commands that are supported."""
@ -340,28 +344,7 @@ class DemoTVShowPlayer(AbstractDemoPlayer):
self._cur_episode += 1
self.update_ha_state()
class DemoReceiver(AbstractDemoPlayer):
"""A Demo receiver that only supports changing source input."""
# We only implement the methods that we support
# pylint: disable=abstract-method
def __init__(self):
"""Initialize the demo device."""
super().__init__('receiver')
self._source = 'dvd'
@property
def source(self):
"""Return the current input source."""
return self._source
def select_source(self, source):
"""Set the input source."""
self._source = source
self.update_ha_state()
@property
def supported_media_commands(self):
"""Flag of media commands that are supported."""
return RECEIVER_SUPPORT

View File

@ -22,7 +22,7 @@ class TestDemoMediaPlayer(unittest.TestCase):
def test_source_select(self):
"""Test the input source service."""
entity_id = 'media_player.receiver'
entity_id = 'media_player.lounge_room'
assert mp.setup(self.hass, {'media_player': {'platform': 'demo'}})
state = self.hass.states.get(entity_id)