-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add documentation on triggers yaml #2884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| _OPTIONS_SCHEMA = vol.Schema({ | ||
| vol.Required("event_type"): cv.string, | ||
| vol.Required("behavior", default="any"): vol.In( | ||
| ["first", "last", "any"] | ||
| ), | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we should adapt this trigger to be more realistic, I'd love for the example YAML to adhere to the example trigger, but from the example it wasn't clear what event_type: str was used for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we should have a single consistent example on this page. Lets update the class to represent a nicer trigger.
|
|
||
| ### Trigger schema | ||
|
|
||
| The frontend uses the `triggers.yaml` file to know the structure of the triggers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The frontend uses the `triggers.yaml` file to know the structure of the triggers. | |
| Triggers should have their description in a `triggers.yaml` file. The description specifies the structure of the triggers and is used by the frontend, for example. |
it is also used on core, in the get_triggers_for_target websocket api, not only for frontend.
| The frontend uses the `triggers.yaml` file to know the structure of the triggers. | ||
| This file is similar to `services.yaml`. | ||
|
|
||
| For example, the following snippet shows a trigger that takes a target binary sensor with a specific device class and a select selector with a predefined set of options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| For example, the following snippet shows a trigger that takes a target binary sensor with a specific device class and a select selector with a predefined set of options. | |
| The following snippet shows a trigger that takes a target binary sensor with a specific device class and a select selector with a predefined set of options. |
if we update the example class above, I think we can simplify this sentence since it is part of the full example in the current top section.
Proposed change
Add documentation on triggers yaml
Type of change
Checklist
Additional information