Skip to content

Core.yaml: Add device classes for many entities - #139

Open
gdt wants to merge 1 commit into
ApolloAutomation:betafrom
gdt:fix/device_class
Open

gdt wants to merge 1 commit into
ApolloAutomation:betafrom
gdt:fix/device_class

Conversation

@gdt

@gdt gdt commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Most importantly, set atmospheric_pressure on pressure, because it was failing to graph together with other atmospheric_pressure entities. Somehow, it ended up as pressure, despite not having a device class set.

Put aqi's device class in quotes, per the esphome docs.

Version: 26.10.16.1
(I don't understand the point of this question; really the branch should be based on recent beta, and if anything the question is which beta commit it's been tested against.)

What does this implement/fix?

The config does not set device classes for a number of entities, and HA best practice is to do so. In particular, the pressure sensor defaults to pressure, which is for things other than atmospheric pressure. This PR sets the device class to atmospheric_pressure.

My expectation is that users will not notice this, except for "why is the DSP310 pressure graphed separately from my other barometer sensors" will turn into "they are graphed together, of course, so I didn't notice or think about this".

Types of changes

  • Bugfix (fixed change that fixes an issue)
  • New feature (thanks!)
  • Breaking change (repair/feature that breaks existing functionality)
  • Dependency Update - Does not publish
  • Other - Does not publish
  • Website of github readme file update - Does not publish
  • Github workflows - Does not publish

Checklist:

  • The code change has been tested and works locally
  • The code change has not yet been tested

If user-visible functionality or configuration variables are added/modified:

  • Added/updated documentation for the web page

Summary by CodeRabbit

  • Improvements
    • Sensor readings now have clearer classifications across pressure, temperature, humidity, Wi-Fi signal strength, and air quality measurements, including particulate matter, CO₂, nitrogen dioxide, carbon monoxide, and AQI. This helps supported platforms recognize and present these readings consistently.
    • Existing SEN55 filtering and accuracy settings are unchanged.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6f48f683-61e9-401f-94ee-2be1d9034d0b
Commits

Reviewing files that changed from the base of the PR and between 1dda178 and cf1d1e4.

Files selected for processing: 1
  • Integrations/ESPHome/Core.yaml

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a2402fab-dbf7-4500-a9d7-705b7674af35
Commits

Reviewing files that changed from the base of the PR and between 299d39b and 1dda178.

Files selected for processing: 1
  • Integrations/ESPHome/Core.yaml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

The ESPHome Core.yaml declarations now include device-class metadata for several pressure, temperature, gas, particulate, humidity, and Wi-Fi entities. The AQI device-class value is quoted. Existing SEN55 accuracy settings and temperature filtering remain unchanged.

Changes

ESPHome entity metadata

Layer / File(s) Summary
Entity device-class declarations
Integrations/ESPHome/Core.yaml
Device classes were added to the DPS310 pressure offset and pressure sensors, ESP temperature, Wi-Fi RSSI, CO₂, SEN55 measurements, and MICS-4514 gas sensors. The AQI device-class value was quoted. SEN55 accuracy settings and temperature filtering remain unchanged.

Priority: Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: bharvey88

Merge Risk: Minimal · up to 1dda1

No merge-blocking risk was identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding device classes to multiple entities in Core.yaml.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
🧪 Generate unit tests (beta)
  • 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

A rabbit checks each sensor’s name,
And adds its class beside the same.
The pressure, gases, warmth, and air,
Now list their types with tidy care.
The AQI quote is set in place,
While SEN55 keeps its settings’ trace.

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

Most importantly, set atmospheric_pressure on pressure, because it was
failing to graph together with other atmospheric_pressure entities.
Somehow, it ended up as pressure, despite not having a device class
set.

Put aqi's device class in quotes, per the esphome docs.
@gdt
gdt force-pushed the fix/device_class branch from 1dda178 to cf1d1e4 Compare October 25, 2026 12:24

This branch has not been deployed

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

Labels

bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants