mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +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."""
|
"""Support for Nanoleaf Lights."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from pynanoleaf import Nanoleaf, Unavailable
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
@ -54,7 +55,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||||||
|
|
||||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||||
"""Set up the Nanoleaf light."""
|
"""Set up the Nanoleaf light."""
|
||||||
from pynanoleaf import Nanoleaf, Unavailable
|
|
||||||
|
|
||||||
if DATA_NANOLEAF not in hass.data:
|
if DATA_NANOLEAF not in hass.data:
|
||||||
hass.data[DATA_NANOLEAF] = dict()
|
hass.data[DATA_NANOLEAF] = dict()
|
||||||
@ -222,7 +222,6 @@ class NanoleafLight(Light):
|
|||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Fetch new state data for this light."""
|
"""Fetch new state data for this light."""
|
||||||
from pynanoleaf import Unavailable
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._available = self._light.available
|
self._available = self._light.available
|
||||||
|
Loading…
x
Reference in New Issue
Block a user