Skip to content

Commit

Permalink
Move imports to top for kiwi (#29403)
Browse files Browse the repository at this point in the history
  • Loading branch information
springstan authored and fabaff committed Dec 4, 2019
1 parent fd107f2 commit 1d65670
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions homeassistant/components/kiwi/lock.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
"""Support for the KIWI.KI lock platform."""
import logging

from kiwiki import KiwiClient, KiwiException
import voluptuous as vol

import homeassistant.helpers.config_validation as cv
from homeassistant.components.lock import LockDevice, PLATFORM_SCHEMA
from homeassistant.components.lock import PLATFORM_SCHEMA, LockDevice
from homeassistant.const import (
CONF_PASSWORD,
CONF_USERNAME,
ATTR_ID,
ATTR_LONGITUDE,
ATTR_LATITUDE,
ATTR_LONGITUDE,
CONF_PASSWORD,
CONF_USERNAME,
STATE_LOCKED,
STATE_UNLOCKED,
)
from homeassistant.helpers.event import async_call_later
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_call_later

_LOGGER = logging.getLogger(__name__)

Expand All @@ -32,7 +33,6 @@

def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the KIWI lock platform."""
from kiwiki import KiwiClient, KiwiException

try:
kiwi = KiwiClient(config[CONF_USERNAME], config[CONF_PASSWORD])
Expand Down Expand Up @@ -98,7 +98,6 @@ def clear_unlock_state(self, _):

def unlock(self, **kwargs):
"""Unlock the device."""
from kiwiki import KiwiException

try:
self._client.open_door(self.lock_id)
Expand Down

0 comments on commit 1d65670

Please sign in to comment.