Skip to content

Add event entity to template integration #39144

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

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

Petro31
Copy link
Contributor

@Petro31 Petro31 commented May 22, 2025

Proposed change

Add event entities to template integration.

e.g.

template:
- event:
  - name: Joost Review This PR Status
    event_type: "{{ 'joost_avoided_reviewing' }}"
    event_types: "{{ ['review_needed', 'joost_avoided_reviewing', 'reviewed_by_other', 'reviewed_by_joost'] }}"

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

Summary by CodeRabbit

  • Documentation
    • Updated documentation to include support for the new "event" entity type in the template integration.
    • Improved organization and clarity of YAML configuration reference by restructuring entity schemas and shared fields.
    • Enhanced descriptions and examples to reflect the addition of "event" and corrected grouping of related entities.

@Petro31 Petro31 requested a review from a team as a code owner May 22, 2025 13:02
@home-assistant home-assistant bot added in-progress This PR/Issue is currently being worked on needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch next This PR goes into the next branch labels May 22, 2025
@home-assistant
Copy link

It seems that this PR is targeted against an incorrect branch. Documentation updates which apply to our current stable release should target the current branch. Please change the target branch of this PR to current and rebase if needed. If this is documentation for a new feature, please add a link to that PR in your description.

Copy link

netlify bot commented May 22, 2025

Deploy Preview for home-assistant-docs failed.

Name Link
🔨 Latest commit a9833ee
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/682f24699d64c8000899e5a9

@home-assistant home-assistant bot added the has-parent This PR has a parent PR in a other repo label May 22, 2025
@Petro31 Petro31 changed the title Add-event-template-entity Add event entity to template integration May 22, 2025
@home-assistant home-assistant bot removed the needs-rebase The PR has been branched of the wrong base branch or targets an incorrect target branch label May 22, 2025
Copy link
Contributor

coderabbitai bot commented May 22, 2025

📝 Walkthrough

Walkthrough

The documentation for the template integration was updated to support a new event entity type. The YAML configuration schema was reorganized, adding explicit definitions for event entities and restructuring the placement of number, select, and sensor schemas. Shared fields and references were updated for consistency and clarity.

Changes

File(s) Change Summary
source/_integrations/template.markdown Added documentation for new event entity type in the template integration; updated supported entity lists and configuration references; reorganized YAML schema sections for clarity; moved and expanded schemas for several entities.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HomeAssistantConfig
    participant TemplateIntegration

    User ->> HomeAssistantConfig: Define template entity (sensor, binary_sensor, event, etc.)
    HomeAssistantConfig ->> TemplateIntegration: Parse configuration
    TemplateIntegration -->> HomeAssistantConfig: Validate entity type (sensor, binary_sensor, event, etc.)
    TemplateIntegration ->> HomeAssistantConfig: Register entity with appropriate schema
    HomeAssistantConfig -->> User: Entity available for use
Loading

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🔭 Outside diff range comments (1)
source/_integrations/template.markdown (1)

170-179: 🛠️ Refactor suggestion

Include event in shared-fields description
The [all binary_sensor, event, sensor entities] block now covers events, but the description only mentions sensors and binary sensors. Update it to reference events.

- "[all binary_sensor, event, sensor entities]":
-   description: Fields that can be used above for both sensors and binary sensors.
+ "[all binary_sensor, event, sensor entities]":
+   description: Fields that can be used above for sensors, binary sensors, and events.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 63728ef and a381e95.

📒 Files selected for processing (1)
  • source/_integrations/template.markdown (11 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
source/_integrations/template.markdown

56-56: Link fragments should be valid
null

(MD051, link-fragments)


273-273: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)


273-273: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)


277-277: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)


277-277: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)

🪛 LanguageTool
source/_integrations/template.markdown

[misspelling] ~212-~212: This word is normally spelled with a hyphen.
Context: ... Note that the string comparison is not case sensitive; "TrUe" and "yEs" are allowed. ...

(EN_COMPOUNDS_CASE_SENSITIVE)


[style] ~269-~269: In American English, abbreviations like “etc.” require a period.
Context: ...nd (Open/Closed, Detected/Clear etc) depends on the sensor's device_class v...

(ETC_PERIOD)


