From 8896b27f70deeb7d5b3ecdc643135735a4f2a09f Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 29 May 2023 20:57:18 +0200 Subject: [PATCH] Add empty config schema to integrations p-s (#93700) --- .../components/persistent_notification/__init__.py | 2 ++ homeassistant/components/repairs/__init__.py | 2 ++ homeassistant/components/safe_mode/__init__.py | 3 +++ homeassistant/components/search/__init__.py | 8 +++++++- homeassistant/components/ssdp/__init__.py | 5 ++++- homeassistant/components/sun/__init__.py | 5 ++++- homeassistant/components/system_health/__init__.py | 8 +++++++- 7 files changed, 29 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/persistent_notification/__init__.py b/homeassistant/components/persistent_notification/__init__.py index 042a6acfabb..81a9bc9de4d 100644 --- a/homeassistant/components/persistent_notification/__init__.py +++ b/homeassistant/components/persistent_notification/__init__.py @@ -63,6 +63,8 @@ SCHEMA_SERVICE_NOTIFICATION = vol.Schema( _LOGGER = logging.getLogger(__name__) +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + @bind_hass def create( diff --git a/homeassistant/components/repairs/__init__.py b/homeassistant/components/repairs/__init__.py index aa578c098d5..228972e8718 100644 --- a/homeassistant/components/repairs/__init__.py +++ b/homeassistant/components/repairs/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations from homeassistant.core import HomeAssistant +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.typing import ConfigType from . import issue_handler, websocket_api @@ -16,6 +17,7 @@ __all__ = [ "RepairsFlow", "RepairsFlowManager", ] +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) def repairs_flow_manager(hass: HomeAssistant) -> RepairsFlowManager | None: diff --git a/homeassistant/components/safe_mode/__init__.py b/homeassistant/components/safe_mode/__init__.py index 2f010fe79c9..3ed2d4476af 100644 --- a/homeassistant/components/safe_mode/__init__.py +++ b/homeassistant/components/safe_mode/__init__.py @@ -1,10 +1,13 @@ """The Safe Mode integration.""" from homeassistant.components import persistent_notification from homeassistant.core import HomeAssistant +from homeassistant.helpers import config_validation as cv from homeassistant.helpers.typing import ConfigType DOMAIN = "safe_mode" +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Safe Mode component.""" diff --git a/homeassistant/components/search/__init__.py b/homeassistant/components/search/__init__.py index b574081d5d4..a603d12e8c4 100644 --- a/homeassistant/components/search/__init__.py +++ b/homeassistant/components/search/__init__.py @@ -10,13 +10,19 @@ import voluptuous as vol from homeassistant.components import automation, group, person, script, websocket_api from homeassistant.components.homeassistant import scene from homeassistant.core import HomeAssistant, callback, split_entity_id -from homeassistant.helpers import device_registry as dr, entity_registry as er +from homeassistant.helpers import ( + config_validation as cv, + device_registry as dr, + entity_registry as er, +) from homeassistant.helpers.entity import entity_sources as get_entity_sources from homeassistant.helpers.typing import ConfigType DOMAIN = "search" _LOGGER = logging.getLogger(__name__) +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Search component.""" diff --git a/homeassistant/components/ssdp/__init__.py b/homeassistant/components/ssdp/__init__.py index 570e79e4993..e448fe066c4 100644 --- a/homeassistant/components/ssdp/__init__.py +++ b/homeassistant/components/ssdp/__init__.py @@ -48,7 +48,7 @@ from homeassistant.const import ( ) from homeassistant.core import HomeAssistant, callback as core_callback from homeassistant.data_entry_flow import BaseServiceInfo -from homeassistant.helpers import discovery_flow +from homeassistant.helpers import config_validation as cv, discovery_flow from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.event import async_track_time_interval from homeassistant.helpers.instance_id import async_get as async_get_instance_id @@ -106,6 +106,9 @@ PRIMARY_MATCH_KEYS = [ _LOGGER = logging.getLogger(__name__) +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + + @dataclass(slots=True) class SsdpServiceInfo(BaseServiceInfo): """Prepared info from ssdp/upnp entries.""" diff --git a/homeassistant/components/sun/__init__.py b/homeassistant/components/sun/__init__.py index a43bf4fd808..a2378136a06 100644 --- a/homeassistant/components/sun/__init__.py +++ b/homeassistant/components/sun/__init__.py @@ -15,7 +15,7 @@ from homeassistant.const import ( Platform, ) from homeassistant.core import CALLBACK_TYPE, Event, HomeAssistant, callback -from homeassistant.helpers import event +from homeassistant.helpers import config_validation as cv, event from homeassistant.helpers.entity import Entity from homeassistant.helpers.integration_platform import ( async_process_integration_platform_for_component, @@ -80,6 +80,9 @@ _PHASE_UPDATES = { } +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + + async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Track the state of the sun.""" hass.async_create_task( diff --git a/homeassistant/components/system_health/__init__.py b/homeassistant/components/system_health/__init__.py index 3d149b3a40d..9a222d7096c 100644 --- a/homeassistant/components/system_health/__init__.py +++ b/homeassistant/components/system_health/__init__.py @@ -14,7 +14,11 @@ import voluptuous as vol from homeassistant.components import websocket_api from homeassistant.core import HomeAssistant, callback -from homeassistant.helpers import aiohttp_client, integration_platform +from homeassistant.helpers import ( + aiohttp_client, + config_validation as cv, + integration_platform, +) from homeassistant.helpers.typing import ConfigType from homeassistant.loader import bind_hass @@ -24,6 +28,8 @@ DOMAIN = "system_health" INFO_CALLBACK_TIMEOUT = 5 +CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN) + @bind_hass @callback