Move SmartThings imports to top (#24878)

* Move imports to top

* use lib constants

* Add missing three_axis mapping
This commit is contained in:
Andrew Sayre authored and GitHub committed 2019-06-30 22:29:21 -04:00
1 parent 7d651e2b7a
commit 7db4eeaf7f
12 files changed
+176 -191

No files matched your search

@@ -2,6 +2,7 @@
import logging
from aiohttp import ClientResponseError
from pysmartthings import APIResponseError, AppOAuth, SmartThings
import voluptuous as vol
from homeassistant import config_entries
@@ -54,8 +55,6 @@ class SmartThingsFlowHandler(config_entries.ConfigFlow):
async def async_step_user(self, user_input=None):
"""Get access token and validate it."""
from pysmartthings import APIResponseError, AppOAuth, SmartThings
errors = {}
if user_input is None or CONF_ACCESS_TOKEN not in user_input:
return self._show_step_user(errors)
@@ -182,8 +181,6 @@ class SmartThingsFlowHandler(config_entries.ConfigFlow):
Launched when the user completes the flow or when the SmartApp
is installed into an additional location.
"""
from pysmartthings import SmartThings
if not self.api:
# Launched from the SmartApp install event handler
self.api = SmartThings(