Add support for selectors in services.yaml (#43162)
* Add support for selectors in services.yaml * Add base schema validation
This commit is contained in:
parent
df25b53bb8
commit
bae026a6fe
6 changed files with 144 additions and 3 deletions
|
@ -6,8 +6,9 @@ from typing import Dict
|
|||
import voluptuous as vol
|
||||
from voluptuous.humanize import humanize_error
|
||||
|
||||
from homeassistant.const import CONF_SELECTOR
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv, selector
|
||||
from homeassistant.util.yaml import load_yaml
|
||||
|
||||
from .model import Integration
|
||||
|
@ -27,6 +28,7 @@ FIELD_SCHEMA = vol.Schema(
|
|||
vol.Optional("default"): exists,
|
||||
vol.Optional("values"): exists,
|
||||
vol.Optional("required"): bool,
|
||||
vol.Optional(CONF_SELECTOR): selector.validate_selector,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue