Sort imports according to PEP8 for rest (#29674)
parent
186799794d
commit
04225ba802
|
@ -4,6 +4,14 @@ import logging
|
|||
import requests
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_MESSAGE,
|
||||
ATTR_TARGET,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_AUTHENTICATION,
|
||||
CONF_HEADERS,
|
||||
|
@ -18,15 +26,6 @@ from homeassistant.const import (
|
|||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TARGET,
|
||||
ATTR_TITLE,
|
||||
ATTR_TITLE_DEFAULT,
|
||||
ATTR_MESSAGE,
|
||||
PLATFORM_SCHEMA,
|
||||
BaseNotificationService,
|
||||
)
|
||||
|
||||
CONF_DATA = "data"
|
||||
CONF_DATA_TEMPLATE = "data_template"
|
||||
CONF_MESSAGE_PARAMETER_NAME = "message_param_name"
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
"""Support for RESTful API sensors."""
|
||||
import logging
|
||||
import json
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
import requests
|
||||
from requests.auth import HTTPBasicAuth, HTTPDigestAuth
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, DEVICE_CLASSES_SCHEMA
|
||||
from homeassistant.components.sensor import DEVICE_CLASSES_SCHEMA, PLATFORM_SCHEMA
|
||||
from homeassistant.const import (
|
||||
CONF_AUTHENTICATION,
|
||||
CONF_DEVICE_CLASS,
|
||||
CONF_FORCE_UPDATE,
|
||||
CONF_HEADERS,
|
||||
CONF_NAME,
|
||||
CONF_METHOD,
|
||||
CONF_NAME,
|
||||
CONF_PASSWORD,
|
||||
CONF_PAYLOAD,
|
||||
CONF_RESOURCE,
|
||||
CONF_RESOURCE_TEMPLATE,
|
||||
CONF_TIMEOUT,
|
||||
CONF_UNIT_OF_MEASUREMENT,
|
||||
CONF_USERNAME,
|
||||
CONF_TIMEOUT,
|
||||
CONF_VALUE_TEMPLATE,
|
||||
CONF_VERIFY_SSL,
|
||||
CONF_DEVICE_CLASS,
|
||||
HTTP_BASIC_AUTHENTICATION,
|
||||
HTTP_DIGEST_AUTHENTICATION,
|
||||
)
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.entity import Entity
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -6,15 +6,15 @@ import aiohttp
|
|||
import async_timeout
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
|
||||
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
|
||||
from homeassistant.const import (
|
||||
CONF_HEADERS,
|
||||
CONF_METHOD,
|
||||
CONF_NAME,
|
||||
CONF_PASSWORD,
|
||||
CONF_RESOURCE,
|
||||
CONF_TIMEOUT,
|
||||
CONF_METHOD,
|
||||
CONF_USERNAME,
|
||||
CONF_PASSWORD,
|
||||
CONF_VERIFY_SSL,
|
||||
)
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
"""The tests for the REST binary sensor platform."""
|
||||
import unittest
|
||||
from pytest import raises
|
||||
from unittest.mock import patch, Mock
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
from pytest import raises
|
||||
import requests
|
||||
from requests.exceptions import Timeout
|
||||
import requests_mock
|
||||
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.setup import setup_component
|
||||
import homeassistant.components.binary_sensor as binary_sensor
|
||||
import homeassistant.components.rest.binary_sensor as rest
|
||||
from homeassistant.const import STATE_ON, STATE_OFF
|
||||
from homeassistant.const import STATE_OFF, STATE_ON
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers import template
|
||||
from homeassistant.setup import setup_component
|
||||
|
||||
from tests.common import get_test_home_assistant, assert_setup_component
|
||||
import pytest
|
||||
from tests.common import assert_setup_component, get_test_home_assistant
|
||||
|
||||
|
||||
class TestRestBinarySensorSetup(unittest.TestCase):
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
"""The tests for the REST sensor platform."""
|
||||
import unittest
|
||||
from pytest import raises
|
||||
from unittest.mock import patch, Mock
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
from pytest import raises
|
||||
import requests
|
||||
from requests.exceptions import Timeout, RequestException
|
||||
from requests.exceptions import RequestException, Timeout
|
||||
import requests_mock
|
||||
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.setup import setup_component
|
||||
import homeassistant.components.sensor as sensor
|
||||
import homeassistant.components.rest.sensor as rest
|
||||
import homeassistant.components.sensor as sensor
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.config_validation import template
|
||||
from homeassistant.setup import setup_component
|
||||
|
||||
from tests.common import get_test_home_assistant, assert_setup_component
|
||||
import pytest
|
||||
from tests.common import assert_setup_component, get_test_home_assistant
|
||||
|
||||
|
||||
class TestRestSensorSetup(unittest.TestCase):
|
||||
|
|
|
@ -4,9 +4,10 @@ import asyncio
|
|||
import aiohttp
|
||||
|
||||
import homeassistant.components.rest.switch as rest
|
||||
from homeassistant.setup import setup_component
|
||||
from homeassistant.helpers.template import Template
|
||||
from tests.common import get_test_home_assistant, assert_setup_component
|
||||
from homeassistant.setup import setup_component
|
||||
|
||||
from tests.common import assert_setup_component, get_test_home_assistant
|
||||
|
||||
|
||||
class TestRestSwitchSetup:
|
||||
|
|
Loading…
Reference in New Issue