[grammar] ~644-~644: Is an article like ‘a’ or ‘an’ missing?
Context: ... describes when the state of the sensor was last reset. Must render to a valid `dat...

(BE_NN)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - home-assistant-docs
  • GitHub Check: Header rules - home-assistant-docs
  • GitHub Check: Pages changed - home-assistant-docs
🔇 Additional comments (2)
source/_integrations/template.markdown (2)

9-9: Add event to supported categories
The insertion of Event into the ha_category list is correct and follows alphabetical order, matching the new entity support.


34-34: Add event to supported platforms
Including event in the ha_platforms list is accurate and maintains alphabetical ordering with the other platforms.

@@ -104,7 +106,7 @@ template:

{% endraw %}

### Trigger-based template binary sensors, images, lights, numbers, selects, sensors, switches, and weathers
### Trigger-based template binary sensors, events, images, lights, numbers, selects, sensors, switches, and weathers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix pluralization of “weather”
In the trigger-based heading, change “weathers” to “weather entities”.

- ### Trigger-based template binary sensors, events, images, lights, numbers, selects, sensors, switches, and weathers
+ ### Trigger-based template binary sensors, events, images, lights, numbers, selects, sensors, switches, and weather entities
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Trigger-based template binary sensors, events, images, lights, numbers, selects, sensors, switches, and weathers
### Trigger-based template binary sensors, events, images, lights, numbers, selects, sensors, switches, and weather entities
🤖 Prompt for AI Agents
In source/_integrations/template.markdown at line 109, update the heading by
replacing the plural word "weathers" with the correct phrase "weather entities"
to fix the pluralization issue.


_For old sensor/binary sensor configuration format, [see below](#legacy-binary-sensor-configuration-format)._

### State-based template alarm control panels, binary sensors, buttons, covers, fans, images, lights, numbers, selects, sensors, switches, vacuums, and weathers
### State-based template alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, numbers, selects, sensors, switches, vacuums, and weathers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix pluralization of “weather”
The heading’s list should end with “weather entities” instead of “weathers”.

- ### State-based template alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, numbers, selects, sensors, switches, vacuums, and weathers
+ ### State-based template alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, numbers, selects, sensors, switches, vacuums, and weather entities
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### State-based template alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, numbers, selects, sensors, switches, vacuums, and weathers
### State-based template alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, numbers, selects, sensors, switches, vacuums, and weather entities
🤖 Prompt for AI Agents
In source/_integrations/template.markdown at line 87, the heading ends with the
incorrect plural form "weathers". Change "weathers" to "weather entities" to fix
the pluralization and improve clarity.

@@ -78,11 +80,11 @@ If you need more specific features for your use case, the manual [YAML-configura

## YAML configuration

Entities (alarm control panels, binary sensors, buttons, covers, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weathers) are defined in your YAML configuration files under the `template:` key. You can define multiple configuration blocks as a list. Each block defines sensor/binary sensor/number/select entities and can contain optional update triggers.
Entities (alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weathers) are defined in your YAML configuration files under the `template:` key. You can define multiple configuration blocks as a list. Each block defines sensor/binary sensor/number/select entities and can contain optional update triggers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix pluralization of “weather”
In the parenthetical list, replace “weathers” with “weather entities” for consistency and correctness.

- Entities (alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weathers) are defined in your YAML configuration files under the `template:` key.
+ Entities (alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weather entities) are defined in your YAML configuration files under the `template:` key.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Entities (alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weathers) are defined in your YAML configuration files under the `template:` key. You can define multiple configuration blocks as a list. Each block defines sensor/binary sensor/number/select entities and can contain optional update triggers.
Entities (alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weather entities) are defined in your YAML configuration files under the `template:` key. You can define multiple configuration blocks as a list. Each block defines sensor/binary sensor/number/select entities and can contain optional update triggers.
🤖 Prompt for AI Agents
In source/_integrations/template.markdown at line 83, the word "weathers" in the
parenthetical list is incorrectly pluralized. Replace "weathers" with "weather
entities" to maintain consistency and correctness in the list of entity types.

@@ -51,7 +53,7 @@ related:

The `template` integration allows creating entities which derive their values from other data. This is done by specifying [templates](/docs/configuration/templating/) for properties of an entity, like the name or the state.

Alarm control panels, binary sensors, buttons, covers, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weathers are covered on this page. They can be configured using [UI](#configuration) or [YAML](#yaml-configuration) file.
Alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weathers are covered on this page. They can be configured using [UI](#configuration) or [YAML](#yaml-configuration) file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix pluralization of “weather”
“Weathers” is incorrect here—use “weather entities” (or simply “weather”) to match the integration name and other occurrences.

- Alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weathers are covered on this page.
+ Alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weather entities are covered on this page.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weathers are covered on this page. They can be configured using [UI](#configuration) or [YAML](#yaml-configuration) file.
Alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weather entities are covered on this page. They can be configured using [UI](#configuration) or [YAML](#yaml-configuration) file.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

56-56: Link fragments should be valid
null

(MD051, link-fragments)

🤖 Prompt for AI Agents
In source/_integrations/template.markdown at line 56, replace the incorrect
plural "weathers" with "weather entities" or just "weather" to correctly match
the integration name and maintain consistency with other mentions.

Comment on lines +343 to +359
event:
description: List of events
required: true
type: map
keys:
device_class:
description: Sets the [class of the device](/integrations/event/), changing the device state and icon that is displayed on the frontend.
required: false
type: string
event_type:
description: Template for the event's last fired event type.
required: true
type: template
event_types:
description: Template for the event's available event types.
required: true
type: template
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Configuration schema: event should be a list, not a map
The example usage defines event as a list of mappings (- event: followed by - name: …), but the reference schema declares type: map. This mismatch will confuse users.

Proposed fix:

-event:
-  description: List of events
-  required: true
-  type: map
+event:
+  description: List of events
+  required: true
+  type: list

Ensure the keys: under this section remain the same, as they apply to each list item.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
event:
description: List of events
required: true
type: map
keys:
device_class:
description: Sets the [class of the device](/integrations/event/), changing the device state and icon that is displayed on the frontend.
required: false
type: string
event_type:
description: Template for the event's last fired event type.
required: true
type: template
event_types:
description: Template for the event's available event types.
required: true
type: template
event:
description: List of events
required: true
type: list
keys:
device_class:
description: Sets the [class of the device](/integrations/event/), changing the device state and icon that is displayed on the frontend.
required: false
type: string
event_type:
description: Template for the event's last fired event type.
required: true
type: template
event_types:
description: Template for the event's available event types.
required: true
type: template
🤖 Prompt for AI Agents
In source/_integrations/template.markdown around lines 343 to 359, the
configuration schema incorrectly defines `event` as a map, but it should be a
list to match the example usage. Change the `type` of `event` from `map` to
`list` while keeping the `keys:` section unchanged, so each item in the list has
the same structure as currently defined.

Comment on lines +194 to +202
"[all alarm control panel, binary sensor, button, cover, event, fan, image, light, number, select, sensor, switch, vacuum, weather entities]":
description: Fields that can be used above for sensors, binary sensors, buttons, numbers, and selects.
required: false
type: map
keys:
name:
description: Defines a template to get the name of the entity.
required: false
type: template
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Align shared-fields description with entity list
The block [all alarm control panel, binary sensor, button, cover, event, fan, image, light, number, select, sensor, switch, vacuum, weather entities] now includes many entity types, but the description only lists a subset. Update it to reflect all supported types.

- "[all alarm control panel, binary sensor, button, cover, event, fan, image, light, number, select, sensor, switch, vacuum, weather entities]":
-   description: Fields that can be used above for sensors, binary sensors, buttons, numbers, and selects.
+ "[all alarm control panel, binary sensor, button, cover, event, fan, image, light, number, select, sensor, switch, vacuum, weather entities]":
+   description: Fields that can be used above for alarm control panels, binary sensors, buttons, covers, events, fans, images, lights, locks, numbers, selects, sensors, switches, vacuums, and weather entities.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In source/_integrations/template.markdown around lines 194 to 202, the
description for the shared fields under the key listing multiple entity types
does not include all the entity types mentioned. Update the description text to
list all the entity types exactly as they appear in the key, ensuring the
description fully reflects all supported entity types for clarity and accuracy.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (5)
source/_integrations/template.markdown (5)

56-56: Fix pluralization of “weather”
The text uses “weathers,” which is incorrect. Change to “weather entities” for consistency.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

56-56: Link fragments should be valid
null

(MD051, link-fragments)


83-83: Fix pluralization of “weather”
The list ends with “weathers”—update to “weather entities” to match docs style.


87-87: Fix pluralization of “weather”
In this heading, replace “weathers” with “weather entities” for correctness.


194-202: Align shared-fields description with entity list
The schema key lists many types (alarm control panel, binary sensor, button, cover, event, …), but the description only lists sensors, binary sensors, buttons, numbers, and selects.


343-359: Define event as a list, not a map
To match example usage and other entity types (e.g., sensor, binary_sensor are lists), event should be type: list with per-item keys—currently it’s type: map.

🧹 Nitpick comments (1)
source/_integrations/template.markdown (1)

1241-1243: Hyphenate “Trigger-based event”
Headings should use “Trigger-based” (with a hyphen) for consistency and proper compound adjective styling.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~1241-~1241: This expression is usually spelled with a hyphen.
Context: ... seconds: 5 ``` {% endraw %} ### Trigger based event - Turn any custom event into an e...

