mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
media_title property now returns current source (#10120)
This commit is contained in:
parent
b3e88d1f8f
commit
2c3195522f
@ -137,6 +137,11 @@ class MonopriceZone(MediaPlayerDevice):
|
|||||||
"""Return flag of media commands that are supported."""
|
"""Return flag of media commands that are supported."""
|
||||||
return SUPPORT_MONOPRICE
|
return SUPPORT_MONOPRICE
|
||||||
|
|
||||||
|
@property
|
||||||
|
def media_title(self):
|
||||||
|
"""Return the current source as medial title."""
|
||||||
|
return self._source
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source(self):
|
def source(self):
|
||||||
""""Return the current input source of the device."""
|
""""Return the current input source of the device."""
|
||||||
|
@ -219,6 +219,12 @@ class TestMonopriceMediaPlayer(unittest.TestCase):
|
|||||||
self.media_player.update()
|
self.media_player.update()
|
||||||
self.assertEqual('one', self.media_player.source)
|
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):
|
def test_source_list(self):
|
||||||
"""Test source list property."""
|
"""Test source list property."""
|
||||||
# Note, the list is sorted!
|
# Note, the list is sorted!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user