-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Update seventeentrack markdown to reflect new state #39214
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: current
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 Walkthrough""" WalkthroughThe SeventeenTrack integration documentation was revised to remove the previous example that directly iterated over the "17track_in_transit" sensor's package attribute. It now includes a new "Templates" section demonstrating how to create a template sensor that dynamically fetches and exposes package data via the Changes
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes detected. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
source/_integrations/seventeentrack.markdown (1)
62-64
: Simplified markdown card is correct. The new example cleanly outputs the delivered package count using the17track_delivered
sensor and aligns with the integration’s summary sensors.
Consider adding a brief note that users should replace17track_delivered
with their actual entity ID if they’ve customized it during setup.
📜 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
📒 Files selected for processing (1)
source/_integrations/seventeentrack.markdown
(1 hunks)
⏰ 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
{% endfor %} | ||
title: Number of packages delivered | ||
content: | | ||
{{states.sensor['17track_delivered'].state}} |
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.
This is not the recommended way to retrieve states. Please use the states()
template function instead.
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.
That said, this feels like overcomplicated to use a markdown card for... it is now just a sensor as normal that can be used in any existing card direct (e.g., a tile card).
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.
Added a template section
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
The PR replaces a super useful example (list of all current packages being tracked and their respective information) with a useless one (single number of overall delivered packages). Does it mean the original use case can't be solved anymore? It would be useful to solve the original use case. Also, the new example has negative value, as it advertises the use of a Markdown card just to show the value of one sensor. With Home Assistant you can already display the value of any sensor natively, so I wouldn't suggest that to users. |
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.
Actionable comments posted: 1
♻️ Duplicate comments (1)
source/_integrations/seventeentrack.markdown (1)
148-160
: Repeat of earlier feedback – avoid dot-notation & Markdown card for single sensorThe example again relies on
states.sensor.packages_data.attributes.packages
, which is discouraged. Usestate_attr('sensor.packages_data', 'packages')
or iterate over the variable returned in the previous block.Additionally, recommending a Markdown card for a plain sensor duplicates a concern already raised in earlier reviews. Users can display the sensor directly in any standard card (e.g., Entities, Tile).
🧹 Nitpick comments (2)
source/_integrations/seventeentrack.markdown (2)
107-107
: Multiple H1-level headings – violates MD025
# Templates
introduces a second top-level heading. Stick to##
(or lower) for subsections to comply with the single-H1 rule used across the docs site.-# Templates +## Templates
109-109
: Minor grammar nit – drop the plural-genitive “packages”“display the packages data”
Should be singular (“package data”) or omit the noun (“display package data”).-Create template sensors to display the packages data. +Create template sensors to display package data.
📜 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
📒 Files selected for processing (1)
source/_integrations/seventeentrack.markdown
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`source/_integrations/*`: Integration documentation must use the provided template structure and section order.
source/_integrations/*
: Integration documentation must use the provided template structure and section order.
📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)
List of files the instruction was applied to:
source/_integrations/seventeentrack.markdown
🪛 LanguageTool
source/_integrations/seventeentrack.markdown
[uncategorized] ~109-~109: It seems likely that a singular genitive (’s) apostrophe is missing.
Context: ... Create template sensors to display the packages data. ## Packages sensor with response...
(AI_HYDRA_LEO_APOSTROPHE_S_XS)
🪛 markdownlint-cli2 (0.17.2)
source/_integrations/seventeentrack.markdown
107-107: Multiple top-level headings in the same document
null
(MD025, single-title, single-h1)
template: | ||
- triggers: | ||
- trigger: state | ||
entity_id: sensor.17track_in_transit | ||
- trigger: state | ||
entity_id: sensor.17track_delivered | ||
actions: | ||
- action: seventeentrack.get_packages | ||
data: | ||
package_state: | ||
- in_transit | ||
- delivered | ||
config_entry_id: 01JY8MX7J0TPCQTTRMXV2P7123 | ||
response_variable: packages_var | ||
sensor: | ||
- name: packages_data | ||
unique_id: packages_data | ||
state: "{{ packages_var['packages']|length }}" | ||
attributes: | ||
packages: "{{ packages_var['packages'] }}" | ||
``` |
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.
Template-sensor example is syntactically invalid
The YAML uses undocumented keys (triggers:
/ actions:
) and the action:
block is not allowed inside template:
sensors. This will raise a config error. A valid triggered-template sensor should look like:
template:
- - triggers:
- - trigger: state
- entity_id: sensor.17track_in_transit
- - trigger: state
- entity_id: sensor.17track_delivered
- actions:
- - action: seventeentrack.get_packages
+ - trigger:
+ - platform: state
+ entity_id:
+ - sensor.17track_in_transit
+ - sensor.17track_delivered
+ action:
+ - service: seventeentrack.get_packages
data:
package_state:
- in_transit
- delivered
config_entry_id: 01JY8MX7J0TPCQTTRMXV2P7123
response_variable: packages_var
sensor:
- name: packages_data
unique_id: packages_data
state: "{{ packages_var['packages'] | length }}"
attributes:
packages: "{{ packages_var['packages'] }}"
Please re-test the snippet with ha core check
before publishing.
📝 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.
template: | |
- triggers: | |
- trigger: state | |
entity_id: sensor.17track_in_transit | |
- trigger: state | |
entity_id: sensor.17track_delivered | |
actions: | |
- action: seventeentrack.get_packages | |
data: | |
package_state: | |
- in_transit | |
- delivered | |
config_entry_id: 01JY8MX7J0TPCQTTRMXV2P7123 | |
response_variable: packages_var | |
sensor: | |
- name: packages_data | |
unique_id: packages_data | |
state: "{{ packages_var['packages']|length }}" | |
attributes: | |
packages: "{{ packages_var['packages'] }}" | |
``` | |
template: | |
- trigger: | |
- platform: state | |
entity_id: | |
- sensor.17track_in_transit | |
- sensor.17track_delivered | |
action: | |
- service: seventeentrack.get_packages | |
data: | |
package_state: | |
- in_transit | |
- delivered | |
config_entry_id: 01JY8MX7J0TPCQTTRMXV2P7123 | |
response_variable: packages_var | |
sensor: | |
- name: packages_data | |
unique_id: packages_data | |
state: "{{ packages_var['packages'] | length }}" | |
attributes: | |
packages: "{{ packages_var['packages'] }}" |
🤖 Prompt for AI Agents
In source/_integrations/seventeentrack.markdown around lines 118 to 138, the
template sensor uses invalid keys like triggers and actions inside the template
sensor, which is not allowed and causes configuration errors. To fix this,
remove the triggers and actions keys and instead define a proper triggered
template sensor using the documented syntax, such as using a trigger block at
the top level and a value_template for the sensor state. Validate the corrected
YAML with `ha core check` to ensure no syntax errors remain.
Proposed change
Update seventeentrack markdown to reflect new state
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.Summary by CodeRabbit