esphome-docs icon indicating copy to clipboard operation
esphome-docs copied to clipboard

Update time and temperature cookbook

Open yincrash opened this issue 8 months ago • 4 comments

Description:

Use a temperature that comes with the default Home Assistant setup - weather Show how to use google fonts so a user doesn't have to setup font files to get something running.

Checklist:

  • [ ] I am merging into next because this is new documentation that has a matching pull-request in esphome as linked above.
    or

  • [x] I am merging into current because this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.

  • [ ] Link added in /components/index.rst when creating new documents for new components or cookbook.

yincrash avatar Mar 31 '25 06:03 yincrash

I'm a new ESPHome user and definitely really love the cookbooks, but I wanted to get something up and running as fast as possible to see what I could do, and so I thought a few changes to this cookbook would make it simpler for a new user who may not have a temperature sensor set up, but could get something showing up immediately.

yincrash avatar Mar 31 '25 06:03 yincrash

## Walkthrough
The update modifies the sensor configuration and font definitions in the documentation. It changes the temperature sensor setup to import a single weather forecast (providing both temperature and unit details) instead of two separate sensors, and adds a new text sensor for the temperature unit. Additionally, generic font identifiers have been updated to descriptive names, and new Google font entries have been introduced with specified file paths and sizes. The display output text has also been updated accordingly.

## Changes

| File(s)                                                       | Change Summary                                                                                                                                                                                                                                                                                                              |
|---------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cookbook/...display_time_temp_oled.rst` (sensors & display)  | Updated sensor configuration: Changed `inside_temperature` and `outside_temperature` sensors to use `entity_id: REPLACEME` with `internal: true`; added new internal text sensor `outside_temperature_unit` from weather forecast attribute. Modified display output text from "Mitt Smarta Hus" to "Time and Temperature" with updated formatting for inside and outside temperatures including unit. |
| `cookbook/...display_time_temp_oled.rst` (fonts)              | Renamed font identifiers from `font1`, `font2`, `font3` to `small`, `medium`, `large`. Added optional Google font entries (`gfonts://Silkscreen`, `gfonts://Roboto`) with specified sizes and file paths.                                                                                                                    |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant HA as Home Assistant
    participant Sensor as Sensor Module
    participant Display as OLED Display Logic

    HA->>Sensor: Provide weather.forecast_home data
    Sensor->>Display: Relay temperature and unit data
    Display->>Display: Format data using updated fonts ("medium" for inside, descriptive font for outside)
    Display->>User: Render "Time and Temperature" output

Suggested reviewers

  • nagyrobi

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 18bde38e63190a2988e0856d0e15ba71f3b64b0a and 1113071837645b0eab8becaeea35f24f8de16f6f.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `cookbook/display_time_temp_oled.rst` (6 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* cookbook/display_time_temp_oled.rst

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAVW5aag9xNnQMehpmbmVcbH8FfABrAXwi6MgAdzRkBwFmdRp6OTDYD2xESkhZeAwGKkRYNPpUeCUMcQAzeCjqyAxHAU6AFgB2AA4AZg0YVshsBKTICfwGdul+LHgsinwJHqIWjwBRAGUrAAkWD1oTx3ZqeD4LD+LxJDL4MJXDyYDIkLI5PIeCbYXriIFoLzqaaIbbuSCFEjyBiwTCkZA9BhebBKPaIe7oMJw7JUXL5RD4PIMZIk0KobjOUL4CaPSBKCZobyhT6pACCiDpiFwmFCHVy3AANPZsgx4FMGBivPJcLsKiRqK0+EwskD2JqCJBWl5uLTKMgKrAIcw0PIMPhQiSpAylLR4PrGoz4SzEfYyOzLUCpkREbRtjLaCG0RgDbI7bt9okaDwbnclOSMIqKNgxIDyxcHfgKmEIWdIABxUpESKQABiQNwiE1ZBUmIwDzOFGQ9qu3EibHGRz7bvU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ZEXE+dAjd32TplivDAiZMUDc5bJpgwvPhAyUJyAGmAvafGSmgi1B9ll1uUZp1ilMvnPspqSZoWDMYiM1F0zUBvm8kerqaYv5gUMoE6qpFkBPPUoNHS1VGL5tYoZfAJlKLVW4rWwRKtbKcvYuyx0dzGAzMjfed5bEiWrNSplamsxQ7lWqpynlF48AvBaT6OuDAdX6AvcXOqmwgg/T4HIiVh6XTFu0pRRtrbDr9vOGrUd1VRWayyPkd/LB7D/6duFEQ1R4Crq9QoRJahA1nDyCQYoZQTD0GsJxzgia6hVOIAEf4JKKV8vL0wYYAwzP1gTARQABgAGxLCWIsFYaK1hovTGitAIvRcIoEBsWgaL1gkARSQNYaxaAMHFAIcUfOBd/0gCsAAnEsEXauxci4AKxO+15bhFquNgrH1JbjYCK1grG1xsDYAgVgItoL7hgcuVim+ZxMBgIuRdoodzbjYaK0VLDWGLtFEw0UIoYEsBFSwNiW9oCsB3CKNhy9oEsa3DuJiqEt9H83IuPdi8D5ny38uEVoDbwwB3GwlfrAd/qBgYuHdi5lyQEXNuO8h8bxASAvvjUkAryQVvCLLci7QGiy3evJ9rDH7QEX2uHcxxDxMIPEuBCb7n1AN35eRch82CsCXJ+j8qDWIsfU65u+17TxMfX2uYuEwQBpuZu8+kCrOow7OnO0w3OACfOQAA=== -->

<!-- internal state end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=esphome/esphome-docs&utm_content=4783):

- 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](https://www.coderabbit.ai/contact-us/support) 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](https://docs.coderabbit.ai/finishing-touches/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` 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

coderabbitai[bot] avatar Mar 31 '25 06:03 coderabbitai[bot]

Deploy Preview for esphome ready!

Name Link
Latest commit 1113071837645b0eab8becaeea35f24f8de16f6f
Latest deploy log https://app.netlify.com/projects/esphome/deploys/685ca4e2ec9ae10008fff30e
Deploy Preview https://deploy-preview-4783--esphome.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.

netlify[bot] avatar Mar 31 '25 06:03 netlify[bot]

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

Learn more about our pull request process.

esphome[bot] avatar May 28 '25 21:05 esphome[bot]