diff --git a/homeassistant/components/rocketchat/notify.py b/homeassistant/components/rocketchat/notify.py index 8657d0f9450..2b5b8dcd235 100644 --- a/homeassistant/components/rocketchat/notify.py +++ b/homeassistant/components/rocketchat/notify.py @@ -1,16 +1,20 @@ """Rocket.Chat notification service.""" import logging +from rocketchat_API.APIExceptions.RocketExceptions import ( + RocketAuthenticationException, + RocketConnectionException, +) +from rocketchat_API.rocketchat import RocketChat import voluptuous as vol -from homeassistant.const import CONF_PASSWORD, CONF_ROOM, CONF_URL, CONF_USERNAME -import homeassistant.helpers.config_validation as cv - from homeassistant.components.notify import ( ATTR_DATA, PLATFORM_SCHEMA, BaseNotificationService, ) +from homeassistant.const import CONF_PASSWORD, CONF_ROOM, CONF_URL, CONF_USERNAME +import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) @@ -27,10 +31,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def get_service(hass, config, discovery_info=None): """Return the notify service.""" - from rocketchat_API.APIExceptions.RocketExceptions import ( - RocketConnectionException, - RocketAuthenticationException, - ) username = config.get(CONF_USERNAME) password = config.get(CONF_PASSWORD) @@ -54,7 +54,6 @@ class RocketChatNotificationService(BaseNotificationService): def __init__(self, url, username, password, room): """Initialize the service.""" - from rocketchat_API.rocketchat import RocketChat self._room = room self._server = RocketChat(username, password, server_url=url)