Skip to content
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

Picture cards: add image from UI #33096

Merged
merged 1 commit into from
Jun 5, 2024
Merged

Conversation

c0ffeeca7
Copy link
Contributor

@c0ffeeca7 c0ffeeca7 commented Jun 5, 2024

Proposed change

Picture cards: add image from UI

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 others were 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 instructions to focus on adding pictures to cards in the dashboard sections.
    • Added a new guide for adding a picture to a dashboard, detailing image upload and configuration steps.

@home-assistant home-assistant bot added has-parent This PR has a parent PR in a other repo next This PR goes into the next branch labels Jun 5, 2024
Copy link
Contributor

coderabbitai bot commented Jun 5, 2024

Walkthrough

Walkthrough

The recent changes involve updating the Home Assistant dashboard documentation to shift the focus from editing dashboards to adding pictures to cards. This is achieved by replacing the inclusion of edit_dashboard.md with add_picture_to_card.md in multiple markdown files. Additionally, a new file, add_picture_to_card.md, has been introduced to provide detailed instructions on how to add images to dashboards.

Changes

Files Change Summary
source/_dashboards/picture-entity.markdown, picture-glance.markdown, picture.markdown Replaced {% include dashboard/edit_dashboard.md %} with {% include dashboard/add_picture_to_card.md %} to shift focus to adding pictures.
source/_includes/dashboard/add_picture_to_card.md New file providing detailed instructions on adding images to Home Assistant dashboards.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant MarkdownFile
    participant IncludeDirective
    participant AddPictureToCard

    User->>MarkdownFile: Open picture-entity.markdown
    MarkdownFile->>IncludeDirective: Replace edit_dashboard.md with add_picture_to_card.md
    IncludeDirective->>AddPictureToCard: Include add_picture_to_card.md content
    AddPictureToCard-->>User: Display instructions for adding pictures to cards
Loading

Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 7a26df6 and c757af7.

Files selected for processing (4)
  • source/_dashboards/picture-entity.markdown (1 hunks)
  • source/_dashboards/picture-glance.markdown (1 hunks)
  • source/_dashboards/picture.markdown (1 hunks)
  • source/_includes/dashboard/add_picture_to_card.md (1 hunks)
Additional context used
LanguageTool
source/_includes/dashboard/add_picture_to_card.md

[uncategorized] ~1-~1: If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD)
Context: ... name %}{{ include.name | default: page.title }}{% endcapture %} {% capture domain %}...


[misspelling] ~1-~1: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...include.name | default: page.title }}{% endcapture %} {% capture domain %}{{ include.domai...


[uncategorized] ~2-~2: If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD)
Context: ...pture %} {% capture domain %}{{ include.domain | default: page.ha_domain }}{% endcaptu...


[misspelling] ~2-~2: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...e.domain | default: page.ha_domain }}{% endcapture %} {% capture title %}{{ include.title ...


[uncategorized] ~3-~3: If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD)
Context: ...apture %} {% capture title %}{{ include.title | default: page.title }}{% endcapture %...


[uncategorized] ~3-~3: If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD)
Context: ...itle %}{{ include.title | default: page.title }}{% endcapture %} ## Adding a {{ titl...


[misspelling] ~3-~3: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...nclude.title | default: page.title }}{% endcapture %} ## Adding a {{ title | downcase }} ...


[misspelling] ~5-~5: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...% endcapture %} ## Adding a {{ title | downcase }} to your dashboard 1. To add a card,...


[misspelling] ~8-~8: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ... the By card tab, select {{ title | downcase }}. 2. Add a picture: - **Upload p...


[misspelling] ~13-~13: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ... stored on Home Assistant. For example: `/homeassistant/images/lights_view_background_image.jpg...


[misspelling] ~14-~14: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ..., you need to configure access to files, for exam...


[misspelling] ~14-~14: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...access-to-files), for example via Samba...


[misspelling] ~14-~14: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...samba-add-on) or the [Studio Code Server](/common-tasks/os/#installing-and-using-the-visual-studio...


[typographical] ~15-~15: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...-studio-code-vsc-add-on) add-on. - web URL let you use an image from the web...


[typographical] ~15-~15: After the expression ‘for example’ a comma is usually used. (COMMA_FOR_EXAMPLE)
Context: ... let you use an image from the web. For example `https://www.home-assistant.io/images/f...


