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

+4 -4
View File
@@ -6,11 +6,11 @@ components. Instead call the service directly.
from homeassistant.components.automation import DOMAIN, SERVICE_TRIGGER
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_TURN_ON,
SERVICE_TURN_OFF,
SERVICE_TOGGLE,
SERVICE_RELOAD,
ENTITY_MATCH_ALL,
SERVICE_RELOAD,
SERVICE_TOGGLE,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
)
from homeassistant.loader import bind_hass
+2 -3
View File
@@ -1,13 +1,12 @@
"""The tests for the Event automation."""
import pytest
import homeassistant.components.automation as automation
from homeassistant.core import Context
from homeassistant.setup import async_setup_component
import homeassistant.components.automation as automation
from tests.common import mock_component
from tests.common import async_mock_service, mock_component
from tests.components.automation import common
from tests.common import async_mock_service
@pytest.fixture
@@ -5,9 +5,8 @@ from homeassistant.components import automation, zone
from homeassistant.core import Context
from homeassistant.setup import async_setup_component
from tests.common import mock_component
from tests.common import async_mock_service, mock_component
from tests.components.automation import common
from tests.common import async_mock_service
@pytest.fixture
@@ -1,9 +1,9 @@
"""The tests for the Event automation."""
from unittest.mock import patch, Mock
from unittest.mock import Mock, patch
import homeassistant.components.automation as automation
from homeassistant.core import CoreState
from homeassistant.setup import async_setup_component
import homeassistant.components.automation as automation
from tests.common import async_mock_service, mock_coro
+3 -2
View File
@@ -1,13 +1,14 @@
"""The tests for the litejet component."""
from datetime import timedelta
import logging
from unittest import mock
from datetime import timedelta
import pytest
from homeassistant import setup
import homeassistant.util.dt as dt_util
from homeassistant.components import litejet
import homeassistant.components.automation as automation
import homeassistant.util.dt as dt_util
from tests.common import async_fire_time_changed, async_mock_service
+6 -4
View File
@@ -1,14 +1,16 @@
"""The tests for the MQTT automation."""
import pytest
from unittest import mock
from homeassistant.setup import async_setup_component
import pytest
import homeassistant.components.automation as automation
from homeassistant.setup import async_setup_component
from tests.common import (
async_fire_mqtt_message,
mock_component,
async_mock_service,
async_mock_mqtt_component,
async_mock_service,
mock_component,
)
from tests.components.automation import common
@@ -1,18 +1,19 @@
"""The tests for numeric state automation."""
from datetime import timedelta
import pytest
from unittest.mock import patch
import pytest
import homeassistant.components.automation as automation
from homeassistant.core import Context
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
from tests.common import (
mock_component,
async_fire_time_changed,
assert_setup_component,
async_fire_time_changed,
async_mock_service,
mock_component,
)
from tests.components.automation import common
+9 -5
View File
@@ -1,17 +1,21 @@
"""The test for state automation."""
from datetime import timedelta
import pytest
from unittest.mock import patch
import pytest
import homeassistant.components.automation as automation
from homeassistant.core import Context
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
import homeassistant.components.automation as automation
from tests.common import async_fire_time_changed, assert_setup_component, mock_component
from tests.common import (
assert_setup_component,
async_fire_time_changed,
async_mock_service,
mock_component,
)
from tests.components.automation import common
from tests.common import async_mock_service
@pytest.fixture
+5 -5
View File
@@ -1,16 +1,16 @@
"""The tests for the sun automation."""
from datetime import datetime
import pytest
from unittest.mock import patch
from homeassistant.const import SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET
from homeassistant.setup import async_setup_component
import pytest
from homeassistant.components import sun
import homeassistant.components.automation as automation
from homeassistant.const import SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
from tests.common import async_fire_time_changed, mock_component, async_mock_service
from tests.common import async_fire_time_changed, async_mock_service, mock_component
from tests.components.automation import common
ORIG_TIME_ZONE = dt_util.DEFAULT_TIME_ZONE
+7 -3
View File
@@ -4,14 +4,18 @@ from unittest import mock
import pytest
import homeassistant.components.automation as automation
from homeassistant.core import Context
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
import homeassistant.components.automation as automation
from tests.common import async_fire_time_changed, assert_setup_component, mock_component
from tests.common import (
assert_setup_component,
async_fire_time_changed,
async_mock_service,
mock_component,
)
from tests.components.automation import common
from tests.common import async_mock_service
@pytest.fixture
+7 -3
View File
@@ -4,12 +4,16 @@ from unittest.mock import patch
import pytest
import homeassistant.components.automation as automation
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
import homeassistant.components.automation as automation
from tests.common import async_fire_time_changed, assert_setup_component, mock_component
from tests.common import async_mock_service
from tests.common import (
assert_setup_component,
async_fire_time_changed,
async_mock_service,
mock_component,
)
@pytest.fixture
@@ -1,13 +1,12 @@
"""The tests for the time_pattern automation."""
import pytest
import homeassistant.components.automation as automation
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
import homeassistant.components.automation as automation
from tests.common import async_fire_time_changed, mock_component
from tests.common import async_fire_time_changed, async_mock_service, mock_component
from tests.components.automation import common
from tests.common import async_mock_service
@pytest.fixture
+2 -2
View File
@@ -1,12 +1,12 @@
"""The tests for the location automation."""
import pytest
from homeassistant.components import automation, zone
from homeassistant.core import Context
from homeassistant.setup import async_setup_component
from homeassistant.components import automation, zone
from tests.components.automation import common
from tests.common import async_mock_service, mock_component
from tests.components.automation import common
@pytest.fixture