mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Move imports to top for nanoleaf (#29359)
This commit is contained in:
parent
4989d1e7a9
commit
0e223662a9
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user