Skip to content

Add target temp range to water heater #2720

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 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gjohansson-ST
Copy link
Member

@gjohansson-ST gjohansson-ST commented Jul 7, 2025

Proposed change

Adds target_temperature_range capability for water_heater
Core PR: home-assistant/core#148222

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features for which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Remove stale or deprecated documentation

Checklist

  • I have read and followed the documentation guidelines.
  • I have verified that my changes render correctly in the documentation.

Additional information

  • This PR fixes or closes issue: fixes #
  • Link to relevant existing code or pull request:

Summary by CodeRabbit

  • New Features

    • Announced support for setting a temperature range on water heater entities in Home Assistant Core 2025.8.
  • Documentation

    • Updated water heater documentation to include the new temperature range feature flag and clarified usage details.
    • Added a blog post explaining the new feature and providing implementation examples.

Copy link
Contributor

coderabbitai bot commented Jul 7, 2025

📝 Walkthrough

Walkthrough

A new blog post announces support for setting a temperature range in the WaterHeaterEntity of Home Assistant Core 2025.8. Documentation was updated to include the new TARGET_TEMPERATURE_RANGE feature flag, clarify the set_temperature method, and improve the formatting of the supported features table.

Changes

File(s) Change Summary
blog/2025-07-07-water-heater-now-supports-set-a-temp-range.md Added a blog post detailing support for setting a temperature range in WaterHeaterEntity.
docs/core/entity/water-heater.md Updated documentation to add TARGET_TEMPERATURE_RANGE, clarify set_temperature, and reformat table.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HomeAssistant
    participant WaterHeaterEntity

    User->>HomeAssistant: Set temperature range (min, max)
    HomeAssistant->>WaterHeaterEntity: async_set_temperature(min, max)
    WaterHeaterEntity->>WaterHeaterEntity: Set ATTR_TARGET_TEMP_LOW, ATTR_TARGET_TEMP_HIGH
    WaterHeaterEntity-->>HomeAssistant: Confirmation/State update
    HomeAssistant-->>User: Acknowledge/set new temperature range
Loading

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: 2

🧹 Nitpick comments (2)
docs/core/entity/water-heater.md (1)

62-62: Use imperative mood in method description

Microsoft style: start with the goal.
Change to “Set the temperature or temperature range the water heater heats water to.”

blog/2025-07-07-water-heater-now-supports-set-a-temp-range.md (1)

11-12: Grammar—plural agreement

“Entities needs to set” → “Entities need to set” (or “Entities must set” for stronger imperative).

📜 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 8de9ba5 and e86c6f9.

📒 Files selected for processing (2)
  • blog/2025-07-07-water-heater-now-supports-set-a-temp-range.md (1 hunks)
  • docs/core/entity/water-heater.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
`*/**(html|markdown|md)`: - For instructional content in documentation, use a di...

*/**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • blog/2025-07-07-water-heater-now-supports-set-a-temp-range.md
`*/**(html|markdown|md)`: - Use bold to mark UI strings. - If "" are used to mark UI strings, replace them by bold.

*/**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • blog/2025-07-07-water-heater-now-supports-set-a-temp-range.md
`*/**(html|markdown|md)`: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"

*/**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • blog/2025-07-07-water-heater-now-supports-set-a-temp-range.md
`*/**(html|markdown|md)`: - Use sentence-style capitalization also in headings.

*/**(html|markdown|md): - Use sentence-style capitalization also in headings.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • blog/2025-07-07-water-heater-now-supports-set-a-temp-range.md
`*/**(html|markdown|md)`: do not comment on HTML used for icons

*/**(html|markdown|md): do not comment on HTML used for icons

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • blog/2025-07-07-water-heater-now-supports-set-a-temp-range.md
`*/**(html|markdown|md)`: Avoid flagging inline HTML for embedding videos in future reviews for this repository.

*/**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • blog/2025-07-07-water-heater-now-supports-set-a-temp-range.md
🪛 markdownlint-cli2 (0.17.2)
docs/core/entity/water-heater.md

50-50: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


51-51: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


52-52: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


53-53: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


54-54: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


55-55: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


56-56: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - developers-home-assistant
  • GitHub Check: Header rules - developers-home-assistant
  • GitHub Check: Pages changed - developers-home-assistant

