Move imports to top for yale_smart_alarm (#29074)

This commit is contained in:
springstan 2019-11-26 00:40:25 +01:00 committed by Paulus Schoutsen
parent 729116ff3a
commit c95a01ce3a

View File

@ -2,6 +2,13 @@
import logging
import voluptuous as vol
from yalesmartalarmclient.client import (
YaleSmartAlarmClient,
AuthenticationError,
YALE_STATE_DISARM,
YALE_STATE_ARM_PARTIAL,
YALE_STATE_ARM_FULL,
)
from homeassistant.components.alarm_control_panel import (
AlarmControlPanel,
@ -42,8 +49,6 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
password = config[CONF_PASSWORD]
area_id = config[CONF_AREA_ID]
from yalesmartalarmclient.client import YaleSmartAlarmClient, AuthenticationError
try:
client = YaleSmartAlarmClient(username, password, area_id)
except AuthenticationError:
@ -62,12 +67,6 @@ class YaleAlarmDevice(AlarmControlPanel):
self._client = client
self._state = None
from yalesmartalarmclient.client import (
YALE_STATE_DISARM,
YALE_STATE_ARM_PARTIAL,
YALE_STATE_ARM_FULL,
)
self._state_map = {
YALE_STATE_DISARM: STATE_ALARM_DISARMED,
YALE_STATE_ARM_PARTIAL: STATE_ALARM_ARMED_HOME,