Skip to content

Commit

Permalink
Fix idle state string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
postlund committed Oct 1, 2017
1 parent 42aa759 commit c0480a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyatv/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def playstate_str(state):
"""Convert internal API playstate to string."""
if state == const.PLAY_STATE_NO_MEDIA:
return 'No media'
if state == const.PLAY_STATE_IDLE:
return 'Idle'
elif state == const.PLAY_STATE_LOADING:
return 'Loading'
elif state == const.PLAY_STATE_PAUSED:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ def test_unknown_playstate_throws(self):
def test_playstate_str(self):
self.assertEqual('No media',
convert.playstate_str(const.PLAY_STATE_NO_MEDIA))
self.assertEqual('Idle',
convert.playstate_str(const.PLAY_STATE_IDLE))
self.assertEqual('Loading',
convert.playstate_str(const.PLAY_STATE_LOADING))
self.assertEqual('Paused',
Expand Down

0 comments on commit c0480a9

Please sign in to comment.