use isort to sort imports according to PEP8 for automation (#29620)

This commit is contained in:
Bas Nijholt authored and Fabian Affolter committed 2019-12-08 21:59:39 +05:30
1 parent a38f3ac9c6
commit d3f67c3841
30 files changed
+87 -90

No files matched your search

@@ -27,13 +27,12 @@ import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.config_validation import make_entity_service_schema
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.service import async_register_admin_service
from homeassistant.helpers.restore_state import RestoreEntity
from homeassistant.helpers.service import async_register_admin_service
from homeassistant.helpers.typing import TemplateVarsType
from homeassistant.loader import bind_hass
from homeassistant.util.dt import parse_datetime, utcnow
# mypy: allow-untyped-calls, allow-untyped-defs
# mypy: no-check-untyped-defs, no-warn-return-any
@@ -7,8 +7,8 @@ import voluptuous as vol
from homeassistant.components.device_automation.exceptions import (
InvalidDeviceAutomationConfig,
)
from homeassistant.const import CONF_PLATFORM
from homeassistant.config import async_log_exception, config_without_domain
from homeassistant.const import CONF_PLATFORM
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import condition, config_per_platform, script
from homeassistant.loader import IntegrationNotFound
@@ -7,7 +7,6 @@ from homeassistant.components.device_automation import (
)
from homeassistant.const import CONF_DOMAIN
# mypy: allow-untyped-defs, no-check-untyped-defs
TRIGGER_SCHEMA = TRIGGER_BASE_SCHEMA.extend({}, extra=vol.ALLOW_EXTRA)
+1 -2
View File
@@ -3,11 +3,10 @@ import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import CONF_PLATFORM
from homeassistant.core import callback
from homeassistant.helpers import config_validation as cv
# mypy: allow-untyped-defs
CONF_EVENT_TYPE = "event_type"
@@ -2,7 +2,6 @@
import voluptuous as vol
from homeassistant.components.geo_location import DOMAIN
from homeassistant.core import callback
from homeassistant.const import (
CONF_EVENT,
CONF_PLATFORM,
@@ -10,10 +9,10 @@ from homeassistant.const import (
CONF_ZONE,
EVENT_STATE_CHANGED,
)
from homeassistant.core import callback
from homeassistant.helpers import condition, config_validation as cv
from homeassistant.helpers.config_validation import entity_domain
# mypy: allow-untyped-defs, no-check-untyped-defs
EVENT_ENTER = "enter"
@@ -3,9 +3,8 @@ import logging
import voluptuous as vol
from homeassistant.core import callback, CoreState
from homeassistant.const import CONF_PLATFORM, CONF_EVENT, EVENT_HOMEASSISTANT_STOP
from homeassistant.const import CONF_EVENT, CONF_PLATFORM, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import CoreState, callback
# mypy: allow-untyped-defs
@@ -3,12 +3,11 @@ import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import CONF_PLATFORM
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util
from homeassistant.helpers.event import track_point_in_utc_time
import homeassistant.util.dt as dt_util
# mypy: allow-untyped-defs, no-check-untyped-defs
+2 -3
View File
@@ -3,12 +3,11 @@ import json
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components import mqtt
from homeassistant.const import CONF_PLATFORM, CONF_PAYLOAD
from homeassistant.const import CONF_PAYLOAD, CONF_PLATFORM
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
# mypy: allow-untyped-defs
CONF_ENCODING = "encoding"
@@ -4,18 +4,17 @@ import logging
import voluptuous as vol
from homeassistant import exceptions
from homeassistant.core import CALLBACK_TYPE, callback
from homeassistant.const import (
CONF_VALUE_TEMPLATE,
CONF_PLATFORM,
CONF_ENTITY_ID,
CONF_BELOW,
CONF_ABOVE,
CONF_BELOW,
CONF_ENTITY_ID,
CONF_FOR,
CONF_PLATFORM,
CONF_VALUE_TEMPLATE,
)
from homeassistant.helpers.event import async_track_state_change, async_track_same_state
from homeassistant.core import CALLBACK_TYPE, callback
from homeassistant.helpers import condition, config_validation as cv, template
from homeassistant.helpers.event import async_track_same_state, async_track_state_change
# mypy: allow-incomplete-defs, allow-untyped-calls, allow-untyped-defs
# mypy: no-check-untyped-defs
@@ -5,10 +5,10 @@ from typing import Iterable, Optional
from homeassistant.const import (
ATTR_ENTITY_ID,
STATE_ON,
STATE_OFF,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_OFF,
STATE_ON,
)
from homeassistant.core import Context, State
from homeassistant.helpers.typing import HomeAssistantType
+3 -4
View File
@@ -6,11 +6,10 @@ from typing import Dict
import voluptuous as vol
from homeassistant import exceptions
from homeassistant.core import HomeAssistant, CALLBACK_TYPE, callback
from homeassistant.const import MATCH_ALL, CONF_PLATFORM, CONF_FOR
from homeassistant.const import CONF_FOR, CONF_PLATFORM, MATCH_ALL
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
from homeassistant.helpers import config_validation as cv, template
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
# mypy: allow-incomplete-defs, allow-untyped-calls, allow-untyped-defs
# mypy: no-check-untyped-defs
+2 -3
View File
@@ -4,16 +4,15 @@ import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import (
CONF_EVENT,
CONF_OFFSET,
CONF_PLATFORM,
SUN_EVENT_SUNRISE,
)
from homeassistant.helpers.event import async_track_sunrise, async_track_sunset
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_track_sunrise, async_track_sunset
# mypy: allow-untyped-defs, no-check-untyped-defs
@@ -3,13 +3,11 @@ import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import CONF_VALUE_TEMPLATE, CONF_PLATFORM, CONF_FOR
from homeassistant import exceptions
from homeassistant.helpers import condition
from homeassistant.const import CONF_FOR, CONF_PLATFORM, CONF_VALUE_TEMPLATE
from homeassistant.core import callback
from homeassistant.helpers import condition, config_validation as cv, template
from homeassistant.helpers.event import async_track_same_state, async_track_template
from homeassistant.helpers import config_validation as cv, template
# mypy: allow-untyped-defs, no-check-untyped-defs
+1 -2
View File
@@ -3,12 +3,11 @@ import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import CONF_AT, CONF_PLATFORM
from homeassistant.core import callback
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.event import async_track_time_change
# mypy: allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)
@@ -3,12 +3,11 @@ import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import CONF_PLATFORM
from homeassistant.core import callback
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.event import async_track_time_change
# mypy: allow-untyped-defs, no-check-untyped-defs
CONF_HOURS = "hours"
@@ -5,13 +5,12 @@ import logging
from aiohttp import hdrs
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import CONF_PLATFORM, CONF_WEBHOOK_ID
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from . import DOMAIN as AUTOMATION_DOMAIN
# mypy: allow-untyped-defs
DEPENDENCIES = ("webhook",)
+4 -5
View File
@@ -1,17 +1,16 @@
"""Offer zone automation rules."""
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import (
CONF_EVENT,
CONF_ENTITY_ID,
CONF_EVENT,
CONF_PLATFORM,
CONF_ZONE,
MATCH_ALL,
CONF_PLATFORM,
)
from homeassistant.helpers.event import async_track_state_change
from homeassistant.core import callback
from homeassistant.helpers import condition, config_validation as cv, location
from homeassistant.helpers.event import async_track_state_change
# mypy: allow-untyped-defs, no-check-untyped-defs