mirror of
https://github.com/home-assistant/core
synced 2024-08-28 03:36:46 +02:00
Add CONFIG_SCHEMA to analytics (#93598)
This commit is contained in:
parent
0bf9bb15f6
commit
d4462829f5
@ -6,12 +6,15 @@ import voluptuous as vol
|
||||
from homeassistant.components import websocket_api
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED
|
||||
from homeassistant.core import Event, HassJob, HomeAssistant, callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.event import async_call_later, async_track_time_interval
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
from .analytics import Analytics
|
||||
from .const import ATTR_ONBOARDED, ATTR_PREFERENCES, DOMAIN, INTERVAL, PREFERENCE_SCHEMA
|
||||
|
||||
CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
|
||||
|
||||
|
||||
async def async_setup(hass: HomeAssistant, _: ConfigType) -> bool:
|
||||
"""Set up the analytics integration."""
|
||||
|
@ -1045,6 +1045,11 @@ def expand_condition_shorthand(value: Any | None) -> Any:
|
||||
|
||||
|
||||
# Schemas
|
||||
def empty_config_schema(domain: str) -> vol.Schema:
|
||||
"""Return a config schema which accepts no configuration parameters."""
|
||||
return vol.Schema({vol.Optional(domain): vol.Schema({})}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
||||
PLATFORM_SCHEMA = vol.Schema(
|
||||
{
|
||||
vol.Required(CONF_PLATFORM): string,
|
||||
|
Loading…
Reference in New Issue
Block a user