mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add trigger selector for blueprint (#103050)
This commit is contained in:
@@ -459,7 +459,7 @@ class ColorTempSelector(Selector[ColorTempSelectorConfig]):
|
||||
|
||||
|
||||
class ConditionSelectorConfig(TypedDict):
|
||||
"""Class to represent an action selector config."""
|
||||
"""Class to represent an condition selector config."""
|
||||
|
||||
|
||||
@SELECTORS.register("condition")
|
||||
@@ -1280,6 +1280,27 @@ class TimeSelector(Selector[TimeSelectorConfig]):
|
||||
return cast(str, data)
|
||||
|
||||
|
||||
class TriggerSelectorConfig(TypedDict):
|
||||
"""Class to represent an trigger selector config."""
|
||||
|
||||
|
||||
@SELECTORS.register("trigger")
|
||||
class TriggerSelector(Selector[TriggerSelectorConfig]):
|
||||
"""Selector of a trigger sequence (script syntax)."""
|
||||
|
||||
selector_type = "trigger"
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema({})
|
||||
|
||||
def __init__(self, config: TriggerSelectorConfig | None = None) -> None:
|
||||
"""Instantiate a selector."""
|
||||
super().__init__(config)
|
||||
|
||||
def __call__(self, data: Any) -> Any:
|
||||
"""Validate the passed selection."""
|
||||
return vol.Schema(cv.TRIGGER_SCHEMA)(data)
|
||||
|
||||
|
||||
class FileSelectorConfig(TypedDict):
|
||||
"""Class to represent a file selector config."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user