use isort to sort imports according to PEP8 for climate (#29625)

This commit is contained in:
Bas Nijholt 2019-12-08 17:55:01 +01:00 committed by Fabian Affolter
parent 3b5da9c44a
commit 954813b478
11 changed files with 58 additions and 51 deletions

View File

@ -19,9 +19,9 @@ from homeassistant.const import (
) )
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.config_validation import ( # noqa: F401 from homeassistant.helpers.config_validation import ( # noqa: F401
make_entity_service_schema,
PLATFORM_SCHEMA, PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE, PLATFORM_SCHEMA_BASE,
make_entity_service_schema,
) )
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity_component import EntityComponent
@ -68,8 +68,8 @@ from .const import (
SUPPORT_PRESET_MODE, SUPPORT_PRESET_MODE,
SUPPORT_SWING_MODE, SUPPORT_SWING_MODE,
SUPPORT_TARGET_HUMIDITY, SUPPORT_TARGET_HUMIDITY,
SUPPORT_TARGET_TEMPERATURE_RANGE,
SUPPORT_TARGET_TEMPERATURE, SUPPORT_TARGET_TEMPERATURE,
SUPPORT_TARGET_TEMPERATURE_RANGE,
) )
DEFAULT_MIN_TEMP = 7 DEFAULT_MIN_TEMP = 7

View File

@ -1,17 +1,19 @@
"""Provides device automations for Climate.""" """Provides device automations for Climate."""
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,
CONF_DOMAIN,
CONF_TYPE,
CONF_DEVICE_ID, CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_ID, CONF_ENTITY_ID,
CONF_TYPE,
) )
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, const from . import DOMAIN, const
ACTION_TYPES = {"set_hvac_mode", "set_preset_mode"} ACTION_TYPES = {"set_hvac_mode", "set_preset_mode"}

View File

@ -1,19 +1,21 @@
"""Provide the device automations for Climate.""" """Provide the device automations for Climate."""
from typing import Dict, List from typing import Dict, 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,
) )
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, const from . import DOMAIN, const
CONDITION_TYPES = {"is_hvac_mode", "is_preset_mode"} CONDITION_TYPES = {"is_hvac_mode", "is_preset_mode"}

View File

