From 4bb82fa8adea2fe5c7f94abe7e85ab7ed77aef5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diefferson=20Koderer=20M=C3=B4ro?= Date: Mon, 21 Oct 2019 04:48:25 -0300 Subject: [PATCH] Move imports in message_bird component (#28022) --- homeassistant/components/message_bird/notify.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/message_bird/notify.py b/homeassistant/components/message_bird/notify.py index 5df02ef69c45..ce1d275a8320 100644 --- a/homeassistant/components/message_bird/notify.py +++ b/homeassistant/components/message_bird/notify.py @@ -1,16 +1,17 @@ """MessageBird platform for notify component.""" import logging +import messagebird +from messagebird.client import ErrorException import voluptuous as vol -from homeassistant.const import CONF_API_KEY, CONF_SENDER -import homeassistant.helpers.config_validation as cv - from homeassistant.components.notify import ( ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService, ) +from homeassistant.const import CONF_API_KEY, CONF_SENDER +import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) @@ -26,8 +27,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def get_service(hass, config, discovery_info=None): """Get the MessageBird notification service.""" - import messagebird - client = messagebird.Client(config[CONF_API_KEY]) try: # validates the api key @@ -49,8 +48,6 @@ class MessageBirdNotificationService(BaseNotificationService): def send_message(self, message=None, **kwargs): """Send a message to a specified target.""" - from messagebird.client import ErrorException - targets = kwargs.get(ATTR_TARGET) if not targets: _LOGGER.error("No target specified")