Sort imports according to PEP8 for emulated_hue (#29667)

This commit is contained in:
Bas Nijholt 2019-12-09 12:12:41 +01:00 committed by Franck Nijhof
parent 05daa817f5
commit 27bd6ca1db
6 changed files with 33 additions and 34 deletions

View File

@ -5,22 +5,22 @@ from aiohttp import web
import voluptuous as vol import voluptuous as vol
from homeassistant import util from homeassistant import util
from homeassistant.components.http import real_ip
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
from homeassistant.exceptions import HomeAssistantError from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.deprecation import get_deprecated
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.deprecation import get_deprecated
from homeassistant.util.json import load_json, save_json from homeassistant.util.json import load_json, save_json
from homeassistant.components.http import real_ip
from .hue_api import ( from .hue_api import (
HueUsernameView,
HueUnauthorizedUser,
HueAllLightsStateView,
HueOneLightStateView,
HueOneLightChangeView,
HueGroupView,
HueAllGroupsStateView, HueAllGroupsStateView,
HueAllLightsStateView,
HueFullStateView, HueFullStateView,
HueGroupView,
HueOneLightChangeView,
HueOneLightStateView,
HueUnauthorizedUser,
HueUsernameView,
) )
from .upnp import DescriptionXmlView, UPNPResponderThread from .upnp import DescriptionXmlView, UPNPResponderThread

View File

@ -1,6 +1,6 @@
"""Support for a Hue API to control Home Assistant.""" """Support for a Hue API to control Home Assistant."""
import logging
import hashlib import hashlib
import logging
from homeassistant import core from homeassistant import core
from homeassistant.components import ( from homeassistant.components import (
@ -34,8 +34,8 @@ from homeassistant.components.http import HomeAssistantView
from homeassistant.components.http.const import KEY_REAL_IP from homeassistant.components.http.const import KEY_REAL_IP
from homeassistant.components.light import ( from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ATTR_COLOR_TEMP, ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
SUPPORT_BRIGHTNESS, SUPPORT_BRIGHTNESS,
SUPPORT_COLOR, SUPPORT_COLOR,
SUPPORT_COLOR_TEMP, SUPPORT_COLOR_TEMP,
@ -49,8 +49,8 @@ from homeassistant.const import (
ATTR_SUPPORTED_FEATURES, ATTR_SUPPORTED_FEATURES,
ATTR_TEMPERATURE, ATTR_TEMPERATURE,
HTTP_BAD_REQUEST, HTTP_BAD_REQUEST,
HTTP_UNAUTHORIZED,
HTTP_NOT_FOUND, HTTP_NOT_FOUND,
HTTP_UNAUTHORIZED,
SERVICE_CLOSE_COVER, SERVICE_CLOSE_COVER,
SERVICE_OPEN_COVER, SERVICE_OPEN_COVER,
SERVICE_TURN_OFF, SERVICE_TURN_OFF,

View File

@ -1,8 +1,8 @@
"""Support UPNP discovery method that mimics Hue hubs.""" """Support UPNP discovery method that mimics Hue hubs."""
import threading
import socket
import logging import logging
import select import select
import socket
import threading
from aiohttp import web from aiohttp import web

View File

@ -1,43 +1,42 @@
"""The tests for the emulated Hue component.""" """The tests for the emulated Hue component."""
import asyncio import asyncio
import json from datetime import timedelta
from ipaddress import ip_address from ipaddress import ip_address
import json
from unittest.mock import patch from unittest.mock import patch
from aiohttp.hdrs import CONTENT_TYPE from aiohttp.hdrs import CONTENT_TYPE
import pytest import pytest
from tests.common import get_test_instance_port
from homeassistant import const, setup from homeassistant import const, setup
from homeassistant.components import ( from homeassistant.components import (
climate,
cover,
emulated_hue,
fan, fan,
http, http,
light, light,
script,
emulated_hue,
media_player, media_player,
cover, script,
climate,
) )
from homeassistant.components.emulated_hue import Config from homeassistant.components.emulated_hue import Config
from homeassistant.components.emulated_hue.hue_api import ( from homeassistant.components.emulated_hue.hue_api import (
HUE_API_STATE_ON,
HUE_API_STATE_BRI, HUE_API_STATE_BRI,
HUE_API_STATE_HUE, HUE_API_STATE_HUE,
HUE_API_STATE_ON,
HUE_API_STATE_SAT, HUE_API_STATE_SAT,
HUE_API_USERNAME, HUE_API_USERNAME,
HueUsernameView,
HueOneLightStateView,
HueAllLightsStateView,
HueOneLightChangeView,
HueAllGroupsStateView, HueAllGroupsStateView,
HueAllLightsStateView,
HueFullStateView, HueFullStateView,
HueOneLightChangeView,
HueOneLightStateView,
HueUsernameView,
) )
from homeassistant.const import STATE_ON, STATE_OFF from homeassistant.const import STATE_OFF, STATE_ON
import homeassistant.util.dt as dt_util import homeassistant.util.dt as dt_util
from datetime import timedelta
from tests.common import async_fire_time_changed from tests.common import async_fire_time_changed, get_test_instance_port
HTTP_SERVER_PORT = get_test_instance_port() HTTP_SERVER_PORT = get_test_instance_port()
BRIDGE_SERVER_PORT = get_test_instance_port() BRIDGE_SERVER_PORT = get_test_instance_port()

View File

@ -1,5 +1,5 @@
"""Test the Emulated Hue component.""" """Test the Emulated Hue component."""
from unittest.mock import patch, Mock, MagicMock from unittest.mock import MagicMock, Mock, patch
from homeassistant.components.emulated_hue import Config from homeassistant.components.emulated_hue import Config

View File

@ -1,15 +1,15 @@
"""The tests for the emulated Hue component.""" """The tests for the emulated Hue component."""
import json import json
import unittest import unittest
from unittest.mock import patch from unittest.mock import patch
import requests
from aiohttp.hdrs import CONTENT_TYPE
from homeassistant import setup, const from aiohttp.hdrs import CONTENT_TYPE
import requests
from homeassistant import const, setup
from homeassistant.components import emulated_hue, http from homeassistant.components import emulated_hue, http
from tests.common import get_test_instance_port, get_test_home_assistant from tests.common import get_test_home_assistant, get_test_instance_port
HTTP_SERVER_PORT = get_test_instance_port() HTTP_SERVER_PORT = get_test_instance_port()
BRIDGE_SERVER_PORT = get_test_instance_port() BRIDGE_SERVER_PORT = get_test_instance_port()