-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughA new blog post announces support for setting a temperature range in the Changes
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
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: 2
🧹 Nitpick comments (2)
docs/core/entity/water-heater.md (1)
62-62
: Use imperative mood in method descriptionMicrosoft 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
📒 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
| 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 | |
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.
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.
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) |
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.
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.
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.
Proposed change
Adds
target_temperature_range
capability forwater_heater
Core PR: home-assistant/core#148222
Type of change
Checklist
Additional information
Summary by CodeRabbit
New Features
Documentation