sort imports according to PEP8 for lock (#29663)

This commit is contained in:
Bas Nijholt 2019-12-09 12:19:11 +01:00 committed by Franck Nijhof
parent eb47c2b148
commit 3b0f29fe95
9 changed files with 46 additions and 41 deletions

View File

@ -5,26 +5,25 @@ import logging
import voluptuous as vol import voluptuous as vol
from homeassistant.loader import bind_hass from homeassistant.components import group
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.config_validation import ( # noqa: F401
make_entity_service_schema,
PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.const import ( from homeassistant.const import (
ATTR_CODE, ATTR_CODE,
ATTR_CODE_FORMAT, ATTR_CODE_FORMAT,
SERVICE_LOCK,
SERVICE_OPEN,
SERVICE_UNLOCK,
STATE_LOCKED, STATE_LOCKED,
STATE_UNLOCKED, STATE_UNLOCKED,
SERVICE_LOCK,
SERVICE_UNLOCK,
SERVICE_OPEN,
) )
from homeassistant.components import group import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.config_validation import ( # noqa: F401
PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE,
make_entity_service_schema,
)
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.loader import bind_hass
# mypy: allow-untyped-defs, no-check-untyped-defs # mypy: allow-untyped-defs, no-check-untyped-defs

View File

@ -1,21 +1,23 @@
"""Provides device automations for Lock.""" """Provides device automations for Lock."""
from typing import Optional, List from typing import List, Optional
import voluptuous as vol import voluptuous as vol
from homeassistant.const import ( from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_ENTITY_ID,
ATTR_SUPPORTED_FEATURES, ATTR_SUPPORTED_FEATURES,
CONF_DOMAIN,
CONF_TYPE,
CONF_DEVICE_ID, CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_ID, CONF_ENTITY_ID,
CONF_TYPE,
SERVICE_LOCK, SERVICE_LOCK,
SERVICE_OPEN, SERVICE_OPEN,
SERVICE_UNLOCK, SERVICE_UNLOCK,
) )
from homeassistant.core import HomeAssistant, Context from homeassistant.core import Context, HomeAssistant
from homeassistant.helpers import entity_registry from homeassistant.helpers import entity_registry
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import DOMAIN, SUPPORT_OPEN from . import DOMAIN, SUPPORT_OPEN
ACTION_TYPES = {"lock", "unlock", "open"} ACTION_TYPES = {"lock", "unlock", "open"}

View File

@ -1,21 +1,23 @@
"""Provides device automations for Lock.""" """Provides device automations for Lock."""
from typing import List from typing import 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_LOCKED, STATE_LOCKED,
STATE_UNLOCKED, STATE_UNLOCKED,
) )
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_locked", "is_unlocked"} CONDITION_TYPES = {"is_locked", "is_unlocked"}

View File

@ -1,21 +1,23 @@
"""Provides device automations for Lock.""" """Provides device automations for Lock."""
from typing import List from typing import List
import voluptuous as vol import voluptuous as vol
from homeassistant.components.automation import AutomationActionType, state
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
from homeassistant.const import ( from homeassistant.const import (
CONF_DOMAIN,
CONF_TYPE,
CONF_PLATFORM,
CONF_DEVICE_ID, CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_ID, CONF_ENTITY_ID,
CONF_PLATFORM,
CONF_TYPE,
STATE_LOCKED, STATE_LOCKED,
STATE_UNLOCKED, STATE_UNLOCKED,
) )
from homeassistant.core import HomeAssistant, CALLBACK_TYPE from homeassistant.core import CALLBACK_TYPE, HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_registry from homeassistant.helpers import config_validation as cv, entity_registry
from homeassistant.helpers.typing import ConfigType from homeassistant.helpers.typing import ConfigType
from homeassistant.components.automation import state, AutomationActionType
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
from . import DOMAIN from . import DOMAIN
TRIGGER_TYPES = {"locked", "unlocked"} TRIGGER_TYPES = {"locked", "unlocked"}

View File

@ -5,10 +5,10 @@ from typing import Iterable, Optional
from homeassistant.const import ( from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_ENTITY_ID,
STATE_LOCKED,
STATE_UNLOCKED,
SERVICE_LOCK, SERVICE_LOCK,
SERVICE_UNLOCK, SERVICE_UNLOCK,
STATE_LOCKED,
STATE_UNLOCKED,
) )
from homeassistant.core import Context, State from homeassistant.core import Context, State
from homeassistant.helpers.typing import HomeAssistantType from homeassistant.helpers.typing import HomeAssistantType

View File

@ -7,10 +7,10 @@ from homeassistant.components.lock import DOMAIN
from homeassistant.const import ( from homeassistant.const import (
ATTR_CODE, ATTR_CODE,
ATTR_ENTITY_ID, ATTR_ENTITY_ID,
SERVICE_LOCK,
SERVICE_UNLOCK,
SERVICE_OPEN,
ENTITY_MATCH_ALL, ENTITY_MATCH_ALL,
SERVICE_LOCK,
SERVICE_OPEN,
SERVICE_UNLOCK,
) )
from homeassistant.loader import bind_hass from homeassistant.loader import bind_hass

View File

@ -1,19 +1,19 @@
"""The tests for Lock device actions.""" """The tests for Lock device actions."""
import pytest import pytest
import homeassistant.components.automation as automation
from homeassistant.components.lock import DOMAIN from homeassistant.components.lock import DOMAIN
from homeassistant.const import CONF_PLATFORM from homeassistant.const import CONF_PLATFORM
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

@ -1,19 +1,19 @@
"""The tests for Lock device conditions.""" """The tests for Lock device conditions."""
import pytest import pytest
import homeassistant.components.automation as automation
from homeassistant.components.lock import DOMAIN from homeassistant.components.lock import DOMAIN
from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED
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

@ -1,19 +1,19 @@
"""The tests for Lock device triggers.""" """The tests for Lock device triggers."""
import pytest import pytest
import homeassistant.components.automation as automation
from homeassistant.components.lock import DOMAIN from homeassistant.components.lock import DOMAIN
from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED
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,
) )