Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bdraco
Copy link
Member

@bdraco bdraco commented Oct 23, 2025

What does this implement/fix?

Update climate entity container types in api.proto
for esphome/esphome#11466

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable):

  • fixes

Pull request in esphome (if applicable):

  • esphome/esphome#

Checklist:

  • The code change is tested and works locally.
  • If api.proto was modified, a linked pull request has been made to esphome with the same changes.
  • Tests have been added to verify that the new code works (under tests/ folder).

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (208ff61) to head (b7ea685).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1405   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         3310      3310           
=========================================
  Hits          3310      3310           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 23, 2025

CodSpeed Performance Report

Merging #1405 will not alter performance

Comparing container_types (b7ea685) with main (208ff61)1

Summary

✅ 11 untouched

Footnotes

  1. No successful run was found on main (1f40496) during the generation of this report, so 208ff61 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@bdraco bdraco merged commit b17500c into main Oct 23, 2025
12 of 13 checks passed
@bdraco bdraco deleted the container_types branch October 23, 2025 02:24
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 23, 2025

Walkthrough

The ListEntitiesClimateResponse message in the protobuf definition is modified to change container type annotations for climate-related fields. Supported mode fields transition from std::set containers with template parameters to bitmask types, while custom mode/preset fields transition from std::set to std::vector.

Changes

Cohort / File(s) Summary
Protobuf Climate Response Updates
aioesphomeapi/api.proto
Updated ListEntitiesClimateResponse message: replaced std::set container pointers with bitmask types for supported_modes, supported_fan_modes, supported_swing_modes, and supported_presets; converted std::set to std::vector for supported_custom_fan_modes and supported_custom_presets

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

The changes follow a consistent, homogeneous pattern across six fields within a single message definition. All modifications are annotation-level updates with no complex logic or branching, making them straightforward to verify for correctness and consistency.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "Update climate entity container types in api.proto" is fully related to and clearly summarizes the main change in the changeset. The title directly identifies the primary modification: updating container types for climate entity fields in the api.proto file, which matches the detailed changes to ListEntitiesClimateResponse (switching from std::set-based containers to ClimateModeMask and ClimatePresetMask types, and std::vector for custom modes). The title is concise, specific, and avoids vague terminology.
Description Check ✅ Passed The pull request description is related to the changeset, providing context that this update aligns with corresponding changes in the esphome repository (esphome/esphome#11466). While the description is relatively minimal and mostly repeats the title rather than elaborating on the specific technical changes, it clearly indicates the purpose (code quality improvements) and documents that the change is intentional and tied to upstream work. This satisfies the lenient pass criteria requiring only that the description be related in some way to the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch container_types

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🧹 Nitpick comments (1)
aioesphomeapi/api.proto (1)

992-1005: Add tests for container type changes.

The PR checklist indicates testing is unchecked. Container type changes affect serialization, deserialization, and memory layout. Add unit or integration tests that verify:

  1. Messages with the new mask types and vector containers serialize/deserialize correctly.
  2. Round-trip serialization preserves data (e.g., all supported modes round-trip faithfully).
  3. Interoperability with esphome's implementation (if applicable).
  4. No performance regressions from the container type changes.

Do you want guidance on what test coverage should look like for protobuf message container changes, or would you prefer to defer this to the esphome PR review?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f40496 and b7ea685.

📒 Files selected for processing (1)
  • aioesphomeapi/api.proto (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

  • Do not generate or add any sequence diagrams

Files:

  • aioesphomeapi/api.proto
⏰ 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). (1)
  • GitHub Check: py 3.11 on ubuntu-latest (use_cython)
🔇 Additional comments (2)
aioesphomeapi/api.proto (2)

992-1005: Verify esphome PR coordination and mask type definitions.

This PR introduces container type changes that depend on corresponding C++ codegen and mask type definitions in the esphome repository. The PR objectives note that linking the esphome PR is an unchecked checklist item.

  1. Confirm the esphome PR exists and has been merged or is in review.
  2. Verify that mask type definitions (climate::ClimateModeMask, climate::ClimateFanModeMask, climate::ClimateSwingModeMask, climate::ClimatePresetMask) are properly defined and handled in esphome's C++ code.
  3. Ensure esphome's protobuf code generator correctly handles the container_pointer_no_template annotation for these mask types.

Without these coordinated changes, the generated C++ code may fail to compile or serialize/deserialize messages incorrectly.


1003-1003: Clarify data structure contract change for custom modes and presets.

Lines 1003 and 1005 transition supported_custom_fan_modes and supported_custom_presets from std::set (unordered, unique elements) to std::vector (ordered, allows duplicates). This semantic change affects:

  • Uniqueness: Sets guarantee no duplicates; vectors do not.
  • Order: Vectors preserve insertion order; sets do not.
  • API contracts: Callers expecting a set of unique values may encounter duplicates.

Confirm this change is intentional. If the goal is to preserve order and allow duplicates, document this in the message comment. If this is unintended, revert to std::set for these fields.

Also applies to: 1005-1005

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants