From fb1da53568bb243abc8780734b6082ec9e17cd02 Mon Sep 17 00:00:00 2001 From: Greg Johnson Date: Wed, 6 Feb 2019 11:16:21 -0800 Subject: [PATCH] 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 --- homeassistant/components/media_player/universal.py | 3 +-- tests/components/media_player/test_universal.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/media_player/universal.py b/homeassistant/components/media_player/universal.py index 18b953a0372..a0c99dbec45 100644 --- a/homeassistant/components/media_player/universal.py +++ b/homeassistant/components/media_player/universal.py @@ -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 \ diff --git a/tests/components/media_player/test_universal.py b/tests/components/media_player/test_universal.py index 58911776836..ee86735a063 100644 --- a/tests/components/media_player/test_universal.py +++ b/tests/components/media_player/test_universal.py @@ -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