mirror of
https://github.com/home-assistant/core
synced 2024-09-03 08:14:07 +02:00
Sort imports according to PEP8 for components starting with "T" (#29778)
This commit is contained in:
parent
485761bbaf
commit
de915e1bf0
@ -1,23 +1,23 @@
|
||||
"""Support for TCP socket based sensors."""
|
||||
import logging
|
||||
import socket
|
||||
import select
|
||||
import socket
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import (
|
||||
CONF_NAME,
|
||||
CONF_HOST,
|
||||
CONF_PORT,
|
||||
CONF_NAME,
|
||||
CONF_PAYLOAD,
|
||||
CONF_PORT,
|
||||
CONF_TIMEOUT,
|
||||
CONF_UNIT_OF_MEASUREMENT,
|
||||
CONF_VALUE_TEMPLATE,
|
||||
)
|
||||
from homeassistant.exceptions import TemplateError
|
||||
from homeassistant.helpers.entity import Entity
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
"""Support for TekSavvy Bandwidth Monitor."""
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
import async_timeout
|
||||
|
||||
import async_timeout
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
|
@ -3,8 +3,6 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import ATTR_LOCATION
|
||||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
ATTR_MESSAGE,
|
||||
@ -13,6 +11,7 @@ from homeassistant.components.notify import (
|
||||
PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import ATTR_LOCATION
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
"""Support to send and receive Telegram messages."""
|
||||
import io
|
||||
from ipaddress import ip_network
|
||||
from functools import partial
|
||||
import importlib
|
||||
import io
|
||||
from ipaddress import ip_network
|
||||
import logging
|
||||
|
||||
import requests
|
||||
@ -26,11 +26,11 @@ from homeassistant.const import (
|
||||
CONF_API_KEY,
|
||||
CONF_PLATFORM,
|
||||
CONF_TIMEOUT,
|
||||
HTTP_DIGEST_AUTHENTICATION,
|
||||
CONF_URL,
|
||||
HTTP_DIGEST_AUTHENTICATION,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.exceptions import TemplateError
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
import logging
|
||||
|
||||
from telegram import Update
|
||||
from telegram.error import TelegramError, TimedOut, NetworkError, RetryAfter
|
||||
from telegram.ext import Updater, Handler
|
||||
from telegram.error import NetworkError, RetryAfter, TelegramError, TimedOut
|
||||
from telegram.ext import Handler, Updater
|
||||
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
|
||||
from homeassistant.core import callback
|
||||
|
@ -16,9 +16,9 @@ from homeassistant.const import (
|
||||
CONF_COMMAND_STATE,
|
||||
CONF_NAME,
|
||||
CONF_PORT,
|
||||
CONF_TIMEOUT,
|
||||
CONF_RESOURCE,
|
||||
CONF_SWITCHES,
|
||||
CONF_TIMEOUT,
|
||||
CONF_VALUE_TEMPLATE,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
@ -5,13 +5,13 @@ import telnetlib
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.device_tracker import (
|
||||
DOMAIN,
|
||||
PLATFORM_SCHEMA,
|
||||
DeviceScanner,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
"""Support for Tile® Bluetooth trackers."""
|
||||
import logging
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
from pytile import async_login
|
||||
from pytile.errors import SessionExpiredError, TileError
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.device_tracker import PLATFORM_SCHEMA
|
||||
from homeassistant.const import CONF_USERNAME, CONF_MONITORED_VARIABLES, CONF_PASSWORD
|
||||
from homeassistant.const import CONF_MONITORED_VARIABLES, CONF_PASSWORD, CONF_USERNAME
|
||||
from homeassistant.helpers import aiohttp_client, config_validation as cv
|
||||
from homeassistant.helpers.event import async_track_time_interval
|
||||
from homeassistant.util import slugify
|
||||
|
@ -4,13 +4,13 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import CONF_DISPLAY_OPTIONS
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.core import callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.event import async_track_point_in_utc_time
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -16,8 +16,8 @@ from .const import (
|
||||
ALL_TASKS,
|
||||
CHECKED,
|
||||
COMPLETED,
|
||||
CONF_PROJECT_DUE_DATE,
|
||||
CONF_EXTRA_PROJECTS,
|
||||
CONF_PROJECT_DUE_DATE,
|
||||
CONF_PROJECT_LABEL_WHITELIST,
|
||||
CONF_PROJECT_WHITELIST,
|
||||
CONTENT,
|
||||
|
@ -6,7 +6,6 @@ import re
|
||||
import requests
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.device_tracker import (
|
||||
DOMAIN,
|
||||
PLATFORM_SCHEMA,
|
||||
@ -14,12 +13,13 @@ from homeassistant.components.device_tracker import (
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_HOST,
|
||||
CONF_PASSWORD,
|
||||
CONF_PORT,
|
||||
CONF_SSL,
|
||||
CONF_VERIFY_SSL,
|
||||
CONF_PASSWORD,
|
||||
CONF_USERNAME,
|
||||
CONF_VERIFY_SSL,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
CONF_HTTP_ID = "http_id"
|
||||
|
||||
|
@ -4,12 +4,12 @@ import re
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.components.http import HomeAssistantView
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import CONF_EMAIL, CONF_NAME
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.core import callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
"""The totalconnect component."""
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
from total_connect_client import TotalConnectClient
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import discovery
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||
|
||||
from homeassistant.helpers import discovery
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -13,8 +13,8 @@ from .common import (
|
||||
CONF_DIMMER,
|
||||
CONF_DISCOVERY,
|
||||
CONF_LIGHT,
|
||||
CONF_SWITCH,
|
||||
CONF_STRIP,
|
||||
CONF_SWITCH,
|
||||
SmartDevices,
|
||||
async_discover_devices,
|
||||
get_static_devices,
|
||||
|
@ -11,8 +11,8 @@ from homeassistant.const import (
|
||||
CONF_API_KEY,
|
||||
CONF_NAME,
|
||||
CONF_WEEKDAY,
|
||||
WEEKDAYS,
|
||||
DEVICE_CLASS_TIMESTAMP,
|
||||
WEEKDAYS,
|
||||
)
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
@ -22,12 +22,12 @@ from homeassistant.helpers.event import async_track_time_interval
|
||||
|
||||
from .const import (
|
||||
ATTR_TORRENT,
|
||||
DATA_UPDATED,
|
||||
DEFAULT_NAME,
|
||||
DEFAULT_PORT,
|
||||
DEFAULT_SCAN_INTERVAL,
|
||||
DOMAIN,
|
||||
SERVICE_ADD_TORRENT,
|
||||
DATA_UPDATED,
|
||||
)
|
||||
from .errors import AuthenticationError, CannotConnect, UnknownError
|
||||
|
||||
|
@ -8,7 +8,6 @@ from homeassistant.helpers.entity import Entity
|
||||
|
||||
from .const import DOMAIN, SENSOR_TYPES, STATE_ATTR_TORRENT_INFO
|
||||
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
from TransportNSW import TransportNSW
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import ATTR_ATTRIBUTION, ATTR_MODE, CONF_API_KEY, CONF_NAME
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import ATTR_MODE, CONF_NAME, CONF_API_KEY, ATTR_ATTRIBUTION
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -9,15 +9,14 @@ import os
|
||||
from TwitterAPI import TwitterAPI
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_USERNAME
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.event import async_track_point_in_time
|
||||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_USERNAME
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.event import async_track_point_in_time
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
"""Tests for the TekSavvy sensor platform."""
|
||||
import asyncio
|
||||
|
||||
from homeassistant.bootstrap import async_setup_component
|
||||
from homeassistant.components.teksavvy.sensor import TekSavvyData
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
|
@ -1,8 +1,8 @@
|
||||
"""The test for the threshold sensor platform."""
|
||||
import unittest
|
||||
|
||||
from homeassistant.setup import setup_component
|
||||
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, STATE_UNKNOWN, TEMP_CELSIUS
|
||||
from homeassistant.setup import setup_component
|
||||
|
||||
from tests.common import get_test_home_assistant
|
||||
|
||||
|
@ -1,31 +1,31 @@
|
||||
"""The tests for the timer component."""
|
||||
# pylint: disable=protected-access
|
||||
import asyncio
|
||||
import logging
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
from homeassistant.core import CoreState
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.components.timer import (
|
||||
DOMAIN,
|
||||
ATTR_DURATION,
|
||||
CONF_DURATION,
|
||||
CONF_ICON,
|
||||
CONF_NAME,
|
||||
DOMAIN,
|
||||
EVENT_TIMER_CANCELLED,
|
||||
EVENT_TIMER_FINISHED,
|
||||
EVENT_TIMER_PAUSED,
|
||||
EVENT_TIMER_RESTARTED,
|
||||
EVENT_TIMER_STARTED,
|
||||
SERVICE_CANCEL,
|
||||
SERVICE_FINISH,
|
||||
SERVICE_PAUSE,
|
||||
SERVICE_START,
|
||||
STATUS_ACTIVE,
|
||||
STATUS_IDLE,
|
||||
STATUS_PAUSED,
|
||||
CONF_ICON,
|
||||
ATTR_DURATION,
|
||||
EVENT_TIMER_FINISHED,
|
||||
EVENT_TIMER_CANCELLED,
|
||||
EVENT_TIMER_STARTED,
|
||||
EVENT_TIMER_RESTARTED,
|
||||
EVENT_TIMER_PAUSED,
|
||||
SERVICE_START,
|
||||
SERVICE_PAUSE,
|
||||
SERVICE_CANCEL,
|
||||
SERVICE_FINISH,
|
||||
)
|
||||
from homeassistant.const import ATTR_ICON, ATTR_FRIENDLY_NAME, CONF_ENTITY_ID
|
||||
from homeassistant.const import ATTR_FRIENDLY_NAME, ATTR_ICON, CONF_ENTITY_ID
|
||||
from homeassistant.core import CoreState
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from tests.common import async_fire_time_changed
|
||||
|
@ -9,6 +9,7 @@ from homeassistant.components.timer import (
|
||||
STATUS_PAUSED,
|
||||
)
|
||||
from homeassistant.core import State
|
||||
|
||||
from tests.common import async_mock_service
|
||||
|
||||
|
||||
|
@ -1,16 +1,18 @@
|
||||
"""Test Times of the Day Binary Sensor."""
|
||||
from datetime import datetime, timedelta
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
from datetime import timedelta, datetime
|
||||
|
||||
import pytz
|
||||
|
||||
from homeassistant import setup
|
||||
import homeassistant.core as ha
|
||||
from homeassistant.const import STATE_OFF, STATE_ON
|
||||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.setup import setup_component
|
||||
from tests.common import get_test_home_assistant, assert_setup_component
|
||||
import homeassistant.core as ha
|
||||
from homeassistant.helpers.sun import get_astral_event_date, get_astral_event_next
|
||||
from homeassistant.setup import setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from tests.common import assert_setup_component, get_test_home_assistant
|
||||
|
||||
|
||||
class TestBinarySensorTod(unittest.TestCase):
|
||||
|
@ -1,5 +1,6 @@
|
||||
"""The tests for the Tomato device tracker platform."""
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
import requests_mock
|
||||
@ -9,11 +10,11 @@ from homeassistant.components.device_tracker import DOMAIN
|
||||
import homeassistant.components.tomato.device_tracker as tomato
|
||||
from homeassistant.const import (
|
||||
CONF_HOST,
|
||||
CONF_USERNAME,
|
||||
CONF_PASSWORD,
|
||||
CONF_PLATFORM,
|
||||
CONF_PORT,
|
||||
CONF_SSL,
|
||||
CONF_PLATFORM,
|
||||
CONF_USERNAME,
|
||||
CONF_VERIFY_SSL,
|
||||
)
|
||||
|
||||
|
@ -6,7 +6,7 @@ import pytest
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant.components.tradfri import config_flow
|
||||
|
||||
from tests.common import mock_coro, MockConfigEntry
|
||||
from tests.common import MockConfigEntry, mock_coro
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""Tradfri lights platform tests."""
|
||||
|
||||
from copy import deepcopy
|
||||
from unittest.mock import Mock, MagicMock, patch, PropertyMock
|
||||
from unittest.mock import MagicMock, Mock, PropertyMock, patch
|
||||
|
||||
import pytest
|
||||
from pytradfri.device import Device
|
||||
@ -12,7 +12,6 @@ from homeassistant.components import tradfri
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
DEFAULT_TEST_FEATURES = {
|
||||
"can_set_dimmer": False,
|
||||
"can_set_color": False,
|
||||
|
@ -5,7 +5,7 @@ from unittest.mock import patch
|
||||
from homeassistant import setup
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from tests.common import get_test_home_assistant, assert_setup_component
|
||||
from tests.common import assert_setup_component, get_test_home_assistant
|
||||
|
||||
|
||||
class TestTrendBinarySensor:
|
||||
|
@ -2,27 +2,27 @@
|
||||
import ctypes
|
||||
import os
|
||||
import shutil
|
||||
from unittest.mock import patch, PropertyMock
|
||||
from unittest.mock import PropertyMock, patch
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
|
||||
import homeassistant.components.http as http
|
||||
import homeassistant.components.tts as tts
|
||||
from homeassistant.components.demo.tts import DemoProvider
|
||||
import homeassistant.components.http as http
|
||||
from homeassistant.components.media_player.const import (
|
||||
SERVICE_PLAY_MEDIA,
|
||||
MEDIA_TYPE_MUSIC,
|
||||
ATTR_MEDIA_CONTENT_ID,
|
||||
ATTR_MEDIA_CONTENT_TYPE,
|
||||
DOMAIN as DOMAIN_MP,
|
||||
MEDIA_TYPE_MUSIC,
|
||||
SERVICE_PLAY_MEDIA,
|
||||
)
|
||||
from homeassistant.setup import setup_component, async_setup_component
|
||||
import homeassistant.components.tts as tts
|
||||
from homeassistant.setup import async_setup_component, setup_component
|
||||
|
||||
from tests.common import (
|
||||
assert_setup_component,
|
||||
get_test_home_assistant,
|
||||
get_test_instance_port,
|
||||
assert_setup_component,
|
||||
mock_service,
|
||||
)
|
||||
|
||||
|
@ -4,6 +4,7 @@ from unittest.mock import patch
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant.components import twilio
|
||||
from homeassistant.core import callback
|
||||
|
||||
from tests.common import MockDependency
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user