From 08566f84cd228c3fef131f0c9e8390575cd60e8a Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 2 Jun 2020 19:37:52 +0200 Subject: [PATCH] Remove wunderlist, platform is decommissioned (#36380) --- .coveragerc | 1 - .../components/wunderlist/__init__.py | 91 ------------------- .../components/wunderlist/manifest.json | 7 -- .../components/wunderlist/services.yaml | 15 --- requirements_all.txt | 3 - 5 files changed, 117 deletions(-) delete mode 100644 homeassistant/components/wunderlist/__init__.py delete mode 100644 homeassistant/components/wunderlist/manifest.json delete mode 100644 homeassistant/components/wunderlist/services.yaml diff --git a/.coveragerc b/.coveragerc index 41398ac5f0e..9fd84e52be6 100644 --- a/.coveragerc +++ b/.coveragerc @@ -883,7 +883,6 @@ omit = homeassistant/components/wirelesstag/* homeassistant/components/worldtidesinfo/sensor.py homeassistant/components/worxlandroid/sensor.py - homeassistant/components/wunderlist/* homeassistant/components/x10/light.py homeassistant/components/xbox_live/sensor.py homeassistant/components/xeoma/camera.py diff --git a/homeassistant/components/wunderlist/__init__.py b/homeassistant/components/wunderlist/__init__.py deleted file mode 100644 index 30d665091b6..00000000000 --- a/homeassistant/components/wunderlist/__init__.py +++ /dev/null @@ -1,91 +0,0 @@ -"""Support to interact with Wunderlist.""" -import logging - -import voluptuous as vol -from wunderpy2 import WunderApi - -from homeassistant.const import CONF_ACCESS_TOKEN, CONF_CLIENT_ID, CONF_NAME -import homeassistant.helpers.config_validation as cv - -_LOGGER = logging.getLogger(__name__) - -DOMAIN = "wunderlist" - -CONF_LIST_NAME = "list_name" -CONF_STARRED = "starred" - - -CONFIG_SCHEMA = vol.Schema( - { - DOMAIN: vol.Schema( - { - vol.Required(CONF_CLIENT_ID): cv.string, - vol.Required(CONF_ACCESS_TOKEN): cv.string, - } - ) - }, - extra=vol.ALLOW_EXTRA, -) - - -SERVICE_CREATE_TASK = "create_task" - -SERVICE_SCHEMA_CREATE_TASK = vol.Schema( - { - vol.Required(CONF_LIST_NAME): cv.string, - vol.Required(CONF_NAME): cv.string, - vol.Optional(CONF_STARRED, default=False): cv.boolean, - } -) - - -def setup(hass, config): - """Set up the Wunderlist component.""" - conf = config[DOMAIN] - client_id = conf.get(CONF_CLIENT_ID) - access_token = conf.get(CONF_ACCESS_TOKEN) - data = Wunderlist(access_token, client_id) - if not data.check_credentials(): - _LOGGER.error("Invalid credentials") - return False - - hass.services.register( - DOMAIN, "create_task", data.create_task, schema=SERVICE_SCHEMA_CREATE_TASK - ) - return True - - -class Wunderlist: - """Representation of an interface to Wunderlist.""" - - def __init__(self, access_token, client_id): - """Create new instance of Wunderlist component.""" - api = WunderApi() - self._client = api.get_client(access_token, client_id) - - _LOGGER.debug("Instance created") - - def check_credentials(self): - """Check if the provided credentials are valid.""" - try: - self._client.get_lists() - return True - except ValueError: - return False - - def create_task(self, call): - """Create a new task on a list of Wunderlist.""" - list_name = call.data[CONF_LIST_NAME] - task_title = call.data[CONF_NAME] - starred = call.data[CONF_STARRED] - list_id = self._list_by_name(list_name) - self._client.create_task(list_id, task_title, starred=starred) - return True - - def _list_by_name(self, name): - """Return a list ID by name.""" - lists = self._client.get_lists() - tmp = [lst for lst in lists if lst["title"] == name] - if tmp: - return tmp[0]["id"] - return None diff --git a/homeassistant/components/wunderlist/manifest.json b/homeassistant/components/wunderlist/manifest.json deleted file mode 100644 index 414a5eb7d33..00000000000 --- a/homeassistant/components/wunderlist/manifest.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "domain": "wunderlist", - "name": "Wunderlist", - "documentation": "https://www.home-assistant.io/integrations/wunderlist", - "requirements": ["wunderpy2==0.1.6"], - "codeowners": [] -} diff --git a/homeassistant/components/wunderlist/services.yaml b/homeassistant/components/wunderlist/services.yaml deleted file mode 100644 index 1b824e43843..00000000000 --- a/homeassistant/components/wunderlist/services.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Describes the format for available Wunderlist - -create_task: - description: > - Create a new task in Wunderlist. - fields: - list_name: - description: name of the new list where the task will be created - example: "Shopping list" - name: - description: name of the new task - example: "Buy 5 bottles of beer" - starred: - description: Create the task as starred [Optional] - example: true diff --git a/requirements_all.txt b/requirements_all.txt index 92477ae5ea9..682ca8ed0f7 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2197,9 +2197,6 @@ withings-api==2.1.3 # homeassistant.components.wled wled==0.3.0 -# homeassistant.components.wunderlist -wunderpy2==0.1.6 - # homeassistant.components.xbee xbee-helper==0.0.7