Comment on lines +50 to +56
| Value | Description |
| --------------------------- | ------------------------------ |
| `TARGET_TEMPERATURE` | Temperature can be set |
| `OPERATION_MODE` | Operation mode can be set |
| `AWAY_MODE` | Away mode can be set |
| `ON_OFF` | Can be turned on or off |
| `TARGET_TEMPERATURE_RANGE` | Temperature range can be set |
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 MD055 table-pipe violation

Trailing pipes break the markdown-lint rule and can cause inconsistent rendering. Drop the right-hand pipe on every row.

-| Value                       | Description                    |
-| --------------------------- | ------------------------------ |
-| `TARGET_TEMPERATURE`        | Temperature can be set         |
-| `OPERATION_MODE`            | Operation mode can be set      |
-| `AWAY_MODE`                 | Away mode can be set           |
-| `ON_OFF`                    | Can be turned on or off        |
-| `TARGET_TEMPERATURE_RANGE`  | Temperature range can be set   |
+| Value                       | Description                    |
+| --------------------------- | ------------------------------ |
+| `TARGET_TEMPERATURE`        | Temperature can be set         |
+| `OPERATION_MODE`            | Operation mode can be set      |
+| `AWAY_MODE`                 | Away mode can be set           |
+| `ON_OFF`                    | Can be turned on or off        |
+| `TARGET_TEMPERATURE_RANGE`  | Temperature range can be set   |

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

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

50-50: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


51-51: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


52-52: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


53-53: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


54-54: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


55-55: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)


56-56: Table pipe style
Expected: leading_only; Actual: leading_and_trailing; Unexpected trailing pipe

(MD055, table-pipe-style)

🤖 Prompt for AI Agents
In docs/core/entity/water-heater.md around lines 50 to 56, the markdown table
uses trailing pipes at the end of each row, which violates the MD055 lint rule.
Remove the trailing pipe character from the end of every row in the table to fix
the violation and ensure consistent rendering.

Comment on lines +25 to +29
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
min_temp = kwargs[ATTR_TARGET_TEMP_LOW]
max_temp = kwargs[ATTR_TARGET_TEMP_HIGH]
self.my_device.set_temperature(min_tenp, max_temp)
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

Code sample contains a typo and missing imports

min_tenp is undeclared; should be min_temp.
Also import Any, ATTR_TARGET_TEMP_LOW, and ATTR_TARGET_TEMP_HIGH to make the snippet copy-pasteable.

-from homeassistant.components.water_heater import WaterHeaterEntity, WaterHeaterEntityFeature
+from typing import Any
+from homeassistant.components.water_heater import (
+    WaterHeaterEntity,
+    WaterHeaterEntityFeature,
+)
+from homeassistant.components.water_heater.const import (
+    ATTR_TARGET_TEMP_LOW,
+    ATTR_TARGET_TEMP_HIGH,
+)

 ...
-        min_temp = kwargs[ATTR_TARGET_TEMP_LOW]
-        max_temp = kwargs[ATTR_TARGET_TEMP_HIGH]
-        self.my_device.set_temperature(min_tenp, max_temp)
+        min_temp = kwargs[ATTR_TARGET_TEMP_LOW]
+        max_temp = kwargs[ATTR_TARGET_TEMP_HIGH]
+        self.my_device.set_temperature(min_temp, max_temp)
📝 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
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
min_temp = kwargs[ATTR_TARGET_TEMP_LOW]
max_temp = kwargs[ATTR_TARGET_TEMP_HIGH]
self.my_device.set_temperature(min_tenp, max_temp)
from typing import Any
from homeassistant.components.water_heater import (
WaterHeaterEntity,
WaterHeaterEntityFeature,
)
from homeassistant.components.water_heater.const import (
ATTR_TARGET_TEMP_LOW,
ATTR_TARGET_TEMP_HIGH,
)
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
min_temp = kwargs[ATTR_TARGET_TEMP_LOW]
max_temp = kwargs[ATTR_TARGET_TEMP_HIGH]
self.my_device.set_temperature(min_temp, max_temp)
🤖 Prompt for AI Agents
In blog/2025-07-07-water-heater-now-supports-set-a-temp-range.md around lines 25
to 29, fix the typo by replacing the undeclared variable min_tenp with min_temp
in the call to set_temperature. Additionally, add import statements for Any,
ATTR_TARGET_TEMP_LOW, and ATTR_TARGET_TEMP_HIGH at the top of the file to ensure
these identifiers are defined and the code snippet is fully functional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant