mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Move imports in cisco_webex_teams component (#27878)
This commit is contained in:
parent
d7a8a635ba
commit
7ed5616faa
@ -2,11 +2,12 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
from webexteamssdk import ApiError, WebexTeamsAPI, exceptions
|
||||||
|
|
||||||
from homeassistant.components.notify import (
|
from homeassistant.components.notify import (
|
||||||
|
ATTR_TITLE,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
BaseNotificationService,
|
BaseNotificationService,
|
||||||
ATTR_TITLE,
|
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_TOKEN
|
from homeassistant.const import CONF_TOKEN
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
@ -22,7 +23,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||||||
|
|
||||||
def get_service(hass, config, discovery_info=None):
|
def get_service(hass, config, discovery_info=None):
|
||||||
"""Get the CiscoWebexTeams notification service."""
|
"""Get the CiscoWebexTeams notification service."""
|
||||||
from webexteamssdk import WebexTeamsAPI, exceptions
|
|
||||||
|
|
||||||
client = WebexTeamsAPI(access_token=config[CONF_TOKEN])
|
client = WebexTeamsAPI(access_token=config[CONF_TOKEN])
|
||||||
try:
|
try:
|
||||||
@ -45,7 +45,6 @@ class CiscoWebexTeamsNotificationService(BaseNotificationService):
|
|||||||
|
|
||||||
def send_message(self, message="", **kwargs):
|
def send_message(self, message="", **kwargs):
|
||||||
"""Send a message to a user."""
|
"""Send a message to a user."""
|
||||||
from webexteamssdk import ApiError
|
|
||||||
|
|
||||||
title = ""
|
title = ""
|
||||||
if kwargs.get(ATTR_TITLE) is not None:
|
if kwargs.get(ATTR_TITLE) is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user