Move imports to top for joaoapps_join (#29402)
This commit is contained in:
1 parent
e04a208af0
commit
73e25296ca
2 files changed
+13
-13
No files matched your search
@@ -1,6 +1,9 @@
|
||||
"""Support for Join notifications."""
|
||||
import logging
|
||||
|
||||
from pyjoin import get_devices, send_notification
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA,
|
||||
ATTR_TITLE,
|
||||
@@ -34,8 +37,6 @@ def get_service(hass, config, discovery_info=None):
|
||||
device_ids = config.get(CONF_DEVICE_IDS)
|
||||
device_names = config.get(CONF_DEVICE_NAMES)
|
||||
if api_key:
|
||||
from pyjoin import get_devices
|
||||
|
||||
if not get_devices(api_key):
|
||||
_LOGGER.error("Error connecting to Join. Check the API key")
|
||||
return False
|
||||
@@ -60,7 +61,6 @@ class JoinNotificationService(BaseNotificationService):
|
||||
|
||||
def send_message(self, message="", **kwargs):
|
||||
"""Send a message to a user."""
|
||||
from pyjoin import send_notification
|
||||
|
||||
title = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)
|
||||
data = kwargs.get(ATTR_DATA) or {}
|
||||
|
||||
Reference in new issue
Block a user