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 2019-06-30 22:29:21 -04:00 committed by GitHub
parent 7d651e2b7a
commit 7db4eeaf7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 176 additions and 191 deletions

View file

@ -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(