From 658d33805828d0de0a02f3f2962c15526291c248 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 13 Jan 2020 19:23:26 +0100 Subject: [PATCH] Removes Cisco Spark integration (#30738) --- .coveragerc | 1 - CODEOWNERS | 1 - .../components/ciscospark/__init__.py | 1 - .../components/ciscospark/manifest.json | 8 --- homeassistant/components/ciscospark/notify.py | 52 ------------------- requirements_all.txt | 3 -- 6 files changed, 66 deletions(-) delete mode 100644 homeassistant/components/ciscospark/__init__.py delete mode 100644 homeassistant/components/ciscospark/manifest.json delete mode 100644 homeassistant/components/ciscospark/notify.py diff --git a/.coveragerc b/.coveragerc index be11fa5998c..3afc6b4fd3e 100644 --- a/.coveragerc +++ b/.coveragerc @@ -116,7 +116,6 @@ omit = homeassistant/components/cisco_ios/device_tracker.py homeassistant/components/cisco_mobility_express/device_tracker.py homeassistant/components/cisco_webex_teams/notify.py - homeassistant/components/ciscospark/notify.py homeassistant/components/citybikes/sensor.py homeassistant/components/clementine/media_player.py homeassistant/components/clickatell/notify.py diff --git a/CODEOWNERS b/CODEOWNERS index 3371dc62a5e..c06f9c07d76 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -59,7 +59,6 @@ homeassistant/components/cert_expiry/* @Cereal2nd @jjlawren homeassistant/components/cisco_ios/* @fbradyirl homeassistant/components/cisco_mobility_express/* @fbradyirl homeassistant/components/cisco_webex_teams/* @fbradyirl -homeassistant/components/ciscospark/* @fbradyirl homeassistant/components/cloud/* @home-assistant/cloud homeassistant/components/cloudflare/* @ludeeus homeassistant/components/comfoconnect/* @michaelarnauts diff --git a/homeassistant/components/ciscospark/__init__.py b/homeassistant/components/ciscospark/__init__.py deleted file mode 100644 index f872a0257f7..00000000000 --- a/homeassistant/components/ciscospark/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""The ciscospark component.""" diff --git a/homeassistant/components/ciscospark/manifest.json b/homeassistant/components/ciscospark/manifest.json deleted file mode 100644 index 4fd87a8a5e4..00000000000 --- a/homeassistant/components/ciscospark/manifest.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "domain": "ciscospark", - "name": "Cisco Spark", - "documentation": "https://www.home-assistant.io/integrations/ciscospark", - "requirements": ["ciscosparkapi==0.4.2"], - "dependencies": [], - "codeowners": ["@fbradyirl"] -} diff --git a/homeassistant/components/ciscospark/notify.py b/homeassistant/components/ciscospark/notify.py deleted file mode 100644 index e765aff05f6..00000000000 --- a/homeassistant/components/ciscospark/notify.py +++ /dev/null @@ -1,52 +0,0 @@ -"""Cisco Spark platform for notify component.""" -import logging - -from ciscosparkapi import CiscoSparkAPI, SparkApiError -import voluptuous as vol - -from homeassistant.components.notify import ( - ATTR_TITLE, - PLATFORM_SCHEMA, - BaseNotificationService, -) -from homeassistant.const import CONF_TOKEN -import homeassistant.helpers.config_validation as cv - -_LOGGER = logging.getLogger(__name__) - -CONF_ROOMID = "roomid" - -PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( - {vol.Required(CONF_TOKEN): cv.string, vol.Required(CONF_ROOMID): cv.string} -) - - -def get_service(hass, config, discovery_info=None): - """Get the CiscoSpark notification service.""" - return CiscoSparkNotificationService( - config.get(CONF_TOKEN), config.get(CONF_ROOMID) - ) - - -class CiscoSparkNotificationService(BaseNotificationService): - """The Cisco Spark Notification Service.""" - - def __init__(self, token, default_room): - """Initialize the service.""" - - self._default_room = default_room - self._token = token - self._spark = CiscoSparkAPI(access_token=self._token) - - def send_message(self, message="", **kwargs): - """Send a message to a user.""" - - try: - title = "" - if kwargs.get(ATTR_TITLE) is not None: - title = kwargs.get(ATTR_TITLE) + ": " - self._spark.messages.create(roomId=self._default_room, text=title + message) - except SparkApiError as api_error: - _LOGGER.error( - "Could not send CiscoSpark notification. Error: %s", api_error - ) diff --git a/requirements_all.txt b/requirements_all.txt index 353345e2a60..6684969490e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -366,9 +366,6 @@ caldav==0.6.1 # homeassistant.components.cisco_mobility_express ciscomobilityexpress==0.3.3 -# homeassistant.components.ciscospark -ciscosparkapi==0.4.2 - # homeassistant.components.cppm_tracker clearpasspy==1.0.2