Skip to content

Fix Gate Fan Lint Findings and Give CeilSense Per-Device Builds - #280

Merged
ptr727 merged 2 commits into
developfrom
fix/compile-warnings-sweep
Oct 30, 2026
Merged

ptr727 merged 2 commits into
developfrom
fix/compile-warnings-sweep

Conversation

@ptr727

@ptr727 ptr727 commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

A clean compile of every production and test config, linted with tools/compile-lint, turned up two problems that CI cannot see.

  • garage-gate-fan-controller.yaml: three -Wdouble-promotion findings, in the water and gas meter conversions and the display's temperature printf. CI compiles only test/, so this production-only code was never linted. The constants take an f suffix and the printf argument a static_cast<double>(). The water conversion also moves from 264.2 to the exact 264.172 gallons per cubic meter, which raises the published total by about 0.01% and never lowers it, so Home Assistant's total_increasing sensor reads no reset.
  • templates/smarthome-ceilsense.yaml: the vendor's base.yaml sets build_path: build/ceilsense, so every CeilSense config shares one build tree. Compiling one overwrites another, and a serial upload flashes whichever firmware.factory.bin was built last. The template now removes build_path, so each device builds under its own name.

Verified on ptr727/esphome-nonroot:2026.10.1 from clean build trees: the gate fan config lints with zero findings, and garage-presence-sensor.yaml and test/smarthome-ceilsense.yaml compile under /cache/build/garage-presence-sensor and /cache/build/smarthome-ceilsense-test.

The CI and lint gaps behind this, production configs not compiled and ESPHome WARNING lines not checked, are #281.

Pre-existing findings, not filed:

  • archive/utility-pulse-counter.yaml:103 divides by the same inexact 264.2, pre-existing. The archive is retired and neither deployed nor compiled.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved precision when converting water and gas usage into cubic meters.
    • Updated temperature value formatting to use explicit numeric conversion, helping ensure consistent display.
  • Build Behavior

    • CeilSense builds now use ESPHome’s default build-path behavior instead of a fixed vendor-specific path.

- Add float suffixes to the gate fan's meter conversions and cast the display temperature to double for printf, clearing three -Wdouble-promotion findings that CI never saw because it does not compile production configs.
- Remove the CeilSense vendor build_path, which put every CeilSense config in one build/ceilsense tree, so a bare upload could flash another config's firmware.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 30, 2026 01:52
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Walkthrough

The garage-gate fan configuration updates two conversion literals and explicitly casts a displayed temperature to double. The CeilSense configuration removes its fixed build-path override.

Changes: Garage-gate fan conversions

Layer / File(s) Summary
Conversion and display values
garage-gate-fan-controller.yaml
The water conversion divisor changes to 264.172f, and the gas divisor uses 35.315f. The displayed Celsius value is cast to double; the fallback and display format remain unchanged.

CeilSense build path

Layer / File(s) Summary
Build-path configuration
templates/smarthome-ceilsense.yaml
The fixed build_path setting is removed. Comments describe the removal.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • ptr727/ESPHome-Config#263: Adds compile-lint checks for generated ESPHome C++ and records float-warning fixes. The fan conversion and formatting updates address the same lint behavior.
Merge Risk: Minimal · up to fd8cc

No actionable merge-blocking risk remains in the reviewed changes.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes both main changes: fixing gate fan lint findings and assigning CeilSense per-device build paths.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.61%. Comparing base (95c3425) to head (fd8cc50).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #280   +/-   ##
========================================
  Coverage    84.61%   84.61%           
========================================
  Files            3        3           
  Lines          624      624           
========================================
  Hits           528      528           
  Misses          96       96           
Flag Coverage Δ
python-3.13 84.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain, and the affected configurations were verified in clean build trees.

No open issues 🎉

What changed in this PR

This pull request fixes production compile-lint warnings in the gate fan controller and prevents CeilSense devices from sharing a vendor-defined build directory.

Changes:

  • Uses float literals for meter conversions and explicitly promotes the display temperature to double.
  • Removes the shared CeilSense build_path so each device uses its own build directory.
  • Verifies the affected configurations with clean build trees.
File Description
templates/​smarthome-ceilsense.yaml Removes the shared vendor build path so CeilSense devices build independently.
garage-gate-fan-controller.yaml Fixes three -Wdouble-promotion diagnostics in meter conversions and display formatting.

Review effort: Lite

@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Oct 30, 2026
@ptr727

ptr727 commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head fd8cc50c7bd49c902eccc78e3ffe51e3a8d4b258, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit 943702d into develop Oct 30, 2026
37 checks passed
@ptr727
ptr727 deleted the fix/compile-warnings-sweep branch October 30, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants