Skip to content

Commit

Permalink
Move imports in hue component
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentame committed Oct 9, 2019
1 parent 9ea58b9 commit ec9b7c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/hue/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import json
import os

from aiohue.discovery import discover_nupnp
import async_timeout
import voluptuous as vol
from aiohue.discovery import discover_nupnp

from homeassistant import config_entries
from homeassistant.components.ssdp import ATTR_MANUFACTURERURL
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client

Expand Down Expand Up @@ -133,7 +134,6 @@ async def async_step_ssdp(self, discovery_info):
This flow is triggered by the SSDP component. It will check if the
host is already configured and delegate to the import step if not.
"""
from homeassistant.components.ssdp import ATTR_MANUFACTURERURL

if discovery_info[ATTR_MANUFACTURERURL] != HUE_MANUFACTURERURL:
return self.async_abort(reason="not_hue_bridge")
Expand Down
17 changes: 8 additions & 9 deletions homeassistant/components/hue/sensor_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
from homeassistant.helpers.event import async_track_point_in_utc_time
from homeassistant.util.dt import utcnow

import aiohue
from .binary_sensor import HuePresence, PRESENCE_NAME_FORMAT
from .sensor import (
HueLightLevel,
HueTemperature,
LIGHT_LEVEL_NAME_FORMAT,
TEMPERATURE_NAME_FORMAT,
)

CURRENT_SENSORS = "current_sensors"
SENSOR_MANAGER_FORMAT = "{}_sensor_manager"
Expand Down Expand Up @@ -52,14 +60,6 @@ class SensorManager:

def __init__(self, hass, bridge):
"""Initialize the sensor manager."""
import aiohue
from .binary_sensor import HuePresence, PRESENCE_NAME_FORMAT
from .sensor import (
HueLightLevel,
HueTemperature,
LIGHT_LEVEL_NAME_FORMAT,
TEMPERATURE_NAME_FORMAT,
)

self.hass = hass
self.bridge = bridge
Expand Down Expand Up @@ -115,7 +115,6 @@ async def async_update_bridge(now):

async def async_update_items(self):
"""Update sensors from the bridge."""
import aiohue

api = self.bridge.api.sensors

Expand Down

0 comments on commit ec9b7c2

Please sign in to comment.