Sort imports according to PEP8 for template (#29655)

This commit is contained in:
Bas Nijholt authored and Franck Nijhof committed 2019-12-08 21:05:08 +01:00
1 parent e0b82440ad
commit 415176e350
17 files changed
+135 -125

No files matched your search

@@ -1,11 +1,10 @@
"""The template component."""
from itertools import chain
import logging
from itertools import chain
from homeassistant.const import MATCH_ALL
_LOGGER = logging.getLogger(__name__)
@@ -3,28 +3,29 @@ import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.binary_sensor import (
BinarySensorDevice,
DEVICE_CLASSES_SCHEMA,
ENTITY_ID_FORMAT,
PLATFORM_SCHEMA,
DEVICE_CLASSES_SCHEMA,
BinarySensorDevice,
)
from homeassistant.const import (
ATTR_FRIENDLY_NAME,
ATTR_ENTITY_ID,
CONF_VALUE_TEMPLATE,
CONF_ICON_TEMPLATE,
CONF_ENTITY_PICTURE_TEMPLATE,
CONF_SENSORS,
ATTR_FRIENDLY_NAME,
CONF_DEVICE_CLASS,
CONF_ENTITY_PICTURE_TEMPLATE,
CONF_ICON_TEMPLATE,
CONF_SENSORS,
CONF_VALUE_TEMPLATE,
EVENT_HOMEASSISTANT_START,
MATCH_ALL,
)
from homeassistant.core import callback
from homeassistant.exceptions import TemplateError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import async_generate_entity_id
from homeassistant.helpers.event import async_track_state_change, async_track_same_state
from homeassistant.helpers.event import async_track_same_state, async_track_state_change
from . import extract_entities, initialise_templates
from .const import CONF_AVAILABILITY_TEMPLATE
+20 -19
View File
@@ -3,40 +3,41 @@ import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.cover import (
ENTITY_ID_FORMAT,
CoverDevice,
PLATFORM_SCHEMA,
DEVICE_CLASSES_SCHEMA,
SUPPORT_OPEN_TILT,
SUPPORT_CLOSE_TILT,
SUPPORT_STOP_TILT,
SUPPORT_SET_TILT_POSITION,
SUPPORT_OPEN,
SUPPORT_CLOSE,
SUPPORT_STOP,
SUPPORT_SET_POSITION,
ATTR_POSITION,
ATTR_TILT_POSITION,
DEVICE_CLASSES_SCHEMA,
ENTITY_ID_FORMAT,
PLATFORM_SCHEMA,
SUPPORT_CLOSE,
SUPPORT_CLOSE_TILT,
SUPPORT_OPEN,
SUPPORT_OPEN_TILT,
SUPPORT_SET_POSITION,
SUPPORT_SET_TILT_POSITION,
SUPPORT_STOP,
SUPPORT_STOP_TILT,
CoverDevice,
)
from homeassistant.const import (
CONF_FRIENDLY_NAME,
CONF_ENTITY_ID,
EVENT_HOMEASSISTANT_START,
CONF_VALUE_TEMPLATE,
CONF_ICON_TEMPLATE,
CONF_DEVICE_CLASS,
CONF_ENTITY_ID,
CONF_ENTITY_PICTURE_TEMPLATE,
CONF_FRIENDLY_NAME,
CONF_ICON_TEMPLATE,
CONF_OPTIMISTIC,
STATE_OPEN,
CONF_VALUE_TEMPLATE,
EVENT_HOMEASSISTANT_START,
STATE_CLOSED,
STATE_OPEN,
)
from homeassistant.core import callback
from homeassistant.exceptions import TemplateError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import async_generate_entity_id
from homeassistant.helpers.event import async_track_state_change
from homeassistant.helpers.script import Script
from . import extract_entities, initialise_templates
from .const import CONF_AVAILABILITY_TEMPLATE
+15 -14
View File
@@ -3,35 +3,36 @@ import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.fan import (
SPEED_LOW,
SPEED_MEDIUM,
SPEED_HIGH,
SUPPORT_SET_SPEED,
SUPPORT_OSCILLATE,
FanEntity,
ATTR_SPEED,
ATTR_DIRECTION,
ATTR_OSCILLATING,
ENTITY_ID_FORMAT,
SUPPORT_DIRECTION,
ATTR_SPEED,
DIRECTION_FORWARD,
DIRECTION_REVERSE,
ATTR_DIRECTION,
ENTITY_ID_FORMAT,
SPEED_HIGH,
SPEED_LOW,
SPEED_MEDIUM,
SUPPORT_DIRECTION,
SUPPORT_OSCILLATE,
SUPPORT_SET_SPEED,
FanEntity,
)
from homeassistant.const import (
CONF_ENTITY_ID,
CONF_FRIENDLY_NAME,
CONF_VALUE_TEMPLATE,
CONF_ENTITY_ID,
STATE_ON,
STATE_OFF,
EVENT_HOMEASSISTANT_START,
STATE_OFF,
STATE_ON,
STATE_UNKNOWN,
)
from homeassistant.core import callback
from homeassistant.exceptions import TemplateError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import async_generate_entity_id
from homeassistant.helpers.script import Script
from . import extract_entities, initialise_templates
from .const import CONF_AVAILABILITY_TEMPLATE
+10 -9
View File
@@ -3,30 +3,31 @@ import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ENTITY_ID_FORMAT,
Light,
SUPPORT_BRIGHTNESS,
Light,
)
from homeassistant.const import (
CONF_VALUE_TEMPLATE,
CONF_ICON_TEMPLATE,
CONF_ENTITY_PICTURE_TEMPLATE,
CONF_ENTITY_ID,
CONF_ENTITY_PICTURE_TEMPLATE,
CONF_FRIENDLY_NAME,
STATE_ON,
STATE_OFF,
EVENT_HOMEASSISTANT_START,
CONF_ICON_TEMPLATE,
CONF_LIGHTS,
CONF_VALUE_TEMPLATE,
EVENT_HOMEASSISTANT_START,
STATE_OFF,
STATE_ON,
)
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA
from homeassistant.core import callback
from homeassistant.exceptions import TemplateError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA
from homeassistant.helpers.entity import async_generate_entity_id
from homeassistant.helpers.event import async_track_state_change
from homeassistant.helpers.script import Script
from . import extract_entities, initialise_templates
from .const import CONF_AVAILABILITY_TEMPLATE
+6 -6
View File
@@ -3,22 +3,22 @@ import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.core import callback
from homeassistant.components.lock import LockDevice, PLATFORM_SCHEMA
from homeassistant.components.lock import PLATFORM_SCHEMA, LockDevice
from homeassistant.const import (
CONF_NAME,
CONF_OPTIMISTIC,
CONF_VALUE_TEMPLATE,
EVENT_HOMEASSISTANT_START,
STATE_ON,
STATE_LOCKED,
MATCH_ALL,
STATE_LOCKED,
STATE_ON,
)
from homeassistant.core import callback
from homeassistant.exceptions import TemplateError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_track_state_change
from homeassistant.helpers.script import Script
from . import extract_entities, initialise_templates
from .const import CONF_AVAILABILITY_TEMPLATE
+11 -11
View File
@@ -4,30 +4,30 @@ from typing import Optional
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.sensor import (
DEVICE_CLASSES_SCHEMA,
ENTITY_ID_FORMAT,
PLATFORM_SCHEMA,
DEVICE_CLASSES_SCHEMA,
)
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_FRIENDLY_NAME,
ATTR_UNIT_OF_MEASUREMENT,
CONF_VALUE_TEMPLATE,
CONF_ICON_TEMPLATE,
CONF_ENTITY_PICTURE_TEMPLATE,
ATTR_ENTITY_ID,
CONF_SENSORS,
EVENT_HOMEASSISTANT_START,
CONF_FRIENDLY_NAME_TEMPLATE,
MATCH_ALL,
CONF_DEVICE_CLASS,
CONF_ENTITY_PICTURE_TEMPLATE,
CONF_FRIENDLY_NAME_TEMPLATE,
CONF_ICON_TEMPLATE,
CONF_SENSORS,
CONF_VALUE_TEMPLATE,
EVENT_HOMEASSISTANT_START,
MATCH_ALL,
)
from homeassistant.core import callback
from homeassistant.exceptions import TemplateError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity, async_generate_entity_id
from homeassistant.helpers.event import async_track_state_change
from . import extract_entities, initialise_templates
from .const import CONF_AVAILABILITY_TEMPLATE
+8 -7
View File
@@ -3,28 +3,29 @@ import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.switch import (
ENTITY_ID_FORMAT,
SwitchDevice,
PLATFORM_SCHEMA,
SwitchDevice,
)
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_FRIENDLY_NAME,
CONF_VALUE_TEMPLATE,
CONF_ICON_TEMPLATE,
CONF_ENTITY_PICTURE_TEMPLATE,
CONF_ICON_TEMPLATE,
CONF_SWITCHES,
CONF_VALUE_TEMPLATE,
EVENT_HOMEASSISTANT_START,
STATE_OFF,
STATE_ON,
ATTR_ENTITY_ID,
CONF_SWITCHES,
EVENT_HOMEASSISTANT_START,
)
from homeassistant.core import callback
from homeassistant.exceptions import TemplateError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import async_generate_entity_id
from homeassistant.helpers.event import async_track_state_change
from homeassistant.helpers.script import Script
from . import extract_entities, initialise_templates
from .const import CONF_AVAILABILITY_TEMPLATE
+12 -11
View File
@@ -3,7 +3,6 @@ import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.vacuum import (
ATTR_FAN_SPEED,
DOMAIN,
@@ -14,35 +13,37 @@ from homeassistant.components.vacuum import (
SERVICE_SET_FAN_SPEED,
SERVICE_START,
SERVICE_STOP,
STATE_CLEANING,
STATE_DOCKED,
STATE_ERROR,
STATE_IDLE,
STATE_PAUSED,
STATE_RETURNING,
SUPPORT_BATTERY,
SUPPORT_CLEAN_SPOT,
SUPPORT_FAN_SPEED,
SUPPORT_LOCATE,
SUPPORT_PAUSE,
SUPPORT_RETURN_HOME,
SUPPORT_STOP,
SUPPORT_STATE,
SUPPORT_START,
SUPPORT_STATE,
SUPPORT_STOP,
StateVacuumDevice,
STATE_CLEANING,
STATE_DOCKED,
STATE_PAUSED,
STATE_IDLE,
STATE_RETURNING,
STATE_ERROR,
)
from homeassistant.const import (
CONF_ENTITY_ID,
CONF_FRIENDLY_NAME,
CONF_VALUE_TEMPLATE,
CONF_ENTITY_ID,
MATCH_ALL,
EVENT_HOMEASSISTANT_START,
MATCH_ALL,
STATE_UNKNOWN,
)
from homeassistant.core import callback
from homeassistant.exceptions import TemplateError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import async_generate_entity_id
from homeassistant.helpers.script import Script
from . import extract_entities, initialise_templates
from .const import CONF_AVAILABILITY_TEMPLATE