(BASED_HYPHEN)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between a381e95 and a9833ee.

📒 Files selected for processing (1)
  • source/_integrations/template.markdown (12 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
source/_integrations/template.markdown

56-56: Link fragments should be valid
null

(MD051, link-fragments)


273-273: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)


273-273: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)


277-277: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)


277-277: Emphasis style
Expected: underscore; Actual: asterisk

(MD049, emphasis-style)

🪛 LanguageTool
source/_integrations/template.markdown

[uncategorized] ~204-~204: Possible missing comma found.
Context: ...with the unique ID of the configuration block if available. This allows changing the ...

(AI_HYDRA_LEO_MISSING_COMMA)


[misspelling] ~212-~212: This word is normally spelled with a hyphen.
Context: ... Note that the string comparison is not case sensitive; "TrUe" and "yEs" are allowed. ...

(EN_COMPOUNDS_CASE_SENSITIVE)


[style] ~269-~269: In American English, abbreviations like “etc.” require a period.
Context: ...nd (Open/Closed, Detected/Clear etc) depends on the sensor's device_class v...

(ETC_PERIOD)


[grammar] ~644-~644: Is an article like ‘a’ or ‘an’ missing?
Context: ... describes when the state of the sensor was last reset. Must render to a valid `dat...

(BE_NN)


[uncategorized] ~1241-~1241: This expression is usually spelled with a hyphen.
Context: ... seconds: 5 ``` {% endraw %} ### Trigger based event - Turn any custom event into an e...

