Allow both VOLUME_STEP and VOLUME_SET (#20732)

* Allow both VOLUME_STEP and VOLUME_SET

Seems like it should be possible to support both at the same time.

* Update test to allow VOLUME_SET and VOLUME_STEP
pull/20796/head
Greg Johnson 2019-02-06 11:16:21 -08:00 committed by Paulus Schoutsen
parent 59393ab085
commit fb1da53568
2 changed files with 3 additions and 3 deletions

View File

@ -333,8 +333,7 @@ class UniversalMediaPlayer(MediaPlayerDevice):
if any([cmd in self._cmds for cmd in [SERVICE_VOLUME_UP,
SERVICE_VOLUME_DOWN]]):
flags |= SUPPORT_VOLUME_STEP
flags &= ~SUPPORT_VOLUME_SET
elif SERVICE_VOLUME_SET in self._cmds:
if SERVICE_VOLUME_SET in self._cmds:
flags |= SUPPORT_VOLUME_SET
if SERVICE_VOLUME_MUTE in self._cmds and \

View File

@ -584,7 +584,8 @@ class TestMediaPlayer(unittest.TestCase):
check_flags = universal.SUPPORT_TURN_ON | universal.SUPPORT_TURN_OFF \
| universal.SUPPORT_VOLUME_STEP | universal.SUPPORT_VOLUME_MUTE \
| universal.SUPPORT_SELECT_SOURCE | universal.SUPPORT_SHUFFLE_SET
| universal.SUPPORT_SELECT_SOURCE | universal.SUPPORT_SHUFFLE_SET \
| universal.SUPPORT_VOLUME_SET
assert check_flags == ump.supported_features