[misspelling] ~17-~17: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...ers that are specific to the {{ title | downcase }}. - For a description of the speci...

source/_dashboards/picture.markdown

[uncategorized] ~35-~35: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ... to store images in your Home Assistant installation use the [hosting files documentation](/...


[misspelling] ~35-~35: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...ion use the hosting files documentation. After storing your fil...


[typographical] ~40-~40: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...uidance for writing alternative text. type: string theme: required: false desc...


[typographical] ~44-~44: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...umentation](/integrations/frontend/). type: string tap_action: required: false ...


[typographical] ~48-~48: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...on](/dashboards/actions/#tap-action). type: map hold_action: required: false d...


[typographical] ~52-~52: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...n](/dashboards/actions/#hold-action). type: map double_tap_action: required: fal...


[typographical] ~56-~56: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...shboards/actions/#double-tap-action). type: map {% endconfiguration %} ### Exampl...


[misspelling] ~57-~57: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...ons/#double-tap-action). type: map {% endconfiguration %} ### Examples Navigate to another v...


[misspelling] ~71-~71: The verb ‘set up’ is spelled as two words. The noun ‘setup’ is spelled as one. (SETUP_VERB)
Context: ...ws](/dashboards/views/) setup on how to setup custom IDs. Toggle entity using a serv...

source/_dashboards/picture-entity.markdown

[misspelling] ~48-~48: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...use a locally hosted image, see Hosting. type: string state_im...


[typographical] ~49-~49: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...g](/integrations/http#hosting-files). type: string state_image: required: false ...


[non-conformance] ~64-~64: Please check whether ‘full’ might be the correct word here instead of ‘fill’. (CONFUSION_RULE_FILL_FULL)
Context: ...ized to fit within the given dimension. fill: The image is resized to fill the give...


[typographical] ~70-~70: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ... description: Overwrite entity name. type: string show_name: required: false ...


[typographical] ~74-~74: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ... description: Shows name in footer. type: boolean default: true show_state: ...


[typographical] ~79-~79: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ... description: Shows state in footer. type: boolean default: true theme: requi...


[typographical] ~84-~84: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...umentation](/integrations/frontend/). type: string tap_action: required: false ...


[typographical] ~88-~88: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...on](/dashboards/actions/#tap-action). type: map hold_action: required: false d...


[typographical] ~92-~92: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...n](/dashboards/actions/#hold-action). type: map double_tap_action: required: fal...


[typographical] ~96-~96: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...shboards/actions/#double-tap-action). type: map {% endconfiguration %} ### How to...


[misspelling] ~97-~97: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...ons/#double-tap-action). type: map {% endconfiguration %} ### How to use state_filter Specif...


[misspelling] ~145-~145: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...time("%Y-%m-%d-%H%M%S") }}.jpg' ``` {% endraw %} The filename needs to be a path tha...


