Home Assistant Unofficial Reference 2024.12.1
schemata.py
Go to the documentation of this file.
1 """Schemata for ruuvi_gateway."""
2 
3 from __future__ import annotations
4 
5 import voluptuous as vol
6 
7 from homeassistant.const import CONF_HOST, CONF_TOKEN
8 
9 CONFIG_SCHEMA = vol.Schema(
10  {
11  vol.Required(CONF_HOST): str,
12  vol.Required(CONF_TOKEN): str,
13  }
14 )
15 
16 
17 def get_config_schema_with_default_host(host: str) -> vol.Schema:
18  """Return a config schema with a default host."""
19  return CONFIG_SCHEMA.extend({vol.Required(CONF_HOST, default=host): str})
vol.Schema get_config_schema_with_default_host(str host)
Definition: schemata.py:17