mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Correction to import lnetatmo right
This commit is contained in:
parent
1ed574b2a0
commit
4c47ed31ff
@ -15,7 +15,8 @@ from homeassistant.util import Throttle
|
|||||||
|
|
||||||
REQUIREMENTS = [
|
REQUIREMENTS = [
|
||||||
'https://github.com/HydrelioxGitHub/netatmo-api-python/archive/'
|
'https://github.com/HydrelioxGitHub/netatmo-api-python/archive/'
|
||||||
'f468d0926b1bc018df66896f5d67585343b56dda.zip']
|
'59d157d03db0aa167730044667591adea4457ca8.zip'
|
||||||
|
'#lnetatmo==0.3.0.dev1']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
SENSOR_TYPES = {
|
SENSOR_TYPES = {
|
||||||
@ -32,7 +33,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
""" Get the NetAtmo sensor. """
|
""" Get the NetAtmo sensor. """
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from lnetatmo import lnetatmo
|
import lnetatmo
|
||||||
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
_LOGGER.exception(
|
_LOGGER.exception(
|
||||||
@ -138,13 +139,13 @@ class NetAtmoData(object):
|
|||||||
""" Gets the latest data from NetAtmo. """
|
""" Gets the latest data from NetAtmo. """
|
||||||
|
|
||||||
def __init__(self, auth):
|
def __init__(self, auth):
|
||||||
from lnetatmo import DeviceList
|
|
||||||
|
|
||||||
self.auth = auth
|
self.auth = auth
|
||||||
self.data = None
|
self.data = None
|
||||||
|
|
||||||
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||||
def update(self):
|
def update(self):
|
||||||
|
import lnetatmo
|
||||||
""" Gets the latest data from NetAtmo. """
|
""" Gets the latest data from NetAtmo. """
|
||||||
devList = DeviceList(self.auth)
|
devList = lnetatmo.DeviceList(self.auth)
|
||||||
self.data = devList.lastData(exclude=3600)
|
self.data = devList.lastData(exclude=3600)
|
Loading…
x
Reference in New Issue
Block a user