Sort imports according to PEP8 for components starting with "C" (#29763)

This commit is contained in:
Bas Nijholt 2019-12-09 18:56:21 +01:00 committed by Franck Nijhof
parent 6cc75fc6f3
commit 080c702d4f
15 changed files with 30 additions and 33 deletions

View File

@ -17,7 +17,6 @@ from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.template import DATE_STR_FORMAT from homeassistant.helpers.template import DATE_STR_FORMAT
from homeassistant.util import dt from homeassistant.util import dt
# 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

@ -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_RECIPIENT from homeassistant.const import CONF_API_KEY, CONF_RECIPIENT
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = "clickatell" DEFAULT_NAME = "clickatell"

View File

@ -6,6 +6,7 @@ from aiohttp.hdrs import CONTENT_TYPE
import requests import requests
import voluptuous as vol import voluptuous as vol
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
from homeassistant.const import ( from homeassistant.const import (
CONF_API_KEY, CONF_API_KEY,
CONF_RECIPIENT, CONF_RECIPIENT,
@ -15,8 +16,6 @@ from homeassistant.const import (
) )
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
BASE_API_URL = "https://rest.clicksend.com/v3" BASE_API_URL = "https://rest.clicksend.com/v3"

View File

@ -6,6 +6,7 @@ from aiohttp.hdrs import CONTENT_TYPE
import requests import requests
import voluptuous as vol import voluptuous as vol
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
from homeassistant.const import ( from homeassistant.const import (
CONF_API_KEY, CONF_API_KEY,
CONF_RECIPIENT, CONF_RECIPIENT,
@ -14,8 +15,6 @@ from homeassistant.const import (
) )
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
BASE_API_URL = "https://rest.clicksend.com/v3" BASE_API_URL = "https://rest.clicksend.com/v3"

View File

@ -9,14 +9,14 @@ the user has submitted configuration information.
import functools as ft import functools as ft
import logging import logging
from homeassistant.core import callback as async_callback
from homeassistant.const import ( from homeassistant.const import (
EVENT_TIME_CHANGED,
ATTR_FRIENDLY_NAME,
ATTR_ENTITY_PICTURE, ATTR_ENTITY_PICTURE,
ATTR_FRIENDLY_NAME,
EVENT_TIME_CHANGED,
) )
from homeassistant.loader import bind_hass from homeassistant.core import callback as async_callback
from homeassistant.helpers.entity import async_generate_entity_id from homeassistant.helpers.entity import async_generate_entity_id
from homeassistant.loader import bind_hass
from homeassistant.util.async_ import run_callback_threadsafe from homeassistant.util.async_ import run_callback_threadsafe
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -11,7 +11,7 @@ from homeassistant.helpers import config_validation as cv, intent
from homeassistant.loader import bind_hass from homeassistant.loader import bind_hass
from .agent import AbstractConversationAgent from .agent import AbstractConversationAgent
from .default_agent import async_register, DefaultAgent from .default_agent import DefaultAgent, async_register
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -3,7 +3,7 @@
from pycoolmasternet import CoolMasterNet from pycoolmasternet import CoolMasterNet
import voluptuous as vol import voluptuous as vol
from homeassistant import core, config_entries from homeassistant import config_entries, core
from homeassistant.const import CONF_HOST, CONF_PORT from homeassistant.const import CONF_HOST, CONF_PORT
# pylint: disable=unused-import # pylint: disable=unused-import

View File

@ -1,14 +1,14 @@
"""Details about printers which are connected to CUPS.""" """Details about printers which are connected to CUPS."""
from datetime import timedelta
import importlib import importlib
import logging import logging
from datetime import timedelta
import voluptuous as vol import voluptuous as vol
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 CONF_HOST, CONF_PORT from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.exceptions import PlatformNotReady from homeassistant.exceptions import PlatformNotReady
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -5,15 +5,15 @@ import logging
import requests import requests
import voluptuous as vol import voluptuous as vol
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 (
CONF_API_KEY,
CONF_NAME,
CONF_BASE,
CONF_QUOTE,
ATTR_ATTRIBUTION, ATTR_ATTRIBUTION,
CONF_API_KEY,
CONF_BASE,
CONF_NAME,
CONF_QUOTE,
) )
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -1,9 +1,10 @@
"""The tests for the Canary component.""" """The tests for the Canary component."""
import unittest import unittest
from unittest.mock import patch, MagicMock, PropertyMock from unittest.mock import MagicMock, PropertyMock, patch
import homeassistant.components.canary as canary
from homeassistant import setup from homeassistant import setup
import homeassistant.components.canary as canary
from tests.common import get_test_home_assistant from tests.common import get_test_home_assistant

View File

@ -3,16 +3,16 @@ import copy
import unittest import unittest
from unittest.mock import Mock from unittest.mock import Mock
from homeassistant.components.canary import DATA_CANARY from homeassistant.components.canary import DATA_CANARY, sensor as canary
from homeassistant.components.canary import sensor as canary
from homeassistant.components.canary.sensor import ( from homeassistant.components.canary.sensor import (
CanarySensor,
SENSOR_TYPES,
ATTR_AIR_QUALITY, ATTR_AIR_QUALITY,
STATE_AIR_QUALITY_NORMAL, SENSOR_TYPES,
STATE_AIR_QUALITY_ABNORMAL, STATE_AIR_QUALITY_ABNORMAL,
STATE_AIR_QUALITY_NORMAL,
STATE_AIR_QUALITY_VERY_ABNORMAL, STATE_AIR_QUALITY_VERY_ABNORMAL,
CanarySensor,
) )
from tests.common import get_test_home_assistant from tests.common import get_test_home_assistant
from tests.components.canary.test_init import mock_device, mock_location from tests.components.canary.test_init import mock_device, mock_location

View File

@ -1,12 +1,12 @@
"""Tests for the CoinMarketCap sensor platform.""" """Tests for the CoinMarketCap sensor platform."""
import json import json
import unittest import unittest
from unittest.mock import patch from unittest.mock import patch
import homeassistant.components.sensor as sensor import homeassistant.components.sensor as sensor
from homeassistant.setup import setup_component from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant, load_fixture, assert_setup_component
from tests.common import assert_setup_component, get_test_home_assistant, load_fixture
VALID_CONFIG = { VALID_CONFIG = {
"platform": "coinmarketcap", "platform": "coinmarketcap",

View File

@ -3,7 +3,7 @@
import unittest import unittest
import homeassistant.components.configurator as configurator import homeassistant.components.configurator as configurator
from homeassistant.const import EVENT_TIME_CHANGED, ATTR_FRIENDLY_NAME from homeassistant.const import ATTR_FRIENDLY_NAME, EVENT_TIME_CHANGED
from tests.common import get_test_home_assistant from tests.common import get_test_home_assistant

View File

@ -1,10 +1,10 @@
"""The tests for the Conversation component.""" """The tests for the Conversation component."""
import pytest import pytest
from homeassistant.core import DOMAIN as HASS_DOMAIN, Context
from homeassistant.setup import async_setup_component
from homeassistant.components import conversation from homeassistant.components import conversation
from homeassistant.core import DOMAIN as HASS_DOMAIN, Context
from homeassistant.helpers import intent from homeassistant.helpers import intent
from homeassistant.setup import async_setup_component
from tests.common import async_mock_intent, async_mock_service from tests.common import async_mock_intent, async_mock_service

View File

@ -2,7 +2,7 @@
from unittest.mock import patch from unittest.mock import patch
from homeassistant import config_entries, setup from homeassistant import config_entries, setup
from homeassistant.components.coolmaster.const import DOMAIN, AVAILABLE_MODES from homeassistant.components.coolmaster.const import AVAILABLE_MODES, DOMAIN
from tests.common import mock_coro from tests.common import mock_coro