(BASED_HYPHEN)

🔇 Additional comments (2)
source/_integrations/template.markdown (2)

9-9: Add Event to Home Assistant categories
Including Event in the ha_category list properly surfaces the new entity type in the integration overview.


34-34: Add event to supported platforms
Adding event under ha_platforms ensures the documentation matches the integration’s implementation.

Comment on lines +171 to 173
"[all binary_sensor, event, sensor entities]":
description: Fields that can be used above for both sensors and binary sensors.
required: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Update shared-fields description to include events
The key applies to [all binary_sensor, event, sensor entities], but the description only mentions sensors and binary sensors. This will confuse users about event support.

Suggested diff:

- description: Fields that can be used above for both sensors and binary sensors.
+ description: Fields that can be used above for sensors, binary sensors, and events.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"[all binary_sensor, event, sensor entities]":
description: Fields that can be used above for both sensors and binary sensors.
required: false
"[all binary_sensor, event, sensor entities]":
description: Fields that can be used above for sensors, binary sensors, and events.
required: false
🤖 Prompt for AI Agents
In source/_integrations/template.markdown around lines 171 to 173, the
description for the key "[all binary_sensor, event, sensor entities]" only
mentions sensors and binary sensors, omitting events. Update the description to
explicitly include events so users understand that event entities are also
supported by this key.

Comment on lines +1246 to +1254
template:
- triggers:
- trigger: event
event_type: room_state
event:
name: Room State
event_type: "{{ trigger.event.data.status }}"
event_types: "{{ ['room_occupied', 'room_empty'] }}"
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix YAML list syntax for event definitions
The example under event: omits the leading dash before each item, unlike other entity examples. This will prevent users from defining multiple events.

Proposed diff:

-    event:
-      name: Room State
-      event_type: "{{ trigger.event.data.status }}"
-      event_types: "{{ ['room_occupied', 'room_empty'] }}"
+    event:
+      - name: Room State
+        event_type: "{{ trigger.event.data.status }}"
+        event_types: "{{ ['room_occupied', 'room_empty'] }}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
template:
- triggers:
- trigger: event
event_type: room_state
event:
name: Room State
event_type: "{{ trigger.event.data.status }}"
event_types: "{{ ['room_occupied', 'room_empty'] }}"
```
template:
- triggers:
- trigger: event
event_type: room_state
event:
- name: Room State
event_type: "{{ trigger.event.data.status }}"
event_types: "{{ ['room_occupied', 'room_empty'] }}"
🤖 Prompt for AI Agents
In source/_integrations/template.markdown around lines 1246 to 1254, the YAML
list under the event key is missing leading dashes before each item, which
breaks the list syntax and prevents defining multiple events. Fix this by adding
a dash before each event item to properly format them as a YAML list, consistent
with other entity examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-parent This PR has a parent PR in a other repo in-progress This PR/Issue is currently being worked on next This PR goes into the next branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy