Move imports to top for raincloud (#29283)
This commit is contained in:
parent
9f649ed345
commit
84d6a5369f
1 changed files with 1 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from raincloudy.core import RainCloudy
|
||||||
from requests.exceptions import ConnectTimeout, HTTPError
|
from requests.exceptions import ConnectTimeout, HTTPError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -96,8 +97,6 @@ def setup(hass, config):
|
||||||
scan_interval = conf.get(CONF_SCAN_INTERVAL)
|
scan_interval = conf.get(CONF_SCAN_INTERVAL)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from raincloudy.core import RainCloudy
|
|
||||||
|
|
||||||
raincloud = RainCloudy(username=username, password=password)
|
raincloud = RainCloudy(username=username, password=password)
|
||||||
if not raincloud.is_connected:
|
if not raincloud.is_connected:
|
||||||
raise HTTPError
|
raise HTTPError
|
||||||
|
|
Loading…
Add table
Reference in a new issue