mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Accept None directly in the selector schemas (#151510)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
@@ -119,9 +119,7 @@ def _service_schema(targeted: bool, custom: bool) -> vol.Schema:
|
||||
}
|
||||
|
||||
if targeted:
|
||||
schema_dict[vol.Required("target")] = vol.Any(
|
||||
selector.TargetSelector.CONFIG_SCHEMA, None
|
||||
)
|
||||
schema_dict[vol.Required("target")] = selector.TargetSelector.CONFIG_SCHEMA
|
||||
|
||||
if custom:
|
||||
schema_dict |= CUSTOM_INTEGRATION_EXTRA_SCHEMA_DICT
|
||||
|
||||
@@ -38,9 +38,7 @@ FIELD_SCHEMA = vol.Schema(
|
||||
TRIGGER_SCHEMA = vol.Any(
|
||||
vol.Schema(
|
||||
{
|
||||
vol.Optional("target"): vol.Any(
|
||||
selector.TargetSelector.CONFIG_SCHEMA, None
|
||||
),
|
||||
vol.Optional("target"): selector.TargetSelector.CONFIG_SCHEMA,
|
||||
vol.Optional("fields"): vol.Schema({str: FIELD_SCHEMA}),
|
||||
}
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user