Skip to content

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

Open
wants to merge 5 commits into
base: current
Choose a base branch
from

Conversation

shaiu
Copy link
Contributor

@shaiu shaiu commented May 25, 2025

Proposed change

Update seventeentrack markdown to reflect new state

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.
  • The documentation follows the Home Assistant documentation standards.

Summary by CodeRabbit

  • Documentation
    • Enhanced the dashboard summary card example to use a dynamic template sensor for displaying package details.
    • Added guidance on creating template sensors that update package lists based on transit and delivery status.

@home-assistant home-assistant bot added the current This PR goes into the current branch label May 25, 2025
Copy link

netlify bot commented May 25, 2025

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit 7760869
🔍 Latest deploy log https://app.netlify.com/projects/home-assistant-docs/deploys/68642c314f7aa50008b85229
😎 Deploy Preview https://deploy-preview-39214--home-assistant-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

coderabbitai bot commented May 25, 2025

📝 Walkthrough

"""

Walkthrough

The 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 seventeentrack.get_packages action, along with an updated dashboard card example iterating over this template sensor's attributes.

Changes

File(s) Change Summary
source/_integrations/seventeentrack.markdown Replaced direct iteration example over "17track_in_transit" sensor packages with a new "Templates" section showing how to create a template sensor using seventeentrack.get_packages action and an updated dashboard card example using this sensor's package data attribute.

Assessment against linked issues

Objective Addressed Explanation
Restore or update documentation to reflect how to access package information after attribute data changes (#39202)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes detected.
"""


📜 Recent 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 e73b18a and 7760869.

📒 Files selected for processing (1)
  • source/_integrations/seventeentrack.markdown (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • source/_integrations/seventeentrack.markdown
⏰ 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

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: 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 the 17track_delivered sensor and aligns with the integration’s summary sensors.
Consider adding a brief note that users should replace 17track_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

📥 Commits

Reviewing files that changed from the base of the PR and between 45fd064 and bb7971e.

📒 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}}
Copy link
Member

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.

Copy link
Member

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a template section

@home-assistant home-assistant bot marked this pull request as draft May 26, 2025 10:46
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@davux
Copy link

davux commented May 26, 2025

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.

@shaiu shaiu marked this pull request as ready for review June 29, 2025 19:27
@home-assistant home-assistant bot requested a review from frenck June 29, 2025 19:27
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: 1

♻️ Duplicate comments (1)
source/_integrations/seventeentrack.markdown (1)

148-160: Repeat of earlier feedback – avoid dot-notation & Markdown card for single sensor

The example again relies on states.sensor.packages_data.attributes.packages, which is discouraged. Use state_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

📥 Commits

Reviewing files that changed from the base of the PR and between bb7971e and e73b18a.

📒 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)

Comment on lines +118 to +138
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'] }}"
```
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

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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
current This PR goes into the current branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package information no longer available
3 participants