media_title property now returns current source (#10120)
This commit is contained in:
parent
b3e88d1f8f
commit
2c3195522f
2 changed files with 11 additions and 0 deletions
|
@ -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."""
|
||||
|
|
|
@ -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!
|
||||
|
|
Loading…
Add table
Reference in a new issue