From 8053073a77e7c26fec2c6cb37d34feee5bf4b7e0 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 29 May 2023 20:38:33 +0200 Subject: [PATCH] Add empty config schema to integrations a-c (#93608) --- homeassistant/components/api/__init__.py | 4 +++- .../components/application_credentials/__init__.py | 2 ++ homeassistant/components/assist_pipeline/__init__.py | 3 +++ homeassistant/components/auth/__init__.py | 3 +++ homeassistant/components/backup/__init__.py | 3 +++ homeassistant/components/blueprint/__init__.py | 3 +++ homeassistant/components/bluetooth/__init__.py | 8 +++++++- homeassistant/components/bluetooth_adapters/__init__.py | 3 +++ homeassistant/components/browser/__init__.py | 3 +++ homeassistant/components/color_extractor/__init__.py | 2 ++ homeassistant/components/config/__init__.py | 3 +++ homeassistant/components/configurator/__init__.py | 3 +++ 12 files changed, 38 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/api/__init__.py b/homeassistant/components/api/__init__.py index 5c0a60ecef7..6538bd345de 100644 --- a/homeassistant/components/api/__init__.py +++ b/homeassistant/components/api/__init__.py @@ -28,7 +28,7 @@ from homeassistant.const import ( import homeassistant.core as ha from homeassistant.core import HomeAssistant from homeassistant.exceptions import ServiceNotFound, TemplateError, Unauthorized -from homeassistant.helpers import template +from homeassistant.helpers import config_validation as cv, template from homeassistant.helpers.json import json_dumps from homeassistant.helpers.service import async_get_all_descriptions from homeassistant.helpers.typing import ConfigType @@ -49,6 +49,8 @@ DOMAIN = "api" STREAM_PING_PAYLOAD = "ping" STREAM_PING_INTERVAL = 50 # seconds +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Register the API with the HTTP interface.""" diff --git a/homeassistant/components/application_credentials/__init__.py b/homeassistant/components/application_credentials/__init__.py index f1471f29666..679ff9bfac4 100644 --- a/homeassistant/components/application_credentials/__init__.py +++ b/homeassistant/components/application_credentials/__init__.py @@ -57,6 +57,8 @@ CREATE_FIELDS = { } UPDATE_FIELDS: dict = {} # Not supported +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + @dataclass class ClientCredential: diff --git a/homeassistant/components/assist_pipeline/__init__.py b/homeassistant/components/assist_pipeline/__init__.py index 7af379804e1..055b4773be3 100644 --- a/homeassistant/components/assist_pipeline/__init__.py +++ b/homeassistant/components/assist_pipeline/__init__.py @@ -5,6 +5,7 @@ from collections.abc import AsyncIterable from homeassistant.components import stt from homeassistant.core import Context, HomeAssistant +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.typing import ConfigType from .const import DOMAIN @@ -35,6 +36,8 @@ __all__ = ( "PipelineEventType", ) +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Assist pipeline integration.""" diff --git a/homeassistant/components/auth/__init__.py b/homeassistant/components/auth/__init__.py index 1b47fb09393..deaf3b7892d 100644 --- a/homeassistant/components/auth/__init__.py +++ b/homeassistant/components/auth/__init__.py @@ -149,6 +149,7 @@ from homeassistant.components.http.ban import log_invalid_auth from homeassistant.components.http.data_validator import RequestDataValidator from homeassistant.components.http.view import HomeAssistantView from homeassistant.core import HomeAssistant, callback +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.config_entry_oauth2_flow import OAuth2AuthorizeCallbackView from homeassistant.helpers.typing import ConfigType from homeassistant.loader import bind_hass @@ -161,6 +162,8 @@ DOMAIN = "auth" StoreResultType = Callable[[str, Credentials], str] RetrieveResultType = Callable[[str, str], Credentials | None] +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + @bind_hass def create_auth_code( diff --git a/homeassistant/components/backup/__init__.py b/homeassistant/components/backup/__init__.py index 8d5f9764959..8ce8bee7793 100644 --- a/homeassistant/components/backup/__init__.py +++ b/homeassistant/components/backup/__init__.py @@ -1,6 +1,7 @@ """The Backup integration.""" from homeassistant.components.hassio import is_hassio from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.typing import ConfigType from .const import DOMAIN, LOGGER @@ -8,6 +9,8 @@ from .http import async_register_http_views from .manager import BackupManager from .websocket import async_register_websocket_handlers +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Backup integration.""" diff --git a/homeassistant/components/blueprint/__init__.py b/homeassistant/components/blueprint/__init__.py index 3087309f36a..1fe1ad8e189 100644 --- a/homeassistant/components/blueprint/__init__.py +++ b/homeassistant/components/blueprint/__init__.py @@ -1,5 +1,6 @@ """The blueprint integration.""" from homeassistant.core import HomeAssistant +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.typing import ConfigType from . import websocket_api @@ -15,6 +16,8 @@ from .errors import ( # noqa: F401 from .models import Blueprint, BlueprintInputs, DomainBlueprints # noqa: F401 from .schemas import is_blueprint_instance_config # noqa: F401 +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the blueprint integration.""" diff --git a/homeassistant/components/bluetooth/__init__.py b/homeassistant/components/bluetooth/__init__.py index 2c48b473b73..3e35c97ca34 100644 --- a/homeassistant/components/bluetooth/__init__.py +++ b/homeassistant/components/bluetooth/__init__.py @@ -33,7 +33,11 @@ from homeassistant.config_entries import ( from homeassistant.const import EVENT_HOMEASSISTANT_STARTED, EVENT_HOMEASSISTANT_STOP from homeassistant.core import Event, HassJob, HomeAssistant, callback as hass_callback from homeassistant.exceptions import ConfigEntryNotReady -from homeassistant.helpers import device_registry as dr, discovery_flow +from homeassistant.helpers import ( + config_validation as cv, + device_registry as dr, + discovery_flow, +) from homeassistant.helpers.debounce import Debouncer from homeassistant.helpers.event import async_call_later from homeassistant.helpers.issue_registry import ( @@ -119,6 +123,8 @@ _LOGGER = logging.getLogger(__name__) RECOMMENDED_MIN_HAOS_VERSION = AwesomeVersion("9.0.dev0") +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + async def _async_get_adapter_from_address( hass: HomeAssistant, address: str diff --git a/homeassistant/components/bluetooth_adapters/__init__.py b/homeassistant/components/bluetooth_adapters/__init__.py index c2af10d5455..3d5580aabf1 100644 --- a/homeassistant/components/bluetooth_adapters/__init__.py +++ b/homeassistant/components/bluetooth_adapters/__init__.py @@ -2,10 +2,13 @@ from __future__ import annotations from homeassistant.core import HomeAssistant +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.typing import ConfigType DOMAIN = "bluetooth_adapters" +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up Bluetooth Adapters from a config entry. diff --git a/homeassistant/components/browser/__init__.py b/homeassistant/components/browser/__init__.py index 954621ed66f..b01f04fa140 100644 --- a/homeassistant/components/browser/__init__.py +++ b/homeassistant/components/browser/__init__.py @@ -4,6 +4,7 @@ import webbrowser import voluptuous as vol from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.typing import ConfigType ATTR_URL = "url" @@ -20,6 +21,8 @@ SERVICE_BROWSE_URL_SCHEMA = vol.Schema( } ) +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + def _browser_url(service: ServiceCall) -> None: """Browse to URL.""" diff --git a/homeassistant/components/color_extractor/__init__.py b/homeassistant/components/color_extractor/__init__.py index 61ec27b3241..aa2d9cfbfdb 100644 --- a/homeassistant/components/color_extractor/__init__.py +++ b/homeassistant/components/color_extractor/__init__.py @@ -24,6 +24,8 @@ from .const import ATTR_PATH, ATTR_URL, DOMAIN, SERVICE_TURN_ON _LOGGER = logging.getLogger(__name__) +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + # Extend the existing light.turn_on service schema SERVICE_SCHEMA = vol.All( cv.has_at_least_one_key(ATTR_URL, ATTR_PATH), diff --git a/homeassistant/components/config/__init__.py b/homeassistant/components/config/__init__.py index def7edd4950..514154137e4 100644 --- a/homeassistant/components/config/__init__.py +++ b/homeassistant/components/config/__init__.py @@ -11,6 +11,7 @@ from homeassistant.components.http import HomeAssistantView from homeassistant.const import CONF_ID, EVENT_COMPONENT_LOADED from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.typing import ConfigType from homeassistant.setup import ATTR_COMPONENT from homeassistant.util.file import write_utf8_file_atomic @@ -32,6 +33,8 @@ SECTIONS = ( ACTION_CREATE_UPDATE = "create_update" ACTION_DELETE = "delete" +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the config component.""" diff --git a/homeassistant/components/configurator/__init__.py b/homeassistant/components/configurator/__init__.py index ea785b5cdfb..6fd3917cc9c 100644 --- a/homeassistant/components/configurator/__init__.py +++ b/homeassistant/components/configurator/__init__.py @@ -15,6 +15,7 @@ from typing import Any from homeassistant.const import ATTR_ENTITY_PICTURE, ATTR_FRIENDLY_NAME from homeassistant.core import HomeAssistant, ServiceCall, callback as async_callback +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.entity import async_generate_entity_id from homeassistant.helpers.event import async_call_later from homeassistant.helpers.typing import ConfigType @@ -44,6 +45,8 @@ STATE_CONFIGURED = "configured" ConfiguratorCallback = Callable[[list[dict[str, str]]], None] +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + @bind_hass @async_callback