media_title property now returns current source (#10120)

This commit is contained in:
Egor Tsinko 2017-10-28 18:26:55 -06:00 committed by Fabian Affolter
parent b3e88d1f8f
commit 2c3195522f
2 changed files with 11 additions and 0 deletions

View file

@ -137,6 +137,11 @@ class MonopriceZone(MediaPlayerDevice):
"""Return flag of media commands that are supported."""
return SUPPORT_MONOPRICE
@property
def media_title(self):
"""Return the current source as medial title."""
return self._source
@property
def source(self):
""""Return the current input source of the device."""

View file

@ -219,6 +219,12 @@ class TestMonopriceMediaPlayer(unittest.TestCase):
self.media_player.update()
self.assertEqual('one', self.media_player.source)
def test_media_title(self):
"""Test media title property."""
self.assertIsNone(self.media_player.media_title)
self.media_player.update()
self.assertEqual('one', self.media_player.media_title)
def test_source_list(self):
"""Test source list property."""
# Note, the list is sorted!