mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Sort imports according to PEP8 for components starting with "L" (#29771)
This commit is contained in:
parent
14779ce3d0
commit
1dea0c9e34
@ -5,14 +5,13 @@ from urllib.parse import urlencode
|
|||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_PORT
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
|
|
||||||
from homeassistant.components.notify import (
|
from homeassistant.components.notify import (
|
||||||
ATTR_DATA,
|
ATTR_DATA,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
BaseNotificationService,
|
BaseNotificationService,
|
||||||
)
|
)
|
||||||
|
from homeassistant.const import CONF_HOST, CONF_PORT
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
ATTR_METHOD = "method"
|
ATTR_METHOD = "method"
|
||||||
ATTR_METHOD_DEFAULT = "speak"
|
ATTR_METHOD_DEFAULT = "speak"
|
||||||
|
@ -4,7 +4,6 @@ import logging
|
|||||||
import pypck
|
import pypck
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
from homeassistant.components.climate import DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP
|
from homeassistant.components.climate import DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_ADDRESS,
|
CONF_ADDRESS,
|
||||||
@ -22,6 +21,7 @@ from homeassistant.const import (
|
|||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
TEMP_FAHRENHEIT,
|
TEMP_FAHRENHEIT,
|
||||||
)
|
)
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.discovery import async_load_platform
|
from homeassistant.helpers.discovery import async_load_platform
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
import pypck
|
import pypck
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_ADDRESS,
|
CONF_ADDRESS,
|
||||||
CONF_BRIGHTNESS,
|
CONF_BRIGHTNESS,
|
||||||
CONF_STATE,
|
CONF_STATE,
|
||||||
CONF_UNIT_OF_MEASUREMENT,
|
CONF_UNIT_OF_MEASUREMENT,
|
||||||
)
|
)
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
CONF_CONNECTIONS,
|
CONF_CONNECTIONS,
|
||||||
|
@ -8,7 +8,7 @@ import async_timeout
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.scene import Scene
|
from homeassistant.components.scene import Scene
|
||||||
from homeassistant.const import CONF_TOKEN, CONF_TIMEOUT, CONF_PLATFORM
|
from homeassistant.const import CONF_PLATFORM, CONF_TIMEOUT, CONF_TOKEN
|
||||||
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
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
|
@ -4,13 +4,13 @@ import logging
|
|||||||
import requests
|
import requests
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
from homeassistant.components.device_tracker import (
|
from homeassistant.components.device_tracker import (
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
DeviceScanner,
|
DeviceScanner,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_HOST
|
from homeassistant.const import CONF_HOST
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
DEFAULT_TIMEOUT = 10
|
DEFAULT_TIMEOUT = 10
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import pyteleloisirs
|
|||||||
import requests
|
import requests
|
||||||
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_CHANNEL,
|
MEDIA_TYPE_CHANNEL,
|
||||||
SUPPORT_NEXT_TRACK,
|
SUPPORT_NEXT_TRACK,
|
||||||
|
@ -4,11 +4,10 @@ import logging
|
|||||||
import requests
|
import requests
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
|
||||||
from homeassistant.const import CONF_API_KEY, CONF_DEVICE
|
from homeassistant.const import CONF_API_KEY, CONF_DEVICE
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
|
|
||||||
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
_RESOURCE = "https://llamalab.com/automate/cloud/message"
|
_RESOURCE = "https://llamalab.com/automate/cloud/message"
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@ import os
|
|||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.const import CONF_NAME, ATTR_ENTITY_ID
|
|
||||||
from homeassistant.components.camera import (
|
from homeassistant.components.camera import (
|
||||||
Camera,
|
|
||||||
CAMERA_SERVICE_SCHEMA,
|
CAMERA_SERVICE_SCHEMA,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
|
Camera,
|
||||||
)
|
)
|
||||||
|
from homeassistant.const import ATTR_ENTITY_ID, CONF_NAME
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
|
@ -4,9 +4,9 @@ import logging
|
|||||||
import requests
|
import requests
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
from homeassistant.components.lock import PLATFORM_SCHEMA, LockDevice
|
||||||
from homeassistant.components.lock import LockDevice, PLATFORM_SCHEMA
|
|
||||||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_ID
|
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_ID
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
"""Support for sending data to Logentries webhook endpoint."""
|
"""Support for sending data to Logentries webhook endpoint."""
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import requests
|
|
||||||
|
|
||||||
|
import requests
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
from homeassistant.const import CONF_TOKEN, EVENT_STATE_CHANGED
|
from homeassistant.const import CONF_TOKEN, EVENT_STATE_CHANGED
|
||||||
from homeassistant.helpers import state as state_helper
|
from homeassistant.helpers import state as state_helper
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""Support for settting the level of logging for components."""
|
"""Support for settting the level of logging for components."""
|
||||||
import logging
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import logging
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from homeassistant.components import litejet
|
from homeassistant.components import litejet
|
||||||
|
|
||||||
from tests.common import get_test_home_assistant
|
from tests.common import get_test_home_assistant
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -1,30 +1,13 @@
|
|||||||
"""The tests for the logbook component."""
|
"""The tests for the logbook component."""
|
||||||
# pylint: disable=protected-access,invalid-name
|
# pylint: disable=protected-access,invalid-name
|
||||||
|
from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta, datetime
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components import sun
|
from homeassistant.components import logbook, recorder, sun
|
||||||
import homeassistant.core as ha
|
|
||||||
from homeassistant.const import (
|
|
||||||
ATTR_ENTITY_ID,
|
|
||||||
ATTR_SERVICE,
|
|
||||||
ATTR_NAME,
|
|
||||||
EVENT_STATE_CHANGED,
|
|
||||||
EVENT_HOMEASSISTANT_START,
|
|
||||||
EVENT_HOMEASSISTANT_STOP,
|
|
||||||
EVENT_AUTOMATION_TRIGGERED,
|
|
||||||
EVENT_SCRIPT_STARTED,
|
|
||||||
ATTR_HIDDEN,
|
|
||||||
STATE_NOT_HOME,
|
|
||||||
STATE_ON,
|
|
||||||
STATE_OFF,
|
|
||||||
)
|
|
||||||
import homeassistant.util.dt as dt_util
|
|
||||||
from homeassistant.components import logbook, recorder
|
|
||||||
from homeassistant.components.alexa.smart_home import EVENT_ALEXA_SMART_HOME
|
from homeassistant.components.alexa.smart_home import EVENT_ALEXA_SMART_HOME
|
||||||
from homeassistant.components.homekit.const import (
|
from homeassistant.components.homekit.const import (
|
||||||
ATTR_DISPLAY_NAME,
|
ATTR_DISPLAY_NAME,
|
||||||
@ -32,10 +15,25 @@ from homeassistant.components.homekit.const import (
|
|||||||
DOMAIN as DOMAIN_HOMEKIT,
|
DOMAIN as DOMAIN_HOMEKIT,
|
||||||
EVENT_HOMEKIT_CHANGED,
|
EVENT_HOMEKIT_CHANGED,
|
||||||
)
|
)
|
||||||
from homeassistant.setup import setup_component, async_setup_component
|
from homeassistant.const import (
|
||||||
|
ATTR_ENTITY_ID,
|
||||||
from tests.common import init_recorder_component, get_test_home_assistant
|
ATTR_HIDDEN,
|
||||||
|
ATTR_NAME,
|
||||||
|
ATTR_SERVICE,
|
||||||
|
EVENT_AUTOMATION_TRIGGERED,
|
||||||
|
EVENT_HOMEASSISTANT_START,
|
||||||
|
EVENT_HOMEASSISTANT_STOP,
|
||||||
|
EVENT_SCRIPT_STARTED,
|
||||||
|
EVENT_STATE_CHANGED,
|
||||||
|
STATE_NOT_HOME,
|
||||||
|
STATE_OFF,
|
||||||
|
STATE_ON,
|
||||||
|
)
|
||||||
|
import homeassistant.core as ha
|
||||||
|
from homeassistant.setup import async_setup_component, setup_component
|
||||||
|
import homeassistant.util.dt as dt_util
|
||||||
|
|
||||||
|
from tests.common import get_test_home_assistant, init_recorder_component
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
import unittest
|
import unittest
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from homeassistant.setup import setup_component
|
|
||||||
import homeassistant.components.logentries as logentries
|
import homeassistant.components.logentries as logentries
|
||||||
from homeassistant.const import STATE_ON, STATE_OFF, EVENT_STATE_CHANGED
|
from homeassistant.const import EVENT_STATE_CHANGED, STATE_OFF, STATE_ON
|
||||||
|
from homeassistant.setup import setup_component
|
||||||
|
|
||||||
from tests.common import get_test_home_assistant
|
from tests.common import get_test_home_assistant
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ from collections import namedtuple
|
|||||||
import logging
|
import logging
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from homeassistant.setup import setup_component
|
|
||||||
from homeassistant.components import logger
|
from homeassistant.components import logger
|
||||||
|
from homeassistant.setup import setup_component
|
||||||
|
|
||||||
from tests.common import get_test_home_assistant
|
from tests.common import get_test_home_assistant
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ from homeassistant import data_entry_flow
|
|||||||
from homeassistant.components.logi_circle import config_flow
|
from homeassistant.components.logi_circle import config_flow
|
||||||
from homeassistant.components.logi_circle.config_flow import (
|
from homeassistant.components.logi_circle.config_flow import (
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
LogiCircleAuthCallbackView,
|
|
||||||
AuthorizationFailed,
|
AuthorizationFailed,
|
||||||
|
LogiCircleAuthCallbackView,
|
||||||
)
|
)
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
"""The tests for the tube_state platform."""
|
"""The tests for the tube_state platform."""
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import requests_mock
|
import requests_mock
|
||||||
|
|
||||||
from homeassistant.components.london_air.sensor import CONF_LOCATIONS, URL
|
from homeassistant.components.london_air.sensor import CONF_LOCATIONS, URL
|
||||||
from homeassistant.setup import setup_component
|
from homeassistant.setup import setup_component
|
||||||
from tests.common import load_fixture, get_test_home_assistant
|
|
||||||
|
from tests.common import get_test_home_assistant, load_fixture
|
||||||
|
|
||||||
VALID_CONFIG = {"platform": "london_air", CONF_LOCATIONS: ["Merton"]}
|
VALID_CONFIG = {"platform": "london_air", CONF_LOCATIONS: ["Merton"]}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
"""Test the Lovelace initialization."""
|
"""Test the Lovelace initialization."""
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from homeassistant.setup import async_setup_component
|
|
||||||
from homeassistant.components import frontend, lovelace
|
from homeassistant.components import frontend, lovelace
|
||||||
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from tests.common import get_system_health_info, async_capture_events
|
from tests.common import async_capture_events, get_system_health_info
|
||||||
|
|
||||||
|
|
||||||
async def test_lovelace_from_storage(hass, hass_ws_client, hass_storage):
|
async def test_lovelace_from_storage(hass, hass_ws_client, hass_storage):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user