Sort imports according to PEP8 for emulated_hue ()

pull/29761/head
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
homeassistant/components/emulated_hue
tests/components/emulated_hue

View File

@ -5,22 +5,22 @@ from aiohttp import web
import voluptuous as vol
from homeassistant import util
from homeassistant.components.http import real_ip
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.deprecation import get_deprecated
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.components.http import real_ip
from .hue_api import (
HueUsernameView,
HueUnauthorizedUser,
HueAllLightsStateView,
HueOneLightStateView,
HueOneLightChangeView,
HueGroupView,
HueAllGroupsStateView,
HueAllLightsStateView,
HueFullStateView,
HueGroupView,
HueOneLightChangeView,
HueOneLightStateView,
HueUnauthorizedUser,
HueUsernameView,
)
from .upnp import DescriptionXmlView, UPNPResponderThread

View File

@ -1,6 +1,6 @@
"""Support for a Hue API to control Home Assistant."""
import logging
import hashlib
import logging
from homeassistant import core
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.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
@ -49,8 +49,8 @@ from homeassistant.const import (
ATTR_SUPPORTED_FEATURES,
ATTR_TEMPERATURE,
HTTP_BAD_REQUEST,
HTTP_UNAUTHORIZED,
HTTP_NOT_FOUND,
HTTP_UNAUTHORIZED,
SERVICE_CLOSE_COVER,
SERVICE_OPEN_COVER,
SERVICE_TURN_OFF,

View File

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

View File

@ -1,43 +1,42 @@
"""The tests for the emulated Hue component."""
import asyncio
import json
from datetime import timedelta
from ipaddress import ip_address
import json
from unittest.mock import patch
from aiohttp.hdrs import CONTENT_TYPE
import pytest
from tests.common import get_test_instance_port
from homeassistant import const, setup
from homeassistant.components import (
climate,
cover,
emulated_hue,
fan,
http,
light,
script,
emulated_hue,
media_player,
cover,
climate,
script,
)
from homeassistant.components.emulated_hue import Config
from homeassistant.components.emulated_hue.hue_api import (
HUE_API_STATE_ON,
HUE_API_STATE_BRI,
HUE_API_STATE_HUE,
HUE_API_STATE_ON,
HUE_API_STATE_SAT,
HUE_API_USERNAME,
HueUsernameView,
HueOneLightStateView,
HueAllLightsStateView,
HueOneLightChangeView,
HueAllGroupsStateView,
HueAllLightsStateView,
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
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()
BRIDGE_SERVER_PORT = get_test_instance_port()

View File

@ -1,5 +1,5 @@
"""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

View File

@ -1,15 +1,15 @@
"""The tests for the emulated Hue component."""
import json
import unittest
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 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()
BRIDGE_SERVER_PORT = get_test_instance_port()