@ -1,26 +1,28 @@
"""Provides device automations for Climate.""" """Provides device automations for Climate."""
from typing import List from typing import List
import voluptuous as vol import voluptuous as vol
from homeassistant.const import (
CONF_DOMAIN,
CONF_TYPE,
CONF_PLATFORM,
CONF_DEVICE_ID,
CONF_ENTITY_ID,
CONF_FOR,
CONF_ABOVE,
CONF_BELOW,
)
from homeassistant.core import HomeAssistant, CALLBACK_TYPE
from homeassistant.helpers import config_validation as cv, entity_registry
from homeassistant.helpers.typing import ConfigType
from homeassistant.components.automation import ( from homeassistant.components.automation import (
state as state_automation,
numeric_state as numeric_state_automation,
AutomationActionType, AutomationActionType,
numeric_state as numeric_state_automation,
state as state_automation,
) )
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
from homeassistant.const import (
CONF_ABOVE,
CONF_BELOW,
CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_ID,
CONF_FOR,
CONF_PLATFORM,
CONF_TYPE,
)
from homeassistant.core import CALLBACK_TYPE, HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_registry
from homeassistant.helpers.typing import ConfigType
from . import DOMAIN, const from . import DOMAIN, const
TRIGGER_TYPES = { TRIGGER_TYPES = {

View File

@ -8,20 +8,20 @@ from homeassistant.helpers.typing import HomeAssistantType
from .const import ( from .const import (
ATTR_AUX_HEAT, ATTR_AUX_HEAT,
ATTR_HUMIDITY,
ATTR_HVAC_MODE,
ATTR_PRESET_MODE,
ATTR_SWING_MODE,
ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW, ATTR_TARGET_TEMP_LOW,
ATTR_PRESET_MODE, DOMAIN,
ATTR_HVAC_MODE,
ATTR_SWING_MODE,
ATTR_HUMIDITY,
HVAC_MODES, HVAC_MODES,
SERVICE_SET_AUX_HEAT, SERVICE_SET_AUX_HEAT,
SERVICE_SET_TEMPERATURE,
SERVICE_SET_PRESET_MODE,
SERVICE_SET_HVAC_MODE,
SERVICE_SET_SWING_MODE,
SERVICE_SET_HUMIDITY, SERVICE_SET_HUMIDITY,
DOMAIN, SERVICE_SET_HVAC_MODE,
SERVICE_SET_PRESET_MODE,
SERVICE_SET_SWING_MODE,
SERVICE_SET_TEMPERATURE,
) )

View File

@ -25,9 +25,9 @@ from homeassistant.components.climate.const import (
from homeassistant.const import ( from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_ENTITY_ID,
ATTR_TEMPERATURE, ATTR_TEMPERATURE,
ENTITY_MATCH_ALL,
SERVICE_TURN_OFF, SERVICE_TURN_OFF,
SERVICE_TURN_ON, SERVICE_TURN_ON,
ENTITY_MATCH_ALL,
) )
from homeassistant.loader import bind_hass from homeassistant.loader import bind_hass

View File

@ -2,18 +2,18 @@
import pytest import pytest
import voluptuous_serialize import voluptuous_serialize
from homeassistant.components.climate import DOMAIN, const, device_action
from homeassistant.setup import async_setup_component
import homeassistant.components.automation as automation import homeassistant.components.automation as automation
from homeassistant.helpers import device_registry, config_validation as cv from homeassistant.components.climate import DOMAIN, const, device_action
from homeassistant.helpers import config_validation as cv, 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

@ -2,18 +2,18 @@
import pytest import pytest
import voluptuous_serialize import voluptuous_serialize
from homeassistant.components.climate import DOMAIN, const, device_condition
from homeassistant.setup import async_setup_component
import homeassistant.components.automation as automation import homeassistant.components.automation as automation
from homeassistant.helpers import device_registry, config_validation as cv from homeassistant.components.climate import DOMAIN, const, device_condition
from homeassistant.helpers import config_validation as cv, 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 Climate device triggers.""" """The tests for Climate device triggers."""
import voluptuous_serialize
import pytest import pytest
import voluptuous_serialize
from homeassistant.components.climate import DOMAIN, const, device_trigger
from homeassistant.setup import async_setup_component
import homeassistant.components.automation as automation import homeassistant.components.automation as automation
from homeassistant.helpers import device_registry, config_validation as cv from homeassistant.components.climate import DOMAIN, const, device_trigger
from homeassistant.helpers import config_validation as cv, 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,16 +1,17 @@
"""The tests for the climate component.""" """The tests for the climate component."""
from unittest.mock import MagicMock
from typing import List from typing import List
from unittest.mock import MagicMock
import pytest import pytest
import voluptuous as vol import voluptuous as vol
from homeassistant.components.climate import ( from homeassistant.components.climate import (
SET_TEMPERATURE_SCHEMA,
ClimateDevice,
HVAC_MODE_HEAT, HVAC_MODE_HEAT,
HVAC_MODE_OFF, HVAC_MODE_OFF,
SET_TEMPERATURE_SCHEMA,
ClimateDevice,
) )
from tests.common import async_mock_service from tests.common import async_mock_service

View File

@ -2,7 +2,6 @@
import pytest import pytest
from homeassistant.components.climate.reproduce_state import async_reproduce_states
from homeassistant.components.climate.const import ( from homeassistant.components.climate.const import (
ATTR_AUX_HEAT, ATTR_AUX_HEAT,
ATTR_HUMIDITY, ATTR_HUMIDITY,
@ -21,6 +20,7 @@ from homeassistant.components.climate.const import (
SERVICE_SET_SWING_MODE, SERVICE_SET_SWING_MODE,
SERVICE_SET_TEMPERATURE, SERVICE_SET_TEMPERATURE,
) )
from homeassistant.components.climate.reproduce_state import async_reproduce_states
from homeassistant.const import ATTR_TEMPERATURE from homeassistant.const import ATTR_TEMPERATURE
from homeassistant.core import Context, State from homeassistant.core import Context, State