[misspelling] ~147-~147: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ... your system. You may need to configure allowlist_external_dirs ([documentation](/integrations/homeass...


[misspelling] ~147-~147: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...allowlist_external_dirs` (documentation).

Markdownlint
source/_dashboards/picture-entity.markdown

149-149: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines

source/_dashboards/picture-glance.markdown

227-227: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines

Additional comments not posted (5)
source/_includes/dashboard/add_picture_to_card.md (2)

1-3: The template variable declarations and their usage are correctly implemented.

Tools
LanguageTool

[uncategorized] ~1-~1: If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD)
Context: ... name %}{{ include.name | default: page.title }}{% endcapture %} {% capture domain %}...


[misspelling] ~1-~1: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...include.name | default: page.title }}{% endcapture %} {% capture domain %}{{ include.domai...


[uncategorized] ~2-~2: If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD)
Context: ...pture %} {% capture domain %}{{ include.domain | default: page.ha_domain }}{% endcaptu...


[misspelling] ~2-~2: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...e.domain | default: page.ha_domain }}{% endcapture %} {% capture title %}{{ include.title ...


[uncategorized] ~3-~3: If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD)
Context: ...apture %} {% capture title %}{{ include.title | default: page.title }}{% endcapture %...


[uncategorized] ~3-~3: If a new sentence starts here, add a space and start with an uppercase letter. (LC_AFTER_PERIOD)
Context: ...itle %}{{ include.title | default: page.title }}{% endcapture %} ## Adding a {{ titl...


[misspelling] ~3-~3: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...nclude.title | default: page.title }}{% endcapture %} ## Adding a {{ title | downcase }} ...


14-14: The links to additional resources and configurations are well-integrated and correctly formatted.

Tools
LanguageTool

[misspelling] ~14-~14: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ..., you need to configure access to files, for exam...


[misspelling] ~14-~14: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...access-to-files), for example via Samba...


[misspelling] ~14-~14: Possible spelling mistake found. (MORFOLOGIK_RULE_EN_US)
Context: ...samba-add-on) or the [Studio Code Server](/common-tasks/os/#installing-and-using-the-visual-studio...

source/_dashboards/picture.markdown (1)

22-22: The integration of add_picture_to_card.md into the picture card documentation is correctly implemented.

source/_dashboards/picture-entity.markdown (1)

22-22: The integration of add_picture_to_card.md into the picture entity card documentation is correctly implemented.

source/_dashboards/picture-glance.markdown (1)

22-22: The integration of add_picture_to_card.md into the picture glance card documentation is correctly implemented.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@c0ffeeca7 c0ffeeca7 added the parent-merged The parent PR has been merged already label Jun 5, 2024
@c0ffeeca7 c0ffeeca7 added this to the 2024.6 milestone Jun 5, 2024
Copy link

netlify bot commented Jun 5, 2024

Deploy Preview for home-assistant-docs ready!

Name Link
🔨 Latest commit c757af7
🔍 Latest deploy log https://app.netlify.com/sites/home-assistant-docs/deploys/666083ade26f1c000820d0f6
😎 Deploy Preview https://deploy-preview-33096--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 site configuration.

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @c0ffeeca7 👍

../Frenck

@frenck frenck merged commit 60eded2 into next Jun 5, 2024
8 checks passed
@frenck frenck deleted the picture-cards-add-image-from-ui branch June 5, 2024 15:33
@home-assistant home-assistant bot removed the parent-merged The parent PR has been merged already label Jun 5, 2024
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

- **Upload picture** lets you pick an image from the system used to show your Home Assistant UI.
- **Local path** lets you pick an image stored on Home Assistant. For example: `/homeassistant/images/lights_view_background_image.jpg`.
- To store an image on Home Assistant, you need to [configure access to files](/common-tasks/os/#configuring-access-to-files), for example via [Samba](/common-tasks/os/#installing-and-using-the-samba-add-on) or the [Studio Code Server](/common-tasks/os/#installing-and-using-the-visual-studio-code-vsc-add-on) add-on.
- **web URL** let you use an image from the web. For example `https://www.home-assistant.io/images/frontpage/assist_wake_word.png`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider starting the sentence with an uppercase letter and correcting the grammar: "Web URL lets you use an image from the web."

-   - **web URL** let you use an image from the web. For example `https://www.home-assistant.io/images/frontpage/assist_wake_word.png`.
+   - **Web URL** lets you use an image from the web. For example: `https://www.home-assistant.io/images/frontpage/assist_wake_word.png`.
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.

Suggested change
- **web URL** let you use an image from the web. For example `https://www.home-assistant.io/images/frontpage/assist_wake_word.png`.
- **Web URL** lets you use an image from the web. For example: `https://www.home-assistant.io/images/frontpage/assist_wake_word.png`.
Tools
LanguageTool

[typographical] ~15-~15: This sentence does not start with an uppercase letter. (UPPERCASE_SENTENCE_START)
Context: ...-studio-code-vsc-add-on) add-on. - web URL let you use an image from the web...


[typographical] ~15-~15: After the expression ‘for example’ a comma is usually used. (COMMA_FOR_EXAMPLE)
Context: ... let you use an image from the web. For example `https://www.home-assistant.io/images/f...

@frenck frenck added the cherry-picked This PR has been manually picked and merged into the current branch label Jun 5, 2024
frenck pushed a commit that referenced this pull request Jun 5, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cherry-picked This PR has been manually picked and merged into the current branch has-parent This PR has a parent PR in a other repo next This PR goes into the next branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants