From 5f1edbccd1ad851e12bdb3481a309da98aad8e44 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 25 Jan 2023 12:21:26 +0100 Subject: [PATCH] Remove Almond integration (#86616) --- CODEOWNERS | 2 - homeassistant/components/almond/__init__.py | 298 ------------------ .../components/almond/config_flow.py | 124 -------- homeassistant/components/almond/const.py | 4 - homeassistant/components/almond/manifest.json | 11 - homeassistant/components/almond/strings.json | 19 -- .../components/almond/translations/bg.json | 14 - .../components/almond/translations/ca.json | 19 -- .../components/almond/translations/cs.json | 19 -- .../components/almond/translations/da.json | 17 - .../components/almond/translations/de.json | 19 -- .../components/almond/translations/el.json | 19 -- .../components/almond/translations/en.json | 19 -- .../almond/translations/es-419.json | 17 - .../components/almond/translations/es.json | 19 -- .../components/almond/translations/et.json | 19 -- .../components/almond/translations/fi.json | 7 - .../components/almond/translations/fr.json | 19 -- .../components/almond/translations/he.json | 15 - .../components/almond/translations/hu.json | 19 -- .../components/almond/translations/id.json | 19 -- .../components/almond/translations/it.json | 19 -- .../components/almond/translations/ja.json | 19 -- .../components/almond/translations/ko.json | 19 -- .../components/almond/translations/lb.json | 19 -- .../components/almond/translations/nl.json | 19 -- .../components/almond/translations/no.json | 19 -- .../components/almond/translations/pl.json | 19 -- .../components/almond/translations/pt-BR.json | 19 -- .../components/almond/translations/pt.json | 15 - .../components/almond/translations/ru.json | 19 -- .../components/almond/translations/sk.json | 19 -- .../components/almond/translations/sl.json | 17 - .../components/almond/translations/sv.json | 19 -- .../components/almond/translations/tr.json | 19 -- .../components/almond/translations/uk.json | 19 -- .../almond/translations/zh-Hant.json | 19 -- homeassistant/generated/config_flows.py | 1 - homeassistant/generated/integrations.json | 6 - requirements_all.txt | 3 - requirements_test_all.txt | 3 - tests/components/almond/__init__.py | 1 - tests/components/almond/test_config_flow.py | 163 ---------- tests/components/almond/test_init.py | 116 ------- 44 files changed, 1309 deletions(-) delete mode 100644 homeassistant/components/almond/__init__.py delete mode 100644 homeassistant/components/almond/config_flow.py delete mode 100644 homeassistant/components/almond/const.py delete mode 100644 homeassistant/components/almond/manifest.json delete mode 100644 homeassistant/components/almond/strings.json delete mode 100644 homeassistant/components/almond/translations/bg.json delete mode 100644 homeassistant/components/almond/translations/ca.json delete mode 100644 homeassistant/components/almond/translations/cs.json delete mode 100644 homeassistant/components/almond/translations/da.json delete mode 100644 homeassistant/components/almond/translations/de.json delete mode 100644 homeassistant/components/almond/translations/el.json delete mode 100644 homeassistant/components/almond/translations/en.json delete mode 100644 homeassistant/components/almond/translations/es-419.json delete mode 100644 homeassistant/components/almond/translations/es.json delete mode 100644 homeassistant/components/almond/translations/et.json delete mode 100644 homeassistant/components/almond/translations/fi.json delete mode 100644 homeassistant/components/almond/translations/fr.json delete mode 100644 homeassistant/components/almond/translations/he.json delete mode 100644 homeassistant/components/almond/translations/hu.json delete mode 100644 homeassistant/components/almond/translations/id.json delete mode 100644 homeassistant/components/almond/translations/it.json delete mode 100644 homeassistant/components/almond/translations/ja.json delete mode 100644 homeassistant/components/almond/translations/ko.json delete mode 100644 homeassistant/components/almond/translations/lb.json delete mode 100644 homeassistant/components/almond/translations/nl.json delete mode 100644 homeassistant/components/almond/translations/no.json delete mode 100644 homeassistant/components/almond/translations/pl.json delete mode 100644 homeassistant/components/almond/translations/pt-BR.json delete mode 100644 homeassistant/components/almond/translations/pt.json delete mode 100644 homeassistant/components/almond/translations/ru.json delete mode 100644 homeassistant/components/almond/translations/sk.json delete mode 100644 homeassistant/components/almond/translations/sl.json delete mode 100644 homeassistant/components/almond/translations/sv.json delete mode 100644 homeassistant/components/almond/translations/tr.json delete mode 100644 homeassistant/components/almond/translations/uk.json delete mode 100644 homeassistant/components/almond/translations/zh-Hant.json delete mode 100644 tests/components/almond/__init__.py delete mode 100644 tests/components/almond/test_config_flow.py delete mode 100644 tests/components/almond/test_init.py diff --git a/CODEOWNERS b/CODEOWNERS index 367e93a6681e1a..a4a5171e3bcb38 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -67,8 +67,6 @@ build.json @home-assistant/supervisor /tests/components/alert/ @home-assistant/core @frenck /homeassistant/components/alexa/ @home-assistant/cloud @ochlocracy @jbouwh /tests/components/alexa/ @home-assistant/cloud @ochlocracy @jbouwh -/homeassistant/components/almond/ @gcampax @balloob -/tests/components/almond/ @gcampax @balloob /homeassistant/components/amberelectric/ @madpilot /tests/components/amberelectric/ @madpilot /homeassistant/components/ambiclimate/ @danielhiversen diff --git a/homeassistant/components/almond/__init__.py b/homeassistant/components/almond/__init__.py deleted file mode 100644 index 39bd2a10335ef4..00000000000000 --- a/homeassistant/components/almond/__init__.py +++ /dev/null @@ -1,298 +0,0 @@ -"""Support for Almond.""" -from __future__ import annotations - -import asyncio -from datetime import timedelta -import logging -import time -from typing import Any - -from aiohttp import ClientError, ClientSession -import async_timeout -from pyalmond import AbstractAlmondWebAuth, AlmondLocalAuth, WebAlmondAPI -import voluptuous as vol - -from homeassistant.auth.const import GROUP_ID_ADMIN -from homeassistant.components import conversation -from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry -from homeassistant.const import ( - CONF_CLIENT_ID, - CONF_CLIENT_SECRET, - CONF_HOST, - CONF_TYPE, - EVENT_HOMEASSISTANT_START, -) -from homeassistant.core import CoreState, HomeAssistant -from homeassistant.exceptions import ConfigEntryNotReady -from homeassistant.helpers import ( - aiohttp_client, - config_entry_oauth2_flow, - config_validation as cv, - event, - intent, - network, - storage, -) -from homeassistant.helpers.typing import ConfigType - -from . import config_flow -from .const import DOMAIN, TYPE_LOCAL, TYPE_OAUTH2 - -STORAGE_VERSION = 1 -STORAGE_KEY = DOMAIN - -ALMOND_SETUP_DELAY = 30 - -DEFAULT_OAUTH2_HOST = "https://almond.stanford.edu" -DEFAULT_LOCAL_HOST = "http://localhost:3000" - -CONFIG_SCHEMA = vol.Schema( - { - DOMAIN: vol.Any( - vol.Schema( - { - vol.Required(CONF_TYPE): TYPE_OAUTH2, - vol.Required(CONF_CLIENT_ID): cv.string, - vol.Required(CONF_CLIENT_SECRET): cv.string, - vol.Optional(CONF_HOST, default=DEFAULT_OAUTH2_HOST): cv.url, - } - ), - vol.Schema( - {vol.Required(CONF_TYPE): TYPE_LOCAL, vol.Required(CONF_HOST): cv.url} - ), - ) - }, - extra=vol.ALLOW_EXTRA, -) -_LOGGER = logging.getLogger(__name__) - - -async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: - """Set up the Almond component.""" - hass.data[DOMAIN] = {} - - if DOMAIN not in config: - return True - - conf = config[DOMAIN] - - host = conf[CONF_HOST] - - if conf[CONF_TYPE] == TYPE_OAUTH2: - config_flow.AlmondFlowHandler.async_register_implementation( - hass, - config_entry_oauth2_flow.LocalOAuth2Implementation( - hass, - DOMAIN, - conf[CONF_CLIENT_ID], - conf[CONF_CLIENT_SECRET], - f"{host}/me/api/oauth2/authorize", - f"{host}/me/api/oauth2/token", - ), - ) - return True - - if not hass.config_entries.async_entries(DOMAIN): - hass.async_create_task( - hass.config_entries.flow.async_init( - DOMAIN, - context={"source": SOURCE_IMPORT}, - data={"type": TYPE_LOCAL, "host": conf[CONF_HOST]}, - ) - ) - return True - - -async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: - """Set up Almond config entry.""" - websession = aiohttp_client.async_get_clientsession(hass) - - if entry.data["type"] == TYPE_LOCAL: - auth = AlmondLocalAuth(entry.data["host"], websession) - else: - # OAuth2 - implementation = ( - await config_entry_oauth2_flow.async_get_config_entry_implementation( - hass, entry - ) - ) - oauth_session = config_entry_oauth2_flow.OAuth2Session( - hass, entry, implementation - ) - auth = AlmondOAuth(entry.data["host"], websession, oauth_session) - - api = WebAlmondAPI(auth) - agent = AlmondAgent(hass, api, entry) - - # Hass.io does its own configuration. - if not entry.data.get("is_hassio"): - # If we're not starting or local, set up Almond right away - if hass.state != CoreState.not_running or entry.data["type"] == TYPE_LOCAL: - await _configure_almond_for_ha(hass, entry, api) - - else: - # OAuth2 implementations can potentially rely on the HA Cloud url. - # This url is not be available until 30 seconds after boot. - - async def configure_almond(_now): - try: - await _configure_almond_for_ha(hass, entry, api) - except ConfigEntryNotReady: - _LOGGER.warning( - "Unable to configure Almond to connect to Home Assistant" - ) - - async def almond_hass_start(_event): - event.async_call_later(hass, ALMOND_SETUP_DELAY, configure_almond) - - hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, almond_hass_start) - - conversation.async_set_agent(hass, entry, agent) - return True - - -async def _configure_almond_for_ha( - hass: HomeAssistant, entry: ConfigEntry, api: WebAlmondAPI -): - """Configure Almond to connect to HA.""" - try: - if entry.data["type"] == TYPE_OAUTH2: - # If we're connecting over OAuth2, we will only set up connection - # with Home Assistant if we're remotely accessible. - hass_url = network.get_url(hass, allow_internal=False, prefer_cloud=True) - else: - hass_url = network.get_url(hass) - except network.NoURLAvailableError: - # If no URL is available, we're not going to configure Almond to connect to HA. - return - - _LOGGER.debug("Configuring Almond to connect to Home Assistant at %s", hass_url) - store = storage.Store[dict[str, Any]](hass, STORAGE_VERSION, STORAGE_KEY) - data = await store.async_load() - - if data is None: - data = {} - - user = None - if "almond_user" in data: - user = await hass.auth.async_get_user(data["almond_user"]) - - if user is None: - user = await hass.auth.async_create_system_user( - "Almond", group_ids=[GROUP_ID_ADMIN] - ) - data["almond_user"] = user.id - await store.async_save(data) - - refresh_token = await hass.auth.async_create_refresh_token( - user, - # Almond will be fine as long as we restart once every 5 years - access_token_expiration=timedelta(days=365 * 5), - ) - - # Create long lived access token - access_token = hass.auth.async_create_access_token(refresh_token) - - # Store token in Almond - try: - async with async_timeout.timeout(30): - await api.async_create_device( - { - "kind": "io.home-assistant", - "hassUrl": hass_url, - "accessToken": access_token, - "refreshToken": "", - # 5 years from now in ms. - "accessTokenExpires": (time.time() + 60 * 60 * 24 * 365 * 5) * 1000, - } - ) - except (asyncio.TimeoutError, ClientError) as err: - if isinstance(err, asyncio.TimeoutError): - msg: str | ClientError = "Request timeout" - else: - msg = err - _LOGGER.warning("Unable to configure Almond: %s", msg) - await hass.auth.async_remove_refresh_token(refresh_token) - raise ConfigEntryNotReady from err - - # Clear all other refresh tokens - for token in list(user.refresh_tokens.values()): - if token.id != refresh_token.id: - await hass.auth.async_remove_refresh_token(token) - - -async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: - """Unload Almond.""" - conversation.async_unset_agent(hass, entry) - return True - - -class AlmondOAuth(AbstractAlmondWebAuth): - """Almond Authentication using OAuth2.""" - - def __init__( - self, - host: str, - websession: ClientSession, - oauth_session: config_entry_oauth2_flow.OAuth2Session, - ) -> None: - """Initialize Almond auth.""" - super().__init__(host, websession) - self._oauth_session = oauth_session - - async def async_get_access_token(self): - """Return a valid access token.""" - if not self._oauth_session.valid_token: - await self._oauth_session.async_ensure_token_valid() - - return self._oauth_session.token["access_token"] - - -class AlmondAgent(conversation.AbstractConversationAgent): - """Almond conversation agent.""" - - def __init__( - self, hass: HomeAssistant, api: WebAlmondAPI, entry: ConfigEntry - ) -> None: - """Initialize the agent.""" - self.hass = hass - self.api = api - self.entry = entry - - @property - def attribution(self): - """Return the attribution.""" - return {"name": "Powered by Almond", "url": "https://almond.stanford.edu/"} - - async def async_process( - self, user_input: conversation.ConversationInput - ) -> conversation.ConversationResult: - """Process a sentence.""" - response = await self.api.async_converse_text( - user_input.text, user_input.conversation_id - ) - - first_choice = True - buffer = "" - for message in response["messages"]: - if message["type"] == "text": - buffer += f"\n{message['text']}" - elif message["type"] == "picture": - buffer += f"\n Picture: {message['url']}" - elif message["type"] == "rdl": - buffer += ( - f"\n Link: {message['rdl']['displayTitle']} " - f"{message['rdl']['webCallback']}" - ) - elif message["type"] == "choice": - if first_choice: - first_choice = False - else: - buffer += "," - buffer += f" {message['title']}" - - intent_response = intent.IntentResponse(language=user_input.language) - intent_response.async_set_speech(buffer.strip()) - return conversation.ConversationResult( - response=intent_response, conversation_id=user_input.conversation_id - ) diff --git a/homeassistant/components/almond/config_flow.py b/homeassistant/components/almond/config_flow.py deleted file mode 100644 index f0ce9377b81cb7..00000000000000 --- a/homeassistant/components/almond/config_flow.py +++ /dev/null @@ -1,124 +0,0 @@ -"""Config flow to connect with Home Assistant.""" -from __future__ import annotations - -import asyncio -import logging -from typing import Any - -from aiohttp import ClientError -import async_timeout -from pyalmond import AlmondLocalAuth, WebAlmondAPI -from yarl import URL - -from homeassistant import core, data_entry_flow -from homeassistant.components.hassio import HassioServiceInfo -from homeassistant.data_entry_flow import FlowResult -from homeassistant.helpers import aiohttp_client, config_entry_oauth2_flow - -from .const import DOMAIN, TYPE_LOCAL, TYPE_OAUTH2 - - -async def async_verify_local_connection(hass: core.HomeAssistant, host: str): - """Verify that a local connection works.""" - websession = aiohttp_client.async_get_clientsession(hass) - api = WebAlmondAPI(AlmondLocalAuth(host, websession)) - - try: - async with async_timeout.timeout(10): - await api.async_list_apps() - - return True - except (asyncio.TimeoutError, ClientError): - return False - - -class AlmondFlowHandler( - config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN -): - """Implementation of the Almond OAuth2 config flow.""" - - DOMAIN = DOMAIN - - host: str | None = None - hassio_discovery: dict[str, Any] | None = None - - @property - def logger(self) -> logging.Logger: - """Return logger.""" - return logging.getLogger(__name__) - - @property - def extra_authorize_data(self) -> dict: - """Extra data that needs to be appended to the authorize url.""" - return {"scope": "profile user-read user-read-results user-exec-command"} - - async def async_step_user(self, user_input=None): - """Handle a flow start.""" - # Only allow 1 instance. - if self._async_current_entries(): - return self.async_abort(reason="single_instance_allowed") - - return await super().async_step_user(user_input) - - async def async_step_auth(self, user_input=None): - """Handle authorize step.""" - result = await super().async_step_auth(user_input) - - if result["type"] == data_entry_flow.FlowResultType.EXTERNAL_STEP: - self.host = str(URL(result["url"]).with_path("me")) - - return result - - async def async_oauth_create_entry(self, data: dict) -> FlowResult: - """Create an entry for the flow. - - Ok to override if you want to fetch extra info or even add another step. - """ - data["type"] = TYPE_OAUTH2 - data["host"] = self.host - return self.async_create_entry(title=self.flow_impl.name, data=data) - - async def async_step_import(self, user_input: dict[str, Any]) -> FlowResult: - """Import data.""" - # Only allow 1 instance. - if self._async_current_entries(): - return self.async_abort(reason="single_instance_allowed") - - if not await async_verify_local_connection(self.hass, user_input["host"]): - self.logger.warning( - "Aborting import of Almond because we're unable to connect" - ) - return self.async_abort(reason="cannot_connect") - - return self.async_create_entry( - title="Configuration.yaml", - data={"type": TYPE_LOCAL, "host": user_input["host"]}, - ) - - async def async_step_hassio(self, discovery_info: HassioServiceInfo) -> FlowResult: - """Receive a Hass.io discovery.""" - if self._async_current_entries(): - return self.async_abort(reason="single_instance_allowed") - - self.hassio_discovery = discovery_info.config - - return await self.async_step_hassio_confirm() - - async def async_step_hassio_confirm(self, user_input=None): - """Confirm a Hass.io discovery.""" - data = self.hassio_discovery - - if user_input is not None: - return self.async_create_entry( - title=data["addon"], - data={ - "is_hassio": True, - "type": TYPE_LOCAL, - "host": f"http://{data['host']}:{data['port']}", - }, - ) - - return self.async_show_form( - step_id="hassio_confirm", - description_placeholders={"addon": data["addon"]}, - ) diff --git a/homeassistant/components/almond/const.py b/homeassistant/components/almond/const.py deleted file mode 100644 index 34dca28e9571ec..00000000000000 --- a/homeassistant/components/almond/const.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Constants for the Almond integration.""" -DOMAIN = "almond" -TYPE_OAUTH2 = "oauth2" -TYPE_LOCAL = "local" diff --git a/homeassistant/components/almond/manifest.json b/homeassistant/components/almond/manifest.json deleted file mode 100644 index 012450180cab48..00000000000000 --- a/homeassistant/components/almond/manifest.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "domain": "almond", - "name": "Almond", - "config_flow": true, - "documentation": "https://www.home-assistant.io/integrations/almond", - "dependencies": ["auth", "conversation"], - "codeowners": ["@gcampax", "@balloob"], - "requirements": ["pyalmond==0.0.2"], - "iot_class": "local_polling", - "loggers": ["pyalmond"] -} diff --git a/homeassistant/components/almond/strings.json b/homeassistant/components/almond/strings.json deleted file mode 100644 index 548471a664c0cb..00000000000000 --- a/homeassistant/components/almond/strings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "step": { - "pick_implementation": { - "title": "[%key:common::config_flow::title::oauth2_pick_implementation%]" - }, - "hassio_confirm": { - "title": "Almond via Home Assistant add-on", - "description": "Do you want to configure Home Assistant to connect to Almond provided by the add-on: {addon}?" - } - }, - "abort": { - "single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]", - "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]", - "missing_configuration": "[%key:common::config_flow::abort::oauth2_missing_configuration%]", - "no_url_available": "[%key:common::config_flow::abort::oauth2_no_url_available%]" - } - } -} diff --git a/homeassistant/components/almond/translations/bg.json b/homeassistant/components/almond/translations/bg.json deleted file mode 100644 index 81e1094b1abcb9..00000000000000 --- a/homeassistant/components/almond/translations/bg.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "\u041d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0432\u044a\u0440\u0437\u0432\u0430\u043d\u0435 \u0441 Almond \u0441\u044a\u0440\u0432\u044a\u0440\u0430.", - "missing_configuration": "\u041c\u043e\u043b\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0442\u0430 \u043a\u0430\u043a \u0434\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u0435 Almond.", - "single_instance_allowed": "\u0412\u0435\u0447\u0435 \u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0430\u043d\u043e. \u0412\u044a\u0437\u043c\u043e\u0436\u043d\u0430 \u0435 \u0441\u0430\u043c\u043e \u0435\u0434\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f." - }, - "step": { - "pick_implementation": { - "title": "\u0418\u0437\u0431\u043e\u0440 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 \u0437\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u043a\u0430\u0446\u0438\u044f" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/ca.json b/homeassistant/components/almond/translations/ca.json deleted file mode 100644 index c4dcc2e38e2c40..00000000000000 --- a/homeassistant/components/almond/translations/ca.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Ha fallat la connexi\u00f3", - "missing_configuration": "El component no est\u00e0 configurat. Mira'n la documentaci\u00f3.", - "no_url_available": "No hi ha cap URL disponible. Per a m\u00e9s informaci\u00f3 sobre aquest error, [consulta la secci\u00f3 d'ajuda]({docs_url})", - "single_instance_allowed": "Ja configurat. Nom\u00e9s \u00e9s possible una sola configuraci\u00f3." - }, - "step": { - "hassio_confirm": { - "description": "Vols configurar Home Assistant perqu\u00e8 es connecti amb Almond proporcionat pel complement: {addon}?", - "title": "Almond via complement de Home Assistant" - }, - "pick_implementation": { - "title": "Selecciona el m\u00e8tode d'autenticaci\u00f3" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/cs.json b/homeassistant/components/almond/translations/cs.json deleted file mode 100644 index dc981403ad23ad..00000000000000 --- a/homeassistant/components/almond/translations/cs.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Nepoda\u0159ilo se p\u0159ipojit", - "missing_configuration": "Komponenta nen\u00ed nastavena. Postupujte podle dokumentace.", - "no_url_available": "Nen\u00ed k dispozici \u017e\u00e1dn\u00e1 adresa URL. Informace o t\u00e9to chyb\u011b naleznete [v sekci n\u00e1pov\u011bdy]({docs_url})", - "single_instance_allowed": "Ji\u017e nastaveno. Je mo\u017en\u00e1 pouze jedin\u00e1 konfigurace." - }, - "step": { - "hassio_confirm": { - "description": "Chcete nakonfigurovat slu\u017ebu Home Assistant pro p\u0159ipojen\u00ed k Almond pomoc\u00ed Supervisor {addon}?", - "title": "Almond prost\u0159ednictv\u00edm dopl\u0148ku Supervisor" - }, - "pick_implementation": { - "title": "Vyberte metodu ov\u011b\u0159en\u00ed" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/da.json b/homeassistant/components/almond/translations/da.json deleted file mode 100644 index 0e7a804acc6f65..00000000000000 --- a/homeassistant/components/almond/translations/da.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Kan ikke oprette forbindelse til Almond-serveren.", - "missing_configuration": "Tjek venligst dokumentationen om, hvordan man indstiller Almond." - }, - "step": { - "hassio_confirm": { - "description": "Vil du konfigurere Home Assistant til at oprette forbindelse til Almond leveret af Supervisor-tilf\u00f8jelsen: {addon}?", - "title": "Almond via Supervisor-tilf\u00f8jelse" - }, - "pick_implementation": { - "title": "V\u00e6lg godkendelsesmetode" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/de.json b/homeassistant/components/almond/translations/de.json deleted file mode 100644 index 1f69b1c09e4197..00000000000000 --- a/homeassistant/components/almond/translations/de.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Verbindung fehlgeschlagen", - "missing_configuration": "Die Komponente ist nicht konfiguriert. Bitte der Dokumentation folgen.", - "no_url_available": "Keine URL verf\u00fcgbar. Informationen zu diesem Fehler findest du [im Hilfebereich]({docs_url}).", - "single_instance_allowed": "Bereits konfiguriert. Nur eine einzige Konfiguration m\u00f6glich." - }, - "step": { - "hassio_confirm": { - "description": "M\u00f6chtest du Home Assistant so konfigurieren, dass eine Verbindung mit Almond als Supervisor-Add-On hergestellt wird: {addon}?", - "title": "Almond \u00fcber das Supervisor Add-on" - }, - "pick_implementation": { - "title": "W\u00e4hle die Authentifizierungsmethode" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/el.json b/homeassistant/components/almond/translations/el.json deleted file mode 100644 index ac3a8efd757cdc..00000000000000 --- a/homeassistant/components/almond/translations/el.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "\u0391\u03c0\u03bf\u03c4\u03c5\u03c7\u03af\u03b1 \u03c3\u03cd\u03bd\u03b4\u03b5\u03c3\u03b7\u03c2", - "missing_configuration": "\u03a4\u03bf \u03c3\u03c4\u03bf\u03b9\u03c7\u03b5\u03af\u03bf \u03b4\u03b5\u03bd \u03ad\u03c7\u03b5\u03b9 \u03c1\u03c5\u03b8\u03bc\u03b9\u03c3\u03c4\u03b5\u03af. \u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03bf\u03cd\u03bc\u03b5 \u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03ae\u03c3\u03c4\u03b5 \u03c4\u03b7\u03bd \u03c4\u03b5\u03ba\u03bc\u03b7\u03c1\u03af\u03c9\u03c3\u03b7.", - "no_url_available": "\u0394\u03b5\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9 \u03b4\u03b9\u03b1\u03b8\u03ad\u03c3\u03b9\u03bc\u03b7 \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 URL. \u0393\u03b9\u03b1 \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03c3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1, [\u03b5\u03bb\u03ad\u03b3\u03be\u03c4\u03b5 \u03c4\u03b7\u03bd \u03b5\u03bd\u03cc\u03c4\u03b7\u03c4\u03b1 \u03b2\u03bf\u03ae\u03b8\u03b5\u03b9\u03b1\u03c2] ( {docs_url} )", - "single_instance_allowed": "\u0388\u03c7\u03b5\u03b9 \u03ae\u03b4\u03b7 \u03c1\u03c5\u03b8\u03bc\u03b9\u03c3\u03c4\u03b5\u03af. \u039c\u03cc\u03bd\u03bf \u03bc\u03af\u03b1 \u03b4\u03b9\u03b1\u03bc\u03cc\u03c1\u03c6\u03c9\u03c3\u03b7 \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae." - }, - "step": { - "hassio_confirm": { - "description": "\u0398\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03c1\u03c5\u03b8\u03bc\u03af\u03c3\u03b5\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03c0\u03b1\u03c1\u03b1\u03bc\u03ad\u03c4\u03c1\u03bf\u03c5\u03c2 \u03c4\u03bf\u03c5 Home Assistant \u03ce\u03c3\u03c4\u03b5 \u03bd\u03b1 \u03c3\u03c5\u03bd\u03b4\u03ad\u03b5\u03c4\u03b1\u03b9 \u03bc\u03b5 \u03c4\u03bf Almond \u03c0\u03bf\u03c5 \u03c0\u03b1\u03c1\u03ad\u03c7\u03b5\u03c4\u03b1\u03b9 \u03b1\u03c0\u03cc \u03c4\u03bf \u03c0\u03c1\u03cc\u03c3\u03b8\u03b5\u03c4\u03bf: {addon};", - "title": "\u03a0\u03c1\u03cc\u03c3\u03b8\u03b5\u03c4\u03bf Almond \u03bc\u03ad\u03c3\u03c9 Home Assistant" - }, - "pick_implementation": { - "title": "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03bc\u03b5\u03b8\u03cc\u03b4\u03bf\u03c5 \u03b5\u03bb\u03ad\u03b3\u03c7\u03bf\u03c5 \u03c4\u03b1\u03c5\u03c4\u03cc\u03c4\u03b7\u03c4\u03b1\u03c2" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/en.json b/homeassistant/components/almond/translations/en.json deleted file mode 100644 index fb7d41273524fc..00000000000000 --- a/homeassistant/components/almond/translations/en.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Failed to connect", - "missing_configuration": "The component is not configured. Please follow the documentation.", - "no_url_available": "No URL available. For information about this error, [check the help section]({docs_url})", - "single_instance_allowed": "Already configured. Only a single configuration possible." - }, - "step": { - "hassio_confirm": { - "description": "Do you want to configure Home Assistant to connect to Almond provided by the add-on: {addon}?", - "title": "Almond via Home Assistant add-on" - }, - "pick_implementation": { - "title": "Pick Authentication Method" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/es-419.json b/homeassistant/components/almond/translations/es-419.json deleted file mode 100644 index ce1d655d69e7fa..00000000000000 --- a/homeassistant/components/almond/translations/es-419.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "No se puede conectar con el servidor Almond.", - "missing_configuration": "Por favor, consulte la documentaci\u00f3n sobre c\u00f3mo configurar Almond." - }, - "step": { - "hassio_confirm": { - "description": "\u00bfDesea configurar Home Assistant para conectarse a Almond proporcionado por el complemento Supervisor: {addon}?", - "title": "Almond a trav\u00e9s del complemento Supervisor" - }, - "pick_implementation": { - "title": "Seleccione el m\u00e9todo de autenticaci\u00f3n" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/es.json b/homeassistant/components/almond/translations/es.json deleted file mode 100644 index 7c768deecdd56a..00000000000000 --- a/homeassistant/components/almond/translations/es.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "No se pudo conectar", - "missing_configuration": "El componente no est\u00e1 configurado. Por favor, sigue la documentaci\u00f3n.", - "no_url_available": "No hay URL disponible. Para obtener informaci\u00f3n sobre este error, [revisa la secci\u00f3n de ayuda]({docs_url})", - "single_instance_allowed": "Ya est\u00e1 configurado. Solo es posible una \u00fanica configuraci\u00f3n." - }, - "step": { - "hassio_confirm": { - "description": "\u00bfQuieres configurar Home Assistant para conectarse a Almond proporcionado por el complemento: {addon}?", - "title": "Almond a trav\u00e9s del complemento Home Assistant" - }, - "pick_implementation": { - "title": "Selecciona el m\u00e9todo de autenticaci\u00f3n" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/et.json b/homeassistant/components/almond/translations/et.json deleted file mode 100644 index 5b15d9328cce77..00000000000000 --- a/homeassistant/components/almond/translations/et.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "\u00dchendamine nurjus", - "missing_configuration": "Osis on seadistamata. Vaata dokumentatsiooni.", - "no_url_available": "URL pole saadaval. Rohkem teavet [spikrijaotis]({docs_url})", - "single_instance_allowed": "Juba seadistatud. V\u00f5imalik on ainult \u00fcks seadistamine." - }, - "step": { - "hassio_confirm": { - "description": "Kas soovid seadistada Home Assistant-i \u00fchendust Almondiga mida pakub lisandmoodul: {addon} ?", - "title": "Almond Home Assistanti lisandmooduli abil" - }, - "pick_implementation": { - "title": "Vali tuvastusmeetod" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/fi.json b/homeassistant/components/almond/translations/fi.json deleted file mode 100644 index 33427bf8451fac..00000000000000 --- a/homeassistant/components/almond/translations/fi.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Yhteyden muodostaminen Almond-palvelimeen ei onnistu." - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/fr.json b/homeassistant/components/almond/translations/fr.json deleted file mode 100644 index 6c38df7dec1963..00000000000000 --- a/homeassistant/components/almond/translations/fr.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "\u00c9chec de connexion", - "missing_configuration": "Le composant n'est pas configur\u00e9. Veuillez suivre la documentation.", - "no_url_available": "Aucune URL disponible. Pour plus d'informations sur cette erreur, [consultez la section d'aide]({docs_url})", - "single_instance_allowed": "D\u00e9j\u00e0 configur\u00e9. Une seule configuration possible." - }, - "step": { - "hassio_confirm": { - "description": "Voulez-vous configurer Home Assistant pour qu'il se connecte \u00e0 Almond fourni par le module compl\u00e9mentaire Hass.io: {addon} ?", - "title": "Amande via le module compl\u00e9mentaire Hass.io" - }, - "pick_implementation": { - "title": "S\u00e9lectionner une m\u00e9thode d'authentification" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/he.json b/homeassistant/components/almond/translations/he.json deleted file mode 100644 index 6aa9dd1d75f698..00000000000000 --- a/homeassistant/components/almond/translations/he.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "\u05d4\u05d4\u05ea\u05d7\u05d1\u05e8\u05d5\u05ea \u05e0\u05db\u05e9\u05dc\u05d4", - "missing_configuration": "\u05ea\u05e6\u05d5\u05e8\u05ea \u05d4\u05e8\u05db\u05d9\u05d1 \u05dc\u05d0 \u05e0\u05e7\u05d1\u05e2\u05d4. \u05e0\u05d0 \u05e2\u05e7\u05d5\u05d1 \u05d0\u05d7\u05e8 \u05d4\u05ea\u05d9\u05e2\u05d5\u05d3.", - "no_url_available": "\u05d0\u05d9\u05df \u05db\u05ea\u05d5\u05d1\u05ea \u05d0\u05ea\u05e8 \u05d6\u05de\u05d9\u05e0\u05d4. \u05e7\u05d1\u05dc\u05ea \u05de\u05d9\u05d3\u05e2 \u05e2\u05dc \u05e9\u05d2\u05d9\u05d0\u05d4 \u05d6\u05d5, [\u05e2\u05d9\u05d9\u05df \u05d1\u05e1\u05e2\u05d9\u05e3 \u05d4\u05e2\u05d6\u05e8\u05d4] ({docs_url})", - "single_instance_allowed": "\u05ea\u05e6\u05d5\u05e8\u05ea\u05d5 \u05db\u05d1\u05e8 \u05e0\u05e7\u05d1\u05e2\u05d4. \u05e8\u05e7 \u05ea\u05e6\u05d5\u05e8\u05d4 \u05d0\u05d7\u05ea \u05d0\u05e4\u05e9\u05e8\u05d9\u05ea." - }, - "step": { - "pick_implementation": { - "title": "\u05d1\u05d7\u05e8 \u05e9\u05d9\u05d8\u05ea \u05d0\u05d9\u05de\u05d5\u05ea" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/hu.json b/homeassistant/components/almond/translations/hu.json deleted file mode 100644 index b424675faaa726..00000000000000 --- a/homeassistant/components/almond/translations/hu.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Sikertelen csatlakoz\u00e1s", - "missing_configuration": "A komponens nincs konfigur\u00e1lva. K\u00e9rem, k\u00f6vesse a dokument\u00e1ci\u00f3t.", - "no_url_available": "Nincs el\u00e9rhet\u0151 URL. A hib\u00e1r\u00f3l tov\u00e1bbi inform\u00e1ci\u00f3 [a s\u00fag\u00f3ban]({docs_url}) tal\u00e1lhat\u00f3.", - "single_instance_allowed": "M\u00e1r konfigur\u00e1lva van. Csak egy konfigur\u00e1ci\u00f3 lehets\u00e9ges." - }, - "step": { - "hassio_confirm": { - "description": "Szeretn\u00e9 be\u00e1ll\u00edtani Home Assistantot Almondhoz val\u00f3 csatlakoz\u00e1shoz, {addon} b\u0151v\u00edtm\u00e9ny \u00e1ltal?", - "title": "Almond - Home Assistant b\u0151v\u00edtm\u00e9nnyel" - }, - "pick_implementation": { - "title": "V\u00e1lasszon egy hiteles\u00edt\u00e9si m\u00f3dszert" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/id.json b/homeassistant/components/almond/translations/id.json deleted file mode 100644 index 8e4302220b58c9..00000000000000 --- a/homeassistant/components/almond/translations/id.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Gagal terhubung", - "missing_configuration": "Komponen tidak dikonfigurasi. Ikuti petunjuk dalam dokumentasi.", - "no_url_available": "Tidak ada URL yang tersedia. Untuk informasi tentang kesalahan ini, [lihat bagian bantuan]({docs_url})", - "single_instance_allowed": "Sudah dikonfigurasi. Hanya satu konfigurasi yang diizinkan." - }, - "step": { - "hassio_confirm": { - "description": "Ingin mengonfigurasi Home Assistant untuk terhubung ke Almond yang disediakan oleh add-on: {addon}?", - "title": "Almond melalui add-on Home Assistant" - }, - "pick_implementation": { - "title": "Pilih Metode Autentikasi" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/it.json b/homeassistant/components/almond/translations/it.json deleted file mode 100644 index 1d028e731118ff..00000000000000 --- a/homeassistant/components/almond/translations/it.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Impossibile connettersi", - "missing_configuration": "Il componente non \u00e8 configurato. Segui la documentazione.", - "no_url_available": "Nessun URL disponibile. Per informazioni su questo errore, [controlla la sezione della guida]({docs_url})", - "single_instance_allowed": "Gi\u00e0 configurato. \u00c8 possibile una sola configurazione." - }, - "step": { - "hassio_confirm": { - "description": "Vuoi configurare Home Assistant per connettersi a Almond fornito dal componente aggiuntivo: {addon}?", - "title": "Almond tramite il componente aggiuntivo di Home Assistant" - }, - "pick_implementation": { - "title": "Scegli il metodo di autenticazione" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/ja.json b/homeassistant/components/almond/translations/ja.json deleted file mode 100644 index 898bc4bc1c06a0..00000000000000 --- a/homeassistant/components/almond/translations/ja.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "\u63a5\u7d9a\u306b\u5931\u6557\u3057\u307e\u3057\u305f", - "missing_configuration": "\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u5f93\u3063\u3066\u304f\u3060\u3055\u3044\u3002", - "no_url_available": "\u4f7f\u7528\u53ef\u80fd\u306aURL\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u306e\u30a8\u30e9\u30fc\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001[\u30d8\u30eb\u30d7\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044]({docs_url})", - "single_instance_allowed": "\u3059\u3067\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u8a2d\u5b9a\u3067\u304d\u308b\u306e\u306f1\u3064\u3060\u3051\u3067\u3059\u3002" - }, - "step": { - "hassio_confirm": { - "description": "\u30a2\u30c9\u30aa\u30f3: {addon} \u306b\u3088\u3063\u3066\u63d0\u4f9b\u3055\u308c\u308b\u3001Almond\u306b\u63a5\u7d9a\u3059\u308b\u3088\u3046\u306bHome Assistant\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u304b\uff1f", - "title": "Home Assistant\u30a2\u30c9\u30aa\u30f3\u7d4c\u7531\u306eAlmond" - }, - "pick_implementation": { - "title": "\u8a8d\u8a3c\u65b9\u6cd5\u306e\u9078\u629e" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/ko.json b/homeassistant/components/almond/translations/ko.json deleted file mode 100644 index d18f5c914cccb4..00000000000000 --- a/homeassistant/components/almond/translations/ko.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "\uc5f0\uacb0\ud558\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4", - "missing_configuration": "\uad6c\uc131\uc694\uc18c\uac00 \uad6c\uc131\ub418\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4. \uc124\uba85\uc11c\ub97c \ucc38\uace0\ud574\uc8fc\uc138\uc694.", - "no_url_available": "\uc0ac\uc6a9 \uac00\ub2a5\ud55c URL\uc774 \uc5c6\uc2b5\ub2c8\ub2e4. \uc774 \uc624\ub958\uc5d0 \ub300\ud55c \uc790\uc138\ud55c \ub0b4\uc6a9\uc740 [\ub3c4\uc6c0\ub9d0 \uc139\uc158]({docs_url}) \uc744(\ub97c) \ucc38\uc870\ud574\uc8fc\uc138\uc694.", - "single_instance_allowed": "\uc774\ubbf8 \uad6c\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \ud558\ub098\uc758 \uc778\uc2a4\ud134\uc2a4\ub9cc \uad6c\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4." - }, - "step": { - "hassio_confirm": { - "description": "{addon} \uc560\ub4dc\uc628\uc5d0\uc11c \uc81c\uacf5\ud558\ub294 Almond\uc5d0 \uc5f0\uacb0\ud558\ub3c4\ub85d Home Assistant\ub97c \uad6c\uc131\ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c?", - "title": "Home Assistant \uc560\ub4dc\uc628\uc758 Almond" - }, - "pick_implementation": { - "title": "\uc778\uc99d \ubc29\ubc95 \uc120\ud0dd\ud558\uae30" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/lb.json b/homeassistant/components/almond/translations/lb.json deleted file mode 100644 index 0e29d69bbed628..00000000000000 --- a/homeassistant/components/almond/translations/lb.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Feeler beim verbannen", - "missing_configuration": "Komponent net konfigur\u00e9iert. Folleg w.e.g der Dokumentatioun.", - "no_url_available": "Keng URL disponibel. Fir Informatiounen iwwert d\u00ebse Feeler, [kuck H\u00ebllef Sektioun]({docs_url})", - "single_instance_allowed": "Scho konfigur\u00e9iert. N\u00ebmmen eng eenzeg Konfiguratioun m\u00e9iglech." - }, - "step": { - "hassio_confirm": { - "description": "W\u00ebllt dir Home Assistant konfigur\u00e9iere fir sech mam Almond ze verbannen dee vun der Supervisor Erweiderung {addon} bereet gestallt g\u00ebtt?", - "title": "Almond via Supervisor Erweiderung" - }, - "pick_implementation": { - "title": "Wiel Authentifikatiouns Method aus" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/nl.json b/homeassistant/components/almond/translations/nl.json deleted file mode 100644 index e548206e23eea5..00000000000000 --- a/homeassistant/components/almond/translations/nl.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Kan geen verbinding maken", - "missing_configuration": "Integratie niet geconfigureerd. Raadpleeg de documentatie.", - "no_url_available": "Geen URL beschikbaar. Voor informatie over deze fout, [raadpleeg de documentatie]({docs_url})", - "single_instance_allowed": "Al geconfigureerd. Slechts \u00e9\u00e9n configuratie mogelijk." - }, - "step": { - "hassio_confirm": { - "description": "Wilt u Home Assistant configureren om verbinding te maken met Almond die wordt aangeboden door de add-on {addon} ?", - "title": "Almond via Home Assistant add-on" - }, - "pick_implementation": { - "title": "Kies een authenticatie methode" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/no.json b/homeassistant/components/almond/translations/no.json deleted file mode 100644 index 098184ff7af407..00000000000000 --- a/homeassistant/components/almond/translations/no.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Tilkobling mislyktes", - "missing_configuration": "Komponenten er ikke konfigurert, vennligst f\u00f8lg dokumentasjonen", - "no_url_available": "Ingen URL tilgjengelig. For informasjon om denne feilen, [sjekk hjelpseksjonen]({docs_url})", - "single_instance_allowed": "Allerede konfigurert. Bare \u00e9n enkelt konfigurasjon er mulig." - }, - "step": { - "hassio_confirm": { - "description": "Vil du konfigurere Home Assistant for \u00e5 koble til Almond levert av tillegget: {addon} ?", - "title": "Almond via Home Assistant-tillegg" - }, - "pick_implementation": { - "title": "Velg godkjenningsmetode" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/pl.json b/homeassistant/components/almond/translations/pl.json deleted file mode 100644 index 88fd6cda01c8dc..00000000000000 --- a/homeassistant/components/almond/translations/pl.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Nie mo\u017cna nawi\u0105za\u0107 po\u0142\u0105czenia", - "missing_configuration": "Komponent nie jest skonfigurowany. Post\u0119puj zgodnie z dokumentacj\u0105.", - "no_url_available": "Brak dost\u0119pnego adresu URL. Aby uzyska\u0107 informacje na temat tego b\u0142\u0119du, [sprawd\u017a sekcj\u0119 pomocy] ({docs_url})", - "single_instance_allowed": "Ju\u017c skonfigurowano. Mo\u017cliwa jest tylko jedna konfiguracja." - }, - "step": { - "hassio_confirm": { - "description": "Czy chcesz skonfigurowa\u0107 Home Assistant, aby \u0142\u0105czy\u0142 si\u0119 z Almond dostarczonym przez dodatek {addon}?", - "title": "Almond poprzez dodatek Home Assistant" - }, - "pick_implementation": { - "title": "Wybierz metod\u0119 uwierzytelniania" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/pt-BR.json b/homeassistant/components/almond/translations/pt-BR.json deleted file mode 100644 index d012b1695f3a35..00000000000000 --- a/homeassistant/components/almond/translations/pt-BR.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Falha ao conectar", - "missing_configuration": "O componente n\u00e3o est\u00e1 configurado. Por favor, siga a documenta\u00e7\u00e3o.", - "no_url_available": "N\u00e3o h\u00e1 URL dispon\u00edvel. Para obter informa\u00e7\u00f5es sobre esse erro, [verifique a se\u00e7\u00e3o de ajuda]({docs_url})", - "single_instance_allowed": "J\u00e1 configurado. Apenas uma configura\u00e7\u00e3o \u00e9 poss\u00edvel." - }, - "step": { - "hassio_confirm": { - "description": "Deseja configurar o Home Assistant para se conectar ao Almond fornecido pelo add-on {addon} ?", - "title": "Almond via add-on" - }, - "pick_implementation": { - "title": "Escolha o m\u00e9todo de autentica\u00e7\u00e3o" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/pt.json b/homeassistant/components/almond/translations/pt.json deleted file mode 100644 index 86d4823a27296c..00000000000000 --- a/homeassistant/components/almond/translations/pt.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "A liga\u00e7\u00e3o falhou", - "missing_configuration": "O componente n\u00e3o est\u00e1 configurado. Por favor, siga a documenta\u00e7\u00e3o.", - "no_url_available": "Nenhum URL est\u00e1 dispon\u00edvel. Para obter informa\u00e7\u00f5es sobre esse erro, [consulte a sec\u00e7\u00e3o de ajuda]({docs_url})", - "single_instance_allowed": "J\u00e1 configurado. Apenas uma \u00fanica configura\u00e7\u00e3o \u00e9 poss\u00edvel." - }, - "step": { - "pick_implementation": { - "title": "Escolha o m\u00e9todo de autentica\u00e7\u00e3o" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/ru.json b/homeassistant/components/almond/translations/ru.json deleted file mode 100644 index b77e1cfca2c9d3..00000000000000 --- a/homeassistant/components/almond/translations/ru.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f.", - "missing_configuration": "\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439.", - "no_url_available": "URL-\u0430\u0434\u0440\u0435\u0441 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 [\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439]({docs_url}) \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u044d\u0442\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435.", - "single_instance_allowed": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0443\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e." - }, - "step": { - "hassio_confirm": { - "description": "\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a Almond (\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \"{addon}\")?", - "title": "Almond (\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Home Assistant)" - }, - "pick_implementation": { - "title": "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u043f\u043e\u0441\u043e\u0431 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/sk.json b/homeassistant/components/almond/translations/sk.json deleted file mode 100644 index 0189ab5be44ae1..00000000000000 --- a/homeassistant/components/almond/translations/sk.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Nepodarilo sa pripoji\u0165", - "missing_configuration": "Komponent nie je nakonfigurovan\u00fd. Postupujte pod\u013ea dokument\u00e1cie.", - "no_url_available": "Nie je k dispoz\u00edcii \u017eiadna adresa URL. Inform\u00e1cie o tejto chybe n\u00e1jdete [pozrite si sekciu pomocn\u00edka]({docs_url})", - "single_instance_allowed": "U\u017e je nakonfigurovan\u00fd. Mo\u017en\u00e1 len jedna konfigur\u00e1cia." - }, - "step": { - "hassio_confirm": { - "description": "Chcete nakonfigurova\u0165 dom\u00e1ceho asistenta na pripojenie k Almond poskytovan\u00e9mu doplnkom: {addon}?", - "title": "Doplnok Almond cez Home Assistant" - }, - "pick_implementation": { - "title": "Vyberte met\u00f3du overenia" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/sl.json b/homeassistant/components/almond/translations/sl.json deleted file mode 100644 index cb20393201f1dc..00000000000000 --- a/homeassistant/components/almond/translations/sl.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Ni mogo\u010de vzpostaviti povezave s stre\u017enikom Almond.", - "missing_configuration": "Prosimo, preverite dokumentacijo o tem, kako nastaviti Almond." - }, - "step": { - "hassio_confirm": { - "description": "Ali \u017eelite konfigurirati Home Assistant za povezavo z Almondom, ki ga ponuja dodatek Supervisor: {addon} ?", - "title": "Almond prek dodatka Supervisor" - }, - "pick_implementation": { - "title": "Izberite na\u010din preverjanja pristnosti" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/sv.json b/homeassistant/components/almond/translations/sv.json deleted file mode 100644 index c11af204012593..00000000000000 --- a/homeassistant/components/almond/translations/sv.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Det g\u00e5r inte att ansluta till Almond-servern.", - "missing_configuration": "Kontrollera dokumentationen f\u00f6r hur du st\u00e4ller in Almond.", - "no_url_available": "Ingen webbadress tillg\u00e4nglig. F\u00f6r information om detta fel, [kolla hj\u00e4lpavsnittet]({docs_url})", - "single_instance_allowed": "Redan konfigurerad. Endast en konfiguration m\u00f6jlig." - }, - "step": { - "hassio_confirm": { - "description": "Vill du konfigurera Home Assistant f\u00f6r att ansluta till Almond som tillhandah\u00e5lls av Supervisor-till\u00e4gget: {addon} ?", - "title": "Almond via Supervisor-till\u00e4gget" - }, - "pick_implementation": { - "title": "V\u00e4lj autentiseringsmetod" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/tr.json b/homeassistant/components/almond/translations/tr.json deleted file mode 100644 index a0808fde8efc20..00000000000000 --- a/homeassistant/components/almond/translations/tr.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "Ba\u011flanma hatas\u0131", - "missing_configuration": "Bile\u015fen yap\u0131land\u0131r\u0131lmam\u0131\u015f. L\u00fctfen belgeleri takip edin.", - "no_url_available": "Kullan\u0131labilir URL yok. Bu hata hakk\u0131nda bilgi i\u00e7in [yard\u0131m b\u00f6l\u00fcm\u00fcne bak\u0131n]({docs_url})", - "single_instance_allowed": "Zaten yap\u0131land\u0131r\u0131lm\u0131\u015f. Yaln\u0131zca tek bir konfig\u00fcrasyon m\u00fcmk\u00fcnd\u00fcr." - }, - "step": { - "hassio_confirm": { - "description": "{addon} taraf\u0131ndan sa\u011flanan Almond'a ba\u011flanacak \u015fekilde yap\u0131land\u0131rmak istiyor musunuz?", - "title": "Home Assistant eklentisi arac\u0131l\u0131\u011f\u0131yla Almond" - }, - "pick_implementation": { - "title": "Kimlik Do\u011frulama Y\u00f6ntemini Se\u00e7" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/uk.json b/homeassistant/components/almond/translations/uk.json deleted file mode 100644 index d1e0d1e1cb623a..00000000000000 --- a/homeassistant/components/almond/translations/uk.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0456\u0434'\u0454\u0434\u043d\u0430\u0442\u0438\u0441\u044f", - "missing_configuration": "\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f. \u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u043e\u0437\u043d\u0430\u0439\u043e\u043c\u0442\u0435\u0441\u044f \u0437 \u0456\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0456\u044f\u043c\u0438.", - "no_url_available": "URL-\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430. \u041e\u0437\u043d\u0430\u0439\u043e\u043c\u0442\u0435\u0441\u044f \u0437 [\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0456\u0454\u044e] ({docs_url}) \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f \u0456\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0456\u0457 \u043f\u0440\u043e \u0446\u044e \u043f\u043e\u043c\u0438\u043b\u043a\u0443.", - "single_instance_allowed": "\u0412\u0436\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e. \u041c\u043e\u0436\u043b\u0438\u0432\u0430 \u043b\u0438\u0448\u0435 \u043e\u0434\u043d\u0430 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u044f." - }, - "step": { - "hassio_confirm": { - "description": "\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u0442\u0438 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044f \u0434\u043e Almond (\u0434\u043e\u0434\u0430\u0442\u043e\u043a \u0434\u043b\u044f Supervisor \"{addon}\")?", - "title": "Almond (\u0434\u043e\u0434\u0430\u0442\u043e\u043a \u0434\u043b\u044f Supervisor)" - }, - "pick_implementation": { - "title": "\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u0441\u043f\u043e\u0441\u0456\u0431 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u0457" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/components/almond/translations/zh-Hant.json b/homeassistant/components/almond/translations/zh-Hant.json deleted file mode 100644 index d5139fcb8b8120..00000000000000 --- a/homeassistant/components/almond/translations/zh-Hant.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "config": { - "abort": { - "cannot_connect": "\u9023\u7dda\u5931\u6557", - "missing_configuration": "\u5143\u4ef6\u5c1a\u672a\u8a2d\u7f6e\uff0c\u8acb\u53c3\u95b1\u6587\u4ef6\u8aaa\u660e\u3002", - "no_url_available": "\u6c92\u6709\u53ef\u7528\u7684\u7db2\u5740\u3002\u95dc\u65bc\u6b64\u932f\u8aa4\u66f4\u8a73\u7d30\u8a0a\u606f\uff0c[\u9ede\u9078\u5354\u52a9\u7ae0\u7bc0]({docs_url})", - "single_instance_allowed": "\u5df2\u7d93\u8a2d\u5b9a\u5b8c\u6210\u3001\u50c5\u80fd\u8a2d\u5b9a\u4e00\u7d44\u88dd\u7f6e\u3002" - }, - "step": { - "hassio_confirm": { - "description": "\u662f\u5426\u8981\u8a2d\u5b9a Home Assistant \u4ee5\u9023\u7dda\u81f3 Almond\u3002\u9644\u52a0\u5143\u4ef6\u70ba\uff1a{addon} \uff1f", - "title": "\u4f7f\u7528 Home Assistant \u9644\u52a0\u5143\u4ef6 Almond" - }, - "pick_implementation": { - "title": "\u9078\u64c7\u9a57\u8b49\u6a21\u5f0f" - } - } - } -} \ No newline at end of file diff --git a/homeassistant/generated/config_flows.py b/homeassistant/generated/config_flows.py index 28cf9d96cfd229..c0c737f4b46f8b 100644 --- a/homeassistant/generated/config_flows.py +++ b/homeassistant/generated/config_flows.py @@ -34,7 +34,6 @@ "airzone", "aladdin_connect", "alarmdecoder", - "almond", "amberelectric", "ambiclimate", "ambient_station", diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json index 13acd8cc30e6c0..4c3ed17e726808 100644 --- a/homeassistant/generated/integrations.json +++ b/homeassistant/generated/integrations.json @@ -158,12 +158,6 @@ "config_flow": false, "iot_class": "local_push" }, - "almond": { - "name": "Almond", - "integration_type": "hub", - "config_flow": true, - "iot_class": "local_polling" - }, "alpha_vantage": { "name": "Alpha Vantage", "integration_type": "hub", diff --git a/requirements_all.txt b/requirements_all.txt index eb7424f8e97076..44e90193952fd9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1491,9 +1491,6 @@ pyairnow==1.1.0 # homeassistant.components.airvisual_pro pyairvisual==2022.12.1 -# homeassistant.components.almond -pyalmond==0.0.2 - # homeassistant.components.atag pyatag==0.3.5.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index eb2c376d742856..93b51d8d0331ac 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1085,9 +1085,6 @@ pyairnow==1.1.0 # homeassistant.components.airvisual_pro pyairvisual==2022.12.1 -# homeassistant.components.almond -pyalmond==0.0.2 - # homeassistant.components.atag pyatag==0.3.5.3 diff --git a/tests/components/almond/__init__.py b/tests/components/almond/__init__.py deleted file mode 100644 index 717271c3a6a157..00000000000000 --- a/tests/components/almond/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the Almond integration.""" diff --git a/tests/components/almond/test_config_flow.py b/tests/components/almond/test_config_flow.py deleted file mode 100644 index 511a5cf08dc47f..00000000000000 --- a/tests/components/almond/test_config_flow.py +++ /dev/null @@ -1,163 +0,0 @@ -"""Test the Almond config flow.""" -import asyncio -from http import HTTPStatus -from unittest.mock import patch - -from homeassistant import config_entries, data_entry_flow, setup -from homeassistant.components.almond import config_flow -from homeassistant.components.almond.const import DOMAIN -from homeassistant.components.hassio import HassioServiceInfo -from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET -from homeassistant.helpers import config_entry_oauth2_flow - -from tests.common import MockConfigEntry - -CLIENT_ID_VALUE = "1234" -CLIENT_SECRET_VALUE = "5678" - - -async def test_import(hass): - """Test that we can import a config entry.""" - with patch("pyalmond.WebAlmondAPI.async_list_apps"): - assert await setup.async_setup_component( - hass, - DOMAIN, - {DOMAIN: {"type": "local", "host": "http://localhost:3000"}}, - ) - await hass.async_block_till_done() - - assert len(hass.config_entries.async_entries(DOMAIN)) == 1 - entry = hass.config_entries.async_entries(DOMAIN)[0] - assert entry.data["type"] == "local" - assert entry.data["host"] == "http://localhost:3000" - - -async def test_import_cannot_connect(hass): - """Test that we won't import a config entry if we cannot connect.""" - with patch( - "pyalmond.WebAlmondAPI.async_list_apps", side_effect=asyncio.TimeoutError - ): - assert await setup.async_setup_component( - hass, - DOMAIN, - {DOMAIN: {"type": "local", "host": "http://localhost:3000"}}, - ) - await hass.async_block_till_done() - - assert len(hass.config_entries.async_entries(DOMAIN)) == 0 - - -async def test_hassio(hass): - """Test that Hass.io can discover this integration.""" - result = await hass.config_entries.flow.async_init( - DOMAIN, - context={"source": config_entries.SOURCE_HASSIO}, - data=HassioServiceInfo( - config={"addon": "Almond add-on", "host": "almond-addon", "port": "1234"}, - name="Almond add-on", - slug="almond", - ), - ) - - assert result["type"] == data_entry_flow.FlowResultType.FORM - assert result["step_id"] == "hassio_confirm" - - with patch( - "homeassistant.components.almond.async_setup_entry", return_value=True - ) as mock_setup: - result2 = await hass.config_entries.flow.async_configure(result["flow_id"], {}) - - assert len(mock_setup.mock_calls) == 1 - - assert result2["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY - - assert len(hass.config_entries.async_entries(DOMAIN)) == 1 - entry = hass.config_entries.async_entries(DOMAIN)[0] - assert entry.data["type"] == "local" - assert entry.data["host"] == "http://almond-addon:1234" - - -async def test_abort_if_existing_entry(hass): - """Check flow abort when an entry already exist.""" - MockConfigEntry(domain=DOMAIN).add_to_hass(hass) - - flow = config_flow.AlmondFlowHandler() - flow.hass = hass - - result = await flow.async_step_user() - assert result["type"] == data_entry_flow.FlowResultType.ABORT - assert result["reason"] == "single_instance_allowed" - - result = await flow.async_step_import({}) - assert result["type"] == data_entry_flow.FlowResultType.ABORT - assert result["reason"] == "single_instance_allowed" - - result = await flow.async_step_hassio( - HassioServiceInfo(config={}, name="Almond add-on", slug="almond") - ) - assert result["type"] == data_entry_flow.FlowResultType.ABORT - assert result["reason"] == "single_instance_allowed" - - -async def test_full_flow( - hass, hass_client_no_auth, aioclient_mock, current_request_with_host -): - """Check full flow.""" - assert await setup.async_setup_component( - hass, - DOMAIN, - { - DOMAIN: { - "type": "oauth2", - CONF_CLIENT_ID: CLIENT_ID_VALUE, - CONF_CLIENT_SECRET: CLIENT_SECRET_VALUE, - }, - "http": {"base_url": "https://example.com"}, - }, - ) - - result = await hass.config_entries.flow.async_init( - DOMAIN, context={"source": config_entries.SOURCE_USER} - ) - state = config_entry_oauth2_flow._encode_jwt( - hass, - { - "flow_id": result["flow_id"], - "redirect_uri": "https://example.com/auth/external/callback", - }, - ) - - assert result["type"] == data_entry_flow.FlowResultType.EXTERNAL_STEP - assert result["url"] == ( - "https://almond.stanford.edu/me/api/oauth2/authorize" - f"?response_type=code&client_id={CLIENT_ID_VALUE}" - "&redirect_uri=https://example.com/auth/external/callback" - f"&state={state}&scope=profile+user-read+user-read-results+user-exec-command" - ) - - client = await hass_client_no_auth() - resp = await client.get(f"/auth/external/callback?code=abcd&state={state}") - assert resp.status == HTTPStatus.OK - assert resp.headers["content-type"] == "text/html; charset=utf-8" - - aioclient_mock.post( - "https://almond.stanford.edu/me/api/oauth2/token", - json={ - "refresh_token": "mock-refresh-token", - "access_token": "mock-access-token", - "type": "Bearer", - "expires_in": 60, - }, - ) - - with patch( - "homeassistant.components.almond.async_setup_entry", return_value=True - ) as mock_setup: - result = await hass.config_entries.flow.async_configure(result["flow_id"]) - - assert len(mock_setup.mock_calls) == 1 - - assert len(hass.config_entries.async_entries(DOMAIN)) == 1 - entry = hass.config_entries.async_entries(DOMAIN)[0] - assert entry.data["type"] == "oauth2" - assert entry.data["host"] == "https://almond.stanford.edu/me" diff --git a/tests/components/almond/test_init.py b/tests/components/almond/test_init.py deleted file mode 100644 index 64537aa94651f3..00000000000000 --- a/tests/components/almond/test_init.py +++ /dev/null @@ -1,116 +0,0 @@ -"""Tests for Almond set up.""" -from time import time -from unittest.mock import patch - -import pytest - -from homeassistant import config_entries, core -from homeassistant.components.almond import const -from homeassistant.config import async_process_ha_core_config -from homeassistant.const import EVENT_HOMEASSISTANT_START -from homeassistant.setup import async_setup_component -from homeassistant.util.dt import utcnow - -from tests.common import MockConfigEntry, async_fire_time_changed - - -@pytest.fixture(autouse=True) -def patch_hass_state(hass): - """Mock the hass.state to be not_running.""" - hass.state = core.CoreState.not_running - - -async def test_set_up_oauth_remote_url(hass, aioclient_mock): - """Test we set up Almond to connect to HA if we have external url.""" - entry = MockConfigEntry( - domain="almond", - data={ - "type": const.TYPE_OAUTH2, - "auth_implementation": "local", - "host": "http://localhost:9999", - "token": {"expires_at": time() + 1000, "access_token": "abcd"}, - }, - ) - entry.add_to_hass(hass) - - with patch( - "homeassistant.helpers.config_entry_oauth2_flow.async_get_config_entry_implementation", - ): - assert await async_setup_component(hass, "almond", {}) - - assert entry.state is config_entries.ConfigEntryState.LOADED - - hass.config.components.add("cloud") - with patch("homeassistant.components.almond.ALMOND_SETUP_DELAY", 0), patch( - "homeassistant.helpers.network.get_url", - return_value="https://example.nabu.casa", - ), patch("pyalmond.WebAlmondAPI.async_create_device") as mock_create_device: - hass.bus.async_fire(EVENT_HOMEASSISTANT_START) - await hass.async_block_till_done() - async_fire_time_changed(hass, utcnow()) - await hass.async_block_till_done() - - assert len(mock_create_device.mock_calls) == 1 - - -async def test_set_up_oauth_no_external_url(hass, aioclient_mock): - """Test we do not set up Almond to connect to HA if we have no external url.""" - entry = MockConfigEntry( - domain="almond", - data={ - "type": const.TYPE_OAUTH2, - "auth_implementation": "local", - "host": "http://localhost:9999", - "token": {"expires_at": time() + 1000, "access_token": "abcd"}, - }, - ) - entry.add_to_hass(hass) - - with patch( - "homeassistant.helpers.config_entry_oauth2_flow.async_get_config_entry_implementation", - ), patch("pyalmond.WebAlmondAPI.async_create_device") as mock_create_device: - assert await async_setup_component(hass, "almond", {}) - - assert entry.state is config_entries.ConfigEntryState.LOADED - assert len(mock_create_device.mock_calls) == 0 - - -async def test_set_up_hassio(hass, aioclient_mock): - """Test we do not set up Almond to connect to HA if we use Hass.io.""" - entry = MockConfigEntry( - domain="almond", - data={ - "is_hassio": True, - "type": const.TYPE_LOCAL, - "host": "http://localhost:9999", - }, - ) - entry.add_to_hass(hass) - - with patch("pyalmond.WebAlmondAPI.async_create_device") as mock_create_device: - assert await async_setup_component(hass, "almond", {}) - - assert entry.state is config_entries.ConfigEntryState.LOADED - assert len(mock_create_device.mock_calls) == 0 - - -async def test_set_up_local(hass, aioclient_mock): - """Test we do not set up Almond to connect to HA if we use local.""" - - # Set up an internal URL, as Almond won't be set up if there is no URL available - await async_process_ha_core_config( - hass, - {"internal_url": "https://192.168.0.1"}, - ) - - entry = MockConfigEntry( - domain="almond", - data={"type": const.TYPE_LOCAL, "host": "http://localhost:9999"}, - ) - entry.add_to_hass(hass) - - with patch("pyalmond.WebAlmondAPI.async_create_device") as mock_create_device: - assert await async_setup_component(hass, "almond", {}) - - assert entry.state is config_entries.ConfigEntryState.LOADED - assert len(mock_create_device.mock_calls) == 1