mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Sort imports according to PEP8 for components starting with "Y" (#29783)
This commit is contained in:
parent
4035fda659
commit
9bcd4653e0
@ -3,11 +3,11 @@ import logging
|
|||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from yalesmartalarmclient.client import (
|
from yalesmartalarmclient.client import (
|
||||||
YaleSmartAlarmClient,
|
|
||||||
AuthenticationError,
|
|
||||||
YALE_STATE_DISARM,
|
|
||||||
YALE_STATE_ARM_PARTIAL,
|
|
||||||
YALE_STATE_ARM_FULL,
|
YALE_STATE_ARM_FULL,
|
||||||
|
YALE_STATE_ARM_PARTIAL,
|
||||||
|
YALE_STATE_DISARM,
|
||||||
|
AuthenticationError,
|
||||||
|
YaleSmartAlarmClient,
|
||||||
)
|
)
|
||||||
|
|
||||||
from homeassistant.components.alarm_control_panel import (
|
from homeassistant.components.alarm_control_panel import (
|
||||||
|
@ -5,7 +5,7 @@ import requests
|
|||||||
import rxv
|
import rxv
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
|
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
|
||||||
from homeassistant.components.media_player.const import (
|
from homeassistant.components.media_player.const import (
|
||||||
MEDIA_TYPE_MUSIC,
|
MEDIA_TYPE_MUSIC,
|
||||||
SUPPORT_NEXT_TRACK,
|
SUPPORT_NEXT_TRACK,
|
||||||
@ -13,15 +13,14 @@ from homeassistant.components.media_player.const import (
|
|||||||
SUPPORT_PLAY,
|
SUPPORT_PLAY,
|
||||||
SUPPORT_PLAY_MEDIA,
|
SUPPORT_PLAY_MEDIA,
|
||||||
SUPPORT_PREVIOUS_TRACK,
|
SUPPORT_PREVIOUS_TRACK,
|
||||||
|
SUPPORT_SELECT_SOUND_MODE,
|
||||||
SUPPORT_SELECT_SOURCE,
|
SUPPORT_SELECT_SOURCE,
|
||||||
SUPPORT_STOP,
|
SUPPORT_STOP,
|
||||||
SUPPORT_TURN_OFF,
|
SUPPORT_TURN_OFF,
|
||||||
SUPPORT_TURN_ON,
|
SUPPORT_TURN_ON,
|
||||||
SUPPORT_VOLUME_MUTE,
|
SUPPORT_VOLUME_MUTE,
|
||||||
SUPPORT_VOLUME_SET,
|
SUPPORT_VOLUME_SET,
|
||||||
SUPPORT_SELECT_SOUND_MODE,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
CONF_HOST,
|
CONF_HOST,
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
"""Support for Yamaha MusicCast Receivers."""
|
"""Support for Yamaha MusicCast Receivers."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
import pymusiccast
|
import pymusiccast
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
|
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
|
||||||
from homeassistant.components.media_player.const import (
|
from homeassistant.components.media_player.const import (
|
||||||
MEDIA_TYPE_MUSIC,
|
MEDIA_TYPE_MUSIC,
|
||||||
SUPPORT_NEXT_TRACK,
|
SUPPORT_NEXT_TRACK,
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
"""Service for obtaining information about closer bus from Transport Yandex Service."""
|
"""Service for obtaining information about closer bus from Transport Yandex Service."""
|
||||||
|
|
||||||
import logging
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from ya_ma import YandexMapsRequester
|
from ya_ma import YandexMapsRequester
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
import homeassistant.util.dt as dt_util
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||||
from homeassistant.const import CONF_NAME, ATTR_ATTRIBUTION, DEVICE_CLASS_TIMESTAMP
|
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME, DEVICE_CLASS_TIMESTAMP
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
|
import homeassistant.util.dt as dt_util
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
"""Support for Yeelight Sunflower color bulbs (not Yeelight Blue or WiFi)."""
|
"""Support for Yeelight Sunflower color bulbs (not Yeelight Blue or WiFi)."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import yeelightsunflower
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
import yeelightsunflower
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
Light,
|
|
||||||
ATTR_HS_COLOR,
|
|
||||||
SUPPORT_COLOR,
|
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
SUPPORT_BRIGHTNESS,
|
ATTR_HS_COLOR,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
|
SUPPORT_BRIGHTNESS,
|
||||||
|
SUPPORT_COLOR,
|
||||||
|
Light,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_HOST
|
from homeassistant.const import CONF_HOST
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
import homeassistant.util.color as color_util
|
import homeassistant.util.color as color_util
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
"""Support for the YesssSMS platform."""
|
"""Support for the YesssSMS platform."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from YesssSMS import YesssSMS
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from YesssSMS import YesssSMS
|
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
|
||||||
|
|
||||||
from homeassistant.const import CONF_PASSWORD, CONF_RECIPIENT, CONF_USERNAME
|
from homeassistant.const import CONF_PASSWORD, CONF_RECIPIENT, CONF_USERNAME
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
|
|
||||||
|
|
||||||
|
|
||||||
from .const import CONF_PROVIDER
|
from .const import CONF_PROVIDER
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -1,23 +1,21 @@
|
|||||||
"""Support for Yr.no weather service."""
|
"""Support for Yr.no weather service."""
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from random import randrange
|
from random import randrange
|
||||||
from xml.parsers.expat import ExpatError
|
from xml.parsers.expat import ExpatError
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import async_timeout
|
import async_timeout
|
||||||
import xmltodict
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
import xmltodict
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
|
ATTR_ATTRIBUTION,
|
||||||
|
CONF_ELEVATION,
|
||||||
CONF_LATITUDE,
|
CONF_LATITUDE,
|
||||||
CONF_LONGITUDE,
|
CONF_LONGITUDE,
|
||||||
CONF_ELEVATION,
|
|
||||||
CONF_MONITORED_CONDITIONS,
|
CONF_MONITORED_CONDITIONS,
|
||||||
ATTR_ATTRIBUTION,
|
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
DEVICE_CLASS_HUMIDITY,
|
DEVICE_CLASS_HUMIDITY,
|
||||||
DEVICE_CLASS_PRESSURE,
|
DEVICE_CLASS_PRESSURE,
|
||||||
@ -26,8 +24,9 @@ from homeassistant.const import (
|
|||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.helpers.event import async_track_utc_time_change, async_call_later
|
from homeassistant.helpers.event import async_call_later, async_track_utc_time_change
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
"""The tests for the Yamaha Media player platform."""
|
"""The tests for the Yamaha Media player platform."""
|
||||||
import unittest
|
import unittest
|
||||||
from unittest.mock import patch, MagicMock
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
from homeassistant.setup import setup_component
|
|
||||||
import homeassistant.components.media_player as mp
|
import homeassistant.components.media_player as mp
|
||||||
from homeassistant.components.yamaha import media_player as yamaha
|
from homeassistant.components.yamaha import media_player as yamaha
|
||||||
|
from homeassistant.setup import setup_component
|
||||||
|
|
||||||
from tests.common import get_test_home_assistant
|
from tests.common import get_test_home_assistant
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
"""Tests for the yandex transport platform."""
|
"""Tests for the yandex transport platform."""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import homeassistant.components.sensor as sensor
|
import homeassistant.components.sensor as sensor
|
||||||
import homeassistant.util.dt as dt_util
|
|
||||||
from homeassistant.const import CONF_NAME
|
from homeassistant.const import CONF_NAME
|
||||||
|
import homeassistant.util.dt as dt_util
|
||||||
|
|
||||||
from tests.common import (
|
from tests.common import (
|
||||||
|
MockDependency,
|
||||||
assert_setup_component,
|
assert_setup_component,
|
||||||
async_setup_component,
|
async_setup_component,
|
||||||
MockDependency,
|
|
||||||
load_fixture,
|
load_fixture,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -3,14 +3,14 @@ import asyncio
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
from homeassistant.components.media_player.const import (
|
||||||
|
DOMAIN as DOMAIN_MP,
|
||||||
|
SERVICE_PLAY_MEDIA,
|
||||||
|
)
|
||||||
import homeassistant.components.tts as tts
|
import homeassistant.components.tts as tts
|
||||||
from homeassistant.setup import setup_component
|
from homeassistant.setup import setup_component
|
||||||
from homeassistant.components.media_player.const import (
|
|
||||||
SERVICE_PLAY_MEDIA,
|
|
||||||
DOMAIN as DOMAIN_MP,
|
|
||||||
)
|
|
||||||
from tests.common import get_test_home_assistant, assert_setup_component, mock_service
|
|
||||||
|
|
||||||
|
from tests.common import assert_setup_component, get_test_home_assistant, mock_service
|
||||||
from tests.components.tts.test_init import mutagen_mock # noqa: F401
|
from tests.components.tts.test_init import mutagen_mock # noqa: F401
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
"""The tests for the notify yessssms platform."""
|
"""The tests for the notify yessssms platform."""
|
||||||
|
import logging
|
||||||
import unittest
|
import unittest
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import logging
|
|
||||||
import pytest
|
import pytest
|
||||||
import requests_mock
|
import requests_mock
|
||||||
|
|
||||||
from homeassistant.setup import async_setup_component
|
|
||||||
import homeassistant.components.yessssms.notify as yessssms
|
|
||||||
from homeassistant.components.yessssms.const import CONF_PROVIDER
|
from homeassistant.components.yessssms.const import CONF_PROVIDER
|
||||||
|
import homeassistant.components.yessssms.notify as yessssms
|
||||||
from homeassistant.const import CONF_PASSWORD, CONF_RECIPIENT, CONF_USERNAME
|
from homeassistant.const import CONF_PASSWORD, CONF_RECIPIENT, CONF_USERNAME
|
||||||
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="config")
|
@pytest.fixture(name="config")
|
||||||
|
@ -5,8 +5,8 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
from homeassistant.bootstrap import async_setup_component
|
from homeassistant.bootstrap import async_setup_component
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
from tests.common import assert_setup_component, load_fixture
|
|
||||||
|
|
||||||
|
from tests.common import assert_setup_component, load_fixture
|
||||||
|
|
||||||
NOW = datetime(2016, 6, 9, 1, tzinfo=dt_util.UTC)
|
NOW = datetime(2016, 6, 9, 1, tzinfo=dt_util.UTC)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user