Move imports to top for nanoleaf (#29359)

This commit is contained in:
springstan authored and Paulus Schoutsen committed 2019-12-03 15:45:46 -08:00
1 parent 4989d1e7a9
commit 0e223662a9
1 file changed
+1 -2
+1 -2
View File
@@ -1,6 +1,7 @@
"""Support for Nanoleaf Lights."""
import logging
from pynanoleaf import Nanoleaf, Unavailable
import voluptuous as vol
from homeassistant.components.light import (
@@ -54,7 +55,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Nanoleaf light."""
from pynanoleaf import Nanoleaf, Unavailable
if DATA_NANOLEAF not in hass.data:
hass.data[DATA_NANOLEAF] = dict()
@@ -222,7 +222,6 @@ class NanoleafLight(Light):
def update(self):
"""Fetch new state data for this light."""
from pynanoleaf import Unavailable
try:
self._available = self._light.available