Sort imports according to PEP8 for sensor (#29683)

This commit is contained in:
Bas Nijholt 2019-12-09 11:57:49 +01:00 committed by Franck Nijhof
parent 9cf3ff319e
commit df85a50f3b
5 changed files with 15 additions and 16 deletions

View file

@ -21,7 +21,6 @@ from homeassistant.helpers.config_validation import ( # noqa: F401
) )
from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity_component import EntityComponent
# 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

@ -1,11 +1,11 @@
"""Provides device conditions for sensors.""" """Provides device conditions for sensors."""
from typing import Dict, List from typing import Dict, List
import voluptuous as vol import voluptuous as vol
from homeassistant.components.device_automation.exceptions import ( from homeassistant.components.device_automation.exceptions import (
InvalidDeviceAutomationConfig, InvalidDeviceAutomationConfig,
) )
from homeassistant.core import HomeAssistant
from homeassistant.const import ( from homeassistant.const import (
ATTR_DEVICE_CLASS, ATTR_DEVICE_CLASS,
ATTR_UNIT_OF_MEASUREMENT, ATTR_UNIT_OF_MEASUREMENT,
@ -22,16 +22,16 @@ from homeassistant.const import (
DEVICE_CLASS_TEMPERATURE, DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_TIMESTAMP, DEVICE_CLASS_TIMESTAMP,
) )
from homeassistant.core import HomeAssistant
from homeassistant.helpers import condition, config_validation as cv
from homeassistant.helpers.entity_registry import ( from homeassistant.helpers.entity_registry import (
async_entries_for_device, async_entries_for_device,
async_get_registry, async_get_registry,
) )
from homeassistant.helpers import condition, config_validation as cv
from homeassistant.helpers.typing import ConfigType from homeassistant.helpers.typing import ConfigType
from . import DOMAIN from . import DOMAIN
# mypy: allow-untyped-defs, no-check-untyped-defs # mypy: allow-untyped-defs, no-check-untyped-defs
DEVICE_CLASS_NONE = "none" DEVICE_CLASS_NONE = "none"

View file

@ -23,12 +23,11 @@ from homeassistant.const import (
DEVICE_CLASS_TEMPERATURE, DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_TIMESTAMP, DEVICE_CLASS_TIMESTAMP,
) )
from homeassistant.helpers.entity_registry import async_entries_for_device
from homeassistant.helpers import config_validation as cv from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity_registry import async_entries_for_device
from . import DOMAIN from . import DOMAIN
# mypy: allow-untyped-defs, no-check-untyped-defs # mypy: allow-untyped-defs, no-check-untyped-defs
DEVICE_CLASS_NONE = "none" DEVICE_CLASS_NONE = "none"

View file

@ -1,20 +1,20 @@
"""The test for sensor device automation.""" """The test for sensor device automation."""
import pytest import pytest
import homeassistant.components.automation as automation
from homeassistant.components.sensor import DOMAIN from homeassistant.components.sensor import DOMAIN
from homeassistant.components.sensor.device_condition import ENTITY_CONDITIONS from homeassistant.components.sensor.device_condition import ENTITY_CONDITIONS
from homeassistant.const import STATE_UNKNOWN, CONF_PLATFORM from homeassistant.const import CONF_PLATFORM, STATE_UNKNOWN
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,
async_get_device_automation_capabilities,
async_get_device_automations,
async_mock_service, async_mock_service,
mock_device_registry, mock_device_registry,
mock_registry, mock_registry,
async_get_device_automations,
async_get_device_automation_capabilities,
) )
from tests.testing_config.custom_components.test.sensor import DEVICE_CLASSES from tests.testing_config.custom_components.test.sensor import DEVICE_CLASSES

View file

@ -1,23 +1,24 @@
"""The test for sensor device automation.""" """The test for sensor device automation."""
from datetime import timedelta from datetime import timedelta
import pytest import pytest
import homeassistant.components.automation as automation
from homeassistant.components.sensor import DOMAIN from homeassistant.components.sensor import DOMAIN
from homeassistant.components.sensor.device_trigger import ENTITY_TRIGGERS from homeassistant.components.sensor.device_trigger import ENTITY_TRIGGERS
from homeassistant.const import STATE_UNKNOWN, CONF_PLATFORM from homeassistant.const import CONF_PLATFORM, STATE_UNKNOWN
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
import homeassistant.util.dt as dt_util import homeassistant.util.dt as dt_util
from tests.common import ( from tests.common import (
MockConfigEntry, MockConfigEntry,
async_fire_time_changed, async_fire_time_changed,
async_get_device_automation_capabilities,
async_get_device_automations,
async_mock_service, async_mock_service,
mock_device_registry, mock_device_registry,
mock_registry, mock_registry,
async_get_device_automations,
async_get_device_automation_capabilities,
) )
from tests.testing_config.custom_components.test.sensor import DEVICE_CLASSES from tests.testing_config.custom_components.test.sensor import DEVICE_CLASSES