mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Replace webexteamssdk with webexpythonsdk (#127928)
This commit is contained in:
parent
36a1eaedcf
commit
aac5ac6057
@ -1 +1 @@
|
|||||||
"""Component to integrate the Cisco Webex Teams cloud."""
|
"""Component to integrate the Cisco Webex cloud."""
|
||||||
|
@ -2,9 +2,8 @@
|
|||||||
"domain": "cisco_webex_teams",
|
"domain": "cisco_webex_teams",
|
||||||
"name": "Cisco Webex Teams",
|
"name": "Cisco Webex Teams",
|
||||||
"codeowners": ["@fbradyirl"],
|
"codeowners": ["@fbradyirl"],
|
||||||
"disabled": "Integration library not compatible with Python 3.12",
|
|
||||||
"documentation": "https://www.home-assistant.io/integrations/cisco_webex_teams",
|
"documentation": "https://www.home-assistant.io/integrations/cisco_webex_teams",
|
||||||
"iot_class": "cloud_push",
|
"iot_class": "cloud_push",
|
||||||
"loggers": ["webexteamssdk"],
|
"loggers": ["webexpythonsdk"],
|
||||||
"requirements": ["webexteamssdk==1.1.1;python_version<'3.12'"]
|
"requirements": ["webexpythonsdk==2.0.1"]
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
"""Cisco Webex Teams notify component."""
|
"""Cisco Webex notify component."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from webexteamssdk import ApiError, WebexTeamsAPI, exceptions
|
from webexpythonsdk import ApiError, WebexAPI, exceptions
|
||||||
|
|
||||||
from homeassistant.components.notify import (
|
from homeassistant.components.notify import (
|
||||||
ATTR_TITLE,
|
ATTR_TITLE,
|
||||||
@ -30,9 +30,9 @@ def get_service(
|
|||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config: ConfigType,
|
config: ConfigType,
|
||||||
discovery_info: DiscoveryInfoType | None = None,
|
discovery_info: DiscoveryInfoType | None = None,
|
||||||
) -> CiscoWebexTeamsNotificationService | None:
|
) -> CiscoWebexNotificationService | None:
|
||||||
"""Get the CiscoWebexTeams notification service."""
|
"""Get the Cisco Webex notification service."""
|
||||||
client = WebexTeamsAPI(access_token=config[CONF_TOKEN])
|
client = WebexAPI(access_token=config[CONF_TOKEN])
|
||||||
try:
|
try:
|
||||||
# Validate the token & room_id
|
# Validate the token & room_id
|
||||||
client.rooms.get(config[CONF_ROOM_ID])
|
client.rooms.get(config[CONF_ROOM_ID])
|
||||||
@ -40,11 +40,11 @@ def get_service(
|
|||||||
_LOGGER.error(error)
|
_LOGGER.error(error)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return CiscoWebexTeamsNotificationService(client, config[CONF_ROOM_ID])
|
return CiscoWebexNotificationService(client, config[CONF_ROOM_ID])
|
||||||
|
|
||||||
|
|
||||||
class CiscoWebexTeamsNotificationService(BaseNotificationService):
|
class CiscoWebexNotificationService(BaseNotificationService):
|
||||||
"""The Cisco Webex Teams Notification Service."""
|
"""The Cisco Webex Notification Service."""
|
||||||
|
|
||||||
def __init__(self, client, room):
|
def __init__(self, client, room):
|
||||||
"""Initialize the service."""
|
"""Initialize the service."""
|
||||||
@ -62,5 +62,5 @@ class CiscoWebexTeamsNotificationService(BaseNotificationService):
|
|||||||
self.client.messages.create(roomId=self.room, html=f"{title}{message}")
|
self.client.messages.create(roomId=self.room, html=f"{title}{message}")
|
||||||
except ApiError as api_error:
|
except ApiError as api_error:
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Could not send CiscoWebexTeams notification. Error: %s", api_error
|
"Could not send Cisco Webex notification. Error: %s", api_error
|
||||||
)
|
)
|
||||||
|
@ -2958,6 +2958,9 @@ waterfurnace==1.1.0
|
|||||||
# homeassistant.components.weatherflow_cloud
|
# homeassistant.components.weatherflow_cloud
|
||||||
weatherflow4py==1.0.6
|
weatherflow4py==1.0.6
|
||||||
|
|
||||||
|
# homeassistant.components.cisco_webex_teams
|
||||||
|
webexpythonsdk==2.0.1
|
||||||
|
|
||||||
# homeassistant.components.webmin
|
# homeassistant.components.webmin
|
||||||
webmin-xmlrpc==0.0.2
|
webmin-xmlrpc==0.0.2
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user