-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Fix event documentation example #28402
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -43,7 +43,7 @@ Besides the timestamp of the last event, the event entity also keeps track of th | |||||
|
||||||
This allows you, for example, to trigger a different action when the button on a remote control is pressed once or twice, if your remote control is capable of emitting these different types of events. | ||||||
|
||||||
When combining that with the [choose action](/docs/scripts/#choose-a-group-of-actions) script, you can assign multiple different actions to a single event entity. In the following example, pressing the button on the remote once or twice will trigger a different scene: | ||||||
When combining that with the [choose action](/docs/scripts/#choose-a-group-of-actions) script, you can assign multiple different actions to a single event entity. In the following example, pressing the button on the remote short or long will trigger a different scene: | ||||||
|
||||||
```yaml | ||||||
trigger: | ||||||
|
@@ -53,19 +53,19 @@ action: | |||||
- alias: "Choose an action based on the type of event" | ||||||
choose: | ||||||
- conditions: | ||||||
- alias: "Normal evening scene if the button was pressed once" | ||||||
- alias: "Normal evening scene if the button was pressed shortly" | ||||||
condition: state | ||||||
entity_id: event.hue_remote_control_on_button | ||||||
attribute: "event_type" | ||||||
state: "single_press" | ||||||
state: "short_release" | ||||||
sequence: | ||||||
- scene: scene.living_room_evening | ||||||
- conditions: | ||||||
- alias: "Move" | ||||||
- alias: "Scene for watching a movie if the button was pressed long" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is matching the Hue wording, that is used in the example. |
||||||
condition: state | ||||||
entity_id: event.hue_remote_control_on_button | ||||||
attribute: "event_type" | ||||||
state: "single_press" | ||||||
state: "long_release" | ||||||
sequence: | ||||||
- scene: scene.living_room_movie | ||||||
``` | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 MS Style Guide seems to use press and hold / select and hold
https://learn.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/p/press-and-hold
also google:
https://support.google.com/accessibility/android/answer/7650693?hl=en
Alternatively, Apple use the term long-press:
https://developer.apple.com/documentation/uikit/touches_presses_and_gestures/handling_uikit_gestures/handling_long-press_gestures
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.
Not in this case, as it is a physical remote, and not an UI button.
As per Microsoft:
This is a hardware button, so matches the guides.