Skip to content

Add oven controls (number, select, button) to Whirlpool#173326

Closed
bdlcalvin wants to merge 22 commits into
home-assistant:devfrom
bdlcalvin:whirlpool-oven-climate
Closed

Add oven controls (number, select, button) to Whirlpool#173326
bdlcalvin wants to merge 22 commits into
home-assistant:devfrom
bdlcalvin:whirlpool-oven-climate

Conversation

@bdlcalvin

@bdlcalvin bdlcalvin commented Jun 9, 2026

Copy link
Copy Markdown

Proposed change

Adds oven controls to the Whirlpool integration. Per review feedback (thanks @joostlek), this no longer uses a climate entity — instead, following the SmartThings/Miele pattern, oven cavities get:

  • a number for the target temperature (settable),
  • a select for the cook mode (Bake / Convection bake / Broil / …),
  • a button to stop the current cook,
  • alongside the existing current temperature and state sensors.

The redundant read-only target-temperature and cook-mode sensors are removed, since the number/select now cover them. One entity set per cavity (single, or upper + lower).

The Whirlpool API couples target temp + mode into one set_cook call, so the number sends the temp with the current mode, the select sends the mode with the current/last temp, and the button issues stop_cook.

Type of change

  • New feature

Additional information

Replaces the earlier climate-based approach in this same PR. Snapshots are being regenerated; CI may be briefly red on snapshots until that commit lands.

Copilot AI review requested due to automatic review settings June 9, 2026 00:59

@home-assistant home-assistant Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @bdlcalvin

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant

home-assistant Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Hey there @abmantis, @mkmer, mind taking a look at this pull request as it has been labeled with an integration (whirlpool) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of whirlpool can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign whirlpool Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds oven climate entity support to the Whirlpool integration, allowing oven cavities to be controlled via the Home Assistant climate platform with temperature control, cook mode presets, and on/off functionality.

Changes:

  • Adds OvenEntity class to climate.py that represents oven cavities as climate entities with HVAC modes (OFF/HEAT), preset modes for cook modes, and temperature control.
  • Adds translation strings in strings.json for oven climate entity preset modes (bake, broil, air fry, etc.) for single and dual cavity ovens.
  • Adds comprehensive tests for the new oven climate entities covering dynamic attributes, temperature setting, preset modes, on/off, and error handling.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
homeassistant/components/whirlpool/climate.py Adds OvenEntity class with cook mode mappings, temperature config, and HVAC/preset/temp control methods
homeassistant/components/whirlpool/strings.json Adds translation keys for oven climate preset modes (single + dual cavity)
tests/components/whirlpool/test_climate.py Adds parametrized tests for oven climate entity attributes, services, and error handling

Comment on lines +243 to +247
def hvac_action(self) -> HVACAction:
"""Return the current action."""
if self._appliance.get_cavity_state(self.cavity) in OVEN_ACTIVE_STATES:
return HVACAction.HEATING
return HVACAction.OFF
Comment on lines +556 to +573
async def test_oven_service_request_failure(
hass: HomeAssistant,
oven_climate_entity: tuple[str, str, "whirlpool.oven.Cavity"],
request: pytest.FixtureRequest,
) -> None:
"""Test a failed oven request raises HomeAssistantError."""
entity_id, mock_fixture, _ = oven_climate_entity
mock = request.getfixturevalue(mock_fixture)
mock.set_cook.return_value = False
await init_integration(hass)

with pytest.raises(HomeAssistantError):
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{ATTR_ENTITY_ID: entity_id, ATTR_TEMPERATURE: 220},
blocking=True,
)
Copilot AI review requested due to automatic review settings June 9, 2026 01:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment on lines +452 to +454
mock.get_cavity_state.return_value = whirlpool.oven.CavityState.Cooking
await trigger_attr_callback(hass, mock)
assert hass.states.get(entity_id).state == HVACMode.HEAT
Copilot AI review requested due to automatic review settings June 9, 2026 11:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@joostlek joostlek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So we have discussed this with other integrations before like smartthings and miele, but while these devices provide good data points for climate entities, we actually don't want them to have as climate entities. Reason for this is that climate entities are meant to control the climate of a room/area. This will lead to weird behaviors like for example asking voice to turn the temperature in the kitchen to 20 degrees, and then the oven suddenly turns to 20 degrees. Instead, having separate number and sensor entities would work better and give a more consistent experience

Copilot AI review requested due to automatic review settings June 9, 2026 12:01
@bdlcalvin bdlcalvin changed the title Add oven climate entity to Whirlpool Add oven controls (number, select, button) to Whirlpool Jun 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Comment on lines 22 to 23
Comment on lines +198 to +200
'aliases': list([
None,
]),
Comment on lines +49 to +60
"climate": {
"oven": {
"state_attributes": {
"preset_mode": {
"state": {
"air_fry": "[%key:component::whirlpool::entity::sensor::oven_cook_mode::state::air_fry%]",
"bake": "[%key:component::whirlpool::entity::sensor::oven_cook_mode::state::bake%]",
"broil": "[%key:component::whirlpool::entity::sensor::oven_cook_mode::state::broil%]",
"convection_bake": "[%key:component::whirlpool::entity::sensor::oven_cook_mode::state::convection_bake%]",
"convection_broil": "[%key:component::whirlpool::entity::sensor::oven_cook_mode::state::convection_broil%]",
"convection_roast": "[%key:component::whirlpool::entity::sensor::oven_cook_mode::state::convection_roast%]",
"keep_warm": "[%key:component::whirlpool::entity::sensor::oven_cook_mode::state::keep_warm%]"
@gjohansson-ST

Copy link
Copy Markdown
Member

You should break it out to one platform per PR

@joostlek joostlek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please make sure we keep the PR well scoped. I think a PR per platform would fit the best

Copilot AI review requested due to automatic review settings June 9, 2026 21:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Comment on lines +64 to +66
await self._appliance.set_cook(
target_temp=value, mode=mode, cavity=self.cavity
)
Comment on lines +152 to +160
await hass.services.async_call(
SELECT_DOMAIN,
SERVICE_SELECT_OPTION,
{ATTR_ENTITY_ID: entity_id, ATTR_OPTION: "broil"},
blocking=True,
)
mock.set_cook.assert_called_once_with(
target_temp=200, mode=whirlpool.oven.CookMode.Broil, cavity=cavity
)
Comment on lines +82 to +90
await hass.services.async_call(
NUMBER_DOMAIN,
SERVICE_SET_VALUE,
{ATTR_ENTITY_ID: entity_id, ATTR_VALUE: 220},
blocking=True,
)
mock.set_cook.assert_called_once_with(
target_temp=220, mode=whirlpool.oven.CookMode.Bake, cavity=cavity
)
@bdlcalvin

Copy link
Copy Markdown
Author

Splitting this into one PR per platform as requested:

Closing this combined PR in favor of those. Thanks for the reviews!

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.

5 participants