mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Renamed SUPPORT_VOLUME_STEP flag in media_player
1) Renamed SUPPORT_VOLUME_BUTTONS to SUPPORT_VOLUME_STEP 2) Removed unused imports from tests.
This commit is contained in:
parent
ee4543d739
commit
8f3e8d29f0
@ -72,7 +72,7 @@ SUPPORT_YOUTUBE = 64
|
||||
SUPPORT_TURN_ON = 128
|
||||
SUPPORT_TURN_OFF = 256
|
||||
SUPPORT_PLAY_MEDIA = 512
|
||||
SUPPORT_VOLUME_BUTTONS = 1024
|
||||
SUPPORT_VOLUME_STEP = 1024
|
||||
|
||||
YOUTUBE_COVER_URL_FORMAT = 'https://img.youtube.com/vi/{}/1.jpg'
|
||||
|
||||
|
@ -25,7 +25,7 @@ from homeassistant.const import (
|
||||
|
||||
from homeassistant.components.media_player import (
|
||||
MediaPlayerDevice, DOMAIN,
|
||||
SUPPORT_VOLUME_BUTTONS, SUPPORT_VOLUME_SET, SUPPORT_VOLUME_MUTE,
|
||||
SUPPORT_VOLUME_STEP, SUPPORT_VOLUME_SET, SUPPORT_VOLUME_MUTE,
|
||||
SUPPORT_TURN_ON, SUPPORT_TURN_OFF,
|
||||
SERVICE_PLAY_MEDIA, SERVICE_YOUTUBE_VIDEO,
|
||||
ATTR_SUPPORTED_MEDIA_COMMANDS, ATTR_MEDIA_VOLUME_MUTED,
|
||||
@ -352,7 +352,7 @@ class UniversalMediaPlayer(MediaPlayerDevice):
|
||||
|
||||
if any([cmd in self._cmds for cmd in [SERVICE_VOLUME_UP,
|
||||
SERVICE_VOLUME_DOWN]]):
|
||||
flags |= SUPPORT_VOLUME_BUTTONS
|
||||
flags |= SUPPORT_VOLUME_STEP
|
||||
flags &= ~SUPPORT_VOLUME_SET
|
||||
|
||||
if SERVICE_VOLUME_MUTE in self._cmds and \
|
||||
|
@ -9,14 +9,10 @@ import unittest
|
||||
|
||||
import homeassistant.core as ha
|
||||
from homeassistant.const import (
|
||||
STATE_OFF, STATE_ON, STATE_UNKNOWN, STATE_PLAYING, STATE_PAUSED,
|
||||
SERVICE_TURN_ON, SERVICE_TURN_OFF, SERVICE_VOLUME_UP, SERVICE_VOLUME_DOWN,
|
||||
SERVICE_MEDIA_PLAY_PAUSE, SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PAUSE,
|
||||
SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_PREVIOUS_TRACK, ATTR_ENTITY_ID)
|
||||
STATE_OFF, STATE_ON, STATE_UNKNOWN, STATE_PLAYING, STATE_PAUSED)
|
||||
import homeassistant.components.switch as switch
|
||||
import homeassistant.components.media_player as media_player
|
||||
import homeassistant.components.media_player.universal as universal
|
||||
from tests.common import mock_service
|
||||
|
||||
|
||||
class MockMediaPlayer(media_player.MediaPlayerDevice):
|
||||
@ -349,6 +345,6 @@ class TestMediaPlayer(unittest.TestCase):
|
||||
self.mock_mp_1.update_ha_state()
|
||||
|
||||
check_flags = universal.SUPPORT_TURN_ON | universal.SUPPORT_TURN_OFF \
|
||||
| universal.SUPPORT_VOLUME_BUTTONS | universal.SUPPORT_VOLUME_MUTE
|
||||
| universal.SUPPORT_VOLUME_STEP | universal.SUPPORT_VOLUME_MUTE
|
||||
|
||||
self.assertEqual(check_flags, ump.supported_media_commands)
|
||||
|
Loading…
x
Reference in New Issue
Block a user