Sort imports according to PEP8 for media_player (#29665)

This commit is contained in:
Bas Nijholt 2019-12-09 12:17:41 +01:00 committed by Franck Nijhof
parent 01d651c67d
commit eb47c2b148
8 changed files with 27 additions and 27 deletions

View file

@ -97,7 +97,6 @@ from .const import (
SUPPORT_VOLUME_STEP, SUPPORT_VOLUME_STEP,
) )
# mypy: allow-untyped-defs, no-check-untyped-defs # mypy: allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View file

@ -1,24 +1,26 @@
"""Provides device automations for Media player.""" """Provides device automations for Media player."""
from typing import Dict, List from typing import Dict, List
import voluptuous as vol import voluptuous as vol
from homeassistant.const import ( from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_ENTITY_ID,
CONF_CONDITION, CONF_CONDITION,
CONF_DOMAIN,
CONF_TYPE,
CONF_DEVICE_ID, CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_ID, CONF_ENTITY_ID,
CONF_TYPE,
STATE_IDLE,
STATE_OFF, STATE_OFF,
STATE_ON, STATE_ON,
STATE_IDLE,
STATE_PAUSED, STATE_PAUSED,
STATE_PLAYING, STATE_PLAYING,
) )
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers import condition, config_validation as cv, entity_registry from homeassistant.helpers import condition, config_validation as cv, entity_registry
from homeassistant.helpers.typing import ConfigType, TemplateVarsType
from homeassistant.helpers.config_validation import DEVICE_CONDITION_BASE_SCHEMA from homeassistant.helpers.config_validation import DEVICE_CONDITION_BASE_SCHEMA
from homeassistant.helpers.typing import ConfigType, TemplateVarsType
from . import DOMAIN from . import DOMAIN
CONDITION_TYPES = {"is_on", "is_off", "is_idle", "is_paused", "is_playing"} CONDITION_TYPES = {"is_on", "is_off", "is_idle", "is_paused", "is_playing"}

View file

@ -21,21 +21,20 @@ from homeassistant.core import Context, State
from homeassistant.helpers.typing import HomeAssistantType from homeassistant.helpers.typing import HomeAssistantType
from .const import ( from .const import (
ATTR_INPUT_SOURCE,
ATTR_MEDIA_CONTENT_ID,
ATTR_MEDIA_CONTENT_TYPE,
ATTR_MEDIA_ENQUEUE,
ATTR_MEDIA_SEEK_POSITION,
ATTR_MEDIA_VOLUME_LEVEL, ATTR_MEDIA_VOLUME_LEVEL,
ATTR_MEDIA_VOLUME_MUTED, ATTR_MEDIA_VOLUME_MUTED,
ATTR_MEDIA_SEEK_POSITION,
ATTR_INPUT_SOURCE,
ATTR_SOUND_MODE, ATTR_SOUND_MODE,
ATTR_MEDIA_CONTENT_TYPE,
ATTR_MEDIA_CONTENT_ID,
ATTR_MEDIA_ENQUEUE,
SERVICE_PLAY_MEDIA,
SERVICE_SELECT_SOURCE,
SERVICE_SELECT_SOUND_MODE,
DOMAIN, DOMAIN,
SERVICE_PLAY_MEDIA,
SERVICE_SELECT_SOUND_MODE,
SERVICE_SELECT_SOURCE,
) )
# mypy: allow-untyped-defs # mypy: allow-untyped-defs

View file

@ -18,6 +18,7 @@ from homeassistant.components.media_player.const import (
) )
from homeassistant.const import ( from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_ENTITY_ID,
ENTITY_MATCH_ALL,
SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_NEXT_TRACK,
SERVICE_MEDIA_PAUSE, SERVICE_MEDIA_PAUSE,
SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PLAY,
@ -32,7 +33,6 @@ from homeassistant.const import (
SERVICE_VOLUME_MUTE, SERVICE_VOLUME_MUTE,
SERVICE_VOLUME_SET, SERVICE_VOLUME_SET,
SERVICE_VOLUME_UP, SERVICE_VOLUME_UP,
ENTITY_MATCH_ALL,
) )
from homeassistant.loader import bind_hass from homeassistant.loader import bind_hass

View file

@ -1,14 +1,14 @@
"""The tests for the Async Media player helper functions.""" """The tests for the Async Media player helper functions."""
import unittest
import asyncio import asyncio
import unittest
import homeassistant.components.media_player as mp import homeassistant.components.media_player as mp
from homeassistant.const import ( from homeassistant.const import (
STATE_PLAYING,
STATE_PAUSED,
STATE_ON,
STATE_OFF,
STATE_IDLE, STATE_IDLE,
STATE_OFF,
STATE_ON,
STATE_PAUSED,
STATE_PLAYING,
) )
from tests.common import get_test_home_assistant from tests.common import get_test_home_assistant

View file

@ -1,25 +1,25 @@
"""The tests for Media player device conditions.""" """The tests for Media player device conditions."""
import pytest import pytest
import homeassistant.components.automation as automation
from homeassistant.components.media_player import DOMAIN from homeassistant.components.media_player import DOMAIN
from homeassistant.const import ( from homeassistant.const import (
STATE_ON,
STATE_OFF,
STATE_IDLE, STATE_IDLE,
STATE_OFF,
STATE_ON,
STATE_PAUSED, STATE_PAUSED,
STATE_PLAYING, STATE_PLAYING,
) )
from homeassistant.setup import async_setup_component
import homeassistant.components.automation as automation
from homeassistant.helpers import device_registry from homeassistant.helpers import device_registry
from homeassistant.setup import async_setup_component
from tests.common import ( from tests.common import (
MockConfigEntry, MockConfigEntry,
assert_lists_same, assert_lists_same,
async_get_device_automations,
async_mock_service, async_mock_service,
mock_device_registry, mock_device_registry,
mock_registry, mock_registry,
async_get_device_automations,
) )

View file

@ -2,8 +2,8 @@
import base64 import base64
from unittest.mock import patch from unittest.mock import patch
from homeassistant.setup import async_setup_component
from homeassistant.components.websocket_api.const import TYPE_RESULT from homeassistant.components.websocket_api.const import TYPE_RESULT
from homeassistant.setup import async_setup_component
from tests.common import mock_coro from tests.common import mock_coro

View file

@ -2,7 +2,6 @@
import pytest import pytest
from homeassistant.components.media_player.reproduce_state import async_reproduce_states
from homeassistant.components.media_player.const import ( from homeassistant.components.media_player.const import (
ATTR_INPUT_SOURCE, ATTR_INPUT_SOURCE,
ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_ID,
@ -17,6 +16,7 @@ from homeassistant.components.media_player.const import (
SERVICE_SELECT_SOUND_MODE, SERVICE_SELECT_SOUND_MODE,
SERVICE_SELECT_SOURCE, SERVICE_SELECT_SOURCE,
) )
from homeassistant.components.media_player.reproduce_state import async_reproduce_states
from homeassistant.const import ( from homeassistant.const import (
SERVICE_MEDIA_PAUSE, SERVICE_MEDIA_PAUSE,
SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PLAY,