Report read-only climate entities as such to Google Assistant by RReverser · Pull Request #183820 · home-assistant/core · GitHub
Skip to content

Report read-only climate entities as such to Google Assistant - #183820

Merged
frenck merged 2 commits into
home-assistant:devfrom
RReverser:google-assistant-query-only-climate
Oct 5, 2026
Merged

frenck merged 2 commits into
home-assistant:devfrom
RReverser:google-assistant-query-only-climate

Conversation

@RReverser

@RReverser RReverser commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Breaking change

Proposed change

PR #173033 introduced template climate entities, which have no temperature control unless a set_temperature action is configured. Today, they would show up in Google Home as controllable thermostats, and any change made there would fail.

This PR fixes that by setting queryOnlyTemperatureSetting on climate entities that support neither TARGET_TEMPERATURE nor TARGET_TEMPERATURE_RANGE and have at most one HVAC mode, so there is nothing for Google to control. Entities with two or more modes stay controllable, since TemperatureSettingTrait also switches modes.

The fallback heat mode for entities without modes exists only so Google allows setting a temperature, so it is no longer added to entities without a setpoint.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally. (partly; I don't have HA beta installed yet so didn't test with an actual climate template sensor)
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copilot AI balanced review requested due to automatic review settings October 1, 2026 00:08
@home-assistant

home-assistant Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

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.

Copilot review overview

🟡 Changes recommended

The no-mode path emits an invalid empty mode list, and the PR description omits required template entries.

Review effort: Balanced
Findings: 2 High severity

Open (2)
What changed in this PR

Reports read-only climate entities correctly to Google Assistant.

Changes:

  • Adds query-only detection based on setpoint and mode capabilities.
  • Adds coverage for controllable and query-only climates.
File Description
homeassistant/​components/​google_assistant/​trait.py Adds query-only climate reporting.
tests/​components/​google_assistant/​test_trait.py Tests query-only behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread homeassistant/components/google_assistant/trait.py
Comment thread tests/components/google_assistant/test_trait.py Outdated
@RReverser RReverser closed this Oct 1, 2026
@RReverser RReverser reopened this Oct 1, 2026
PR home-assistant#173033 introduced template climate entities, which have no
temperature control unless a `set_temperature` action is configured.
Today, those with at most one HVAC mode would show up in Google Home as
controllable thermostats, and any change made there would fail.

This PR fixes that by setting `queryOnlyTemperatureSetting` on climate
entities that support neither `TARGET_TEMPERATURE` nor
`TARGET_TEMPERATURE_RANGE` and have at most one HVAC mode, so there is
nothing for Google to control. Entities with two or more modes stay
controllable, since `TemperatureSettingTrait` also switches modes.

The fallback `heat` mode for entities without modes exists only so
Google allows setting a temperature, so it is no longer added to
entities without a setpoint.

home-assistant#173033
https://developers.home.google.com/cloud-to-cloud/traits/temperaturesetting
@RReverser
RReverser force-pushed the google-assistant-query-only-climate branch from 62fd69c to 1f6afbd Compare October 1, 2026 10:10
@RReverser
RReverser requested a balanced review from Copilot October 1, 2026 10:11

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.

Copilot review overview

🟡 Changes recommended

The PR template fields must be restored and the conditional test assertion should be parameterized.

Review effort: Balanced
Findings: 2 Low severity

Open (2)
Resolved since last review (2)

Comment thread homeassistant/components/google_assistant/trait.py
Comment thread tests/components/google_assistant/test_trait.py Outdated
Copilot AI balanced review requested due to automatic review settings October 1, 2026 10:31

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.

Copilot review overview

🟢 Approval recommended

The implementation matches the stated behavior and includes focused regression coverage.

Review effort: Balanced
Findings: None

Resolved since last review (2)

@frenck frenck 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.

Oh hi there @RReverser 👋

My review notes: (this space intentionally left blank). Thanks for the pull request!

By the way, congratulations on your first contribution to Home Assistant! Welcome aboard 🎉

../Frenck

                       

Blogging my personal ramblings at frenck.dev

Here is a picture of a dog for you:

A picture of a dog

@frenck
frenck merged commit e3b7f74 into home-assistant:dev Oct 5, 2026
54 checks passed
@frenck frenck added this to the 2026.10.0 milestone Oct 5, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants