Skip to content

Add hdop sensor (#3140) #8680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Add hdop sensor (#3140) #8680

wants to merge 3 commits into from

Conversation

realzoulou
Copy link

@realzoulou realzoulou commented May 3, 2025

What does this implement/fix?

TinyGPSPlus in currently used version 1.0.2 supports reading HDOP (Horizontal Dilution Of Precision).
However the current gps component does not define a sensor for it.
This add hdop as an additional sensor for gps.
Additional changes

  • Change debug logs to 1 line per value instead of 2
  • Change defaults from -1 to NAN, satellites defaults to 0

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

Pull request in esphome-docs with documentation (if applicable):

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx

Example entry for config.yaml:

# Example config.yaml
  hdop:
    name: "HDOP"

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

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

Tested with

  1. Heltec HTIT Tracker (https://heltec.org/project/wireless-tracker) and its onboard UC6580 GNSS chipset
  2. Same Heltec, but with external u-blox NEO-F10N (https://www.sparkfun.com/sparkfun-gnss-l1-l5-breakout-neo-f10n-sma.html)

Additional changes
- Change debug logs to 1 line per value instead of 2
- Change defaults from -1 to NAN, satellites defaults to 0
@probot-esphome
Copy link

probot-esphome bot commented May 3, 2025

Hey there @coogle, mind taking a look at this pull request as it has been labeled with an integration (gps) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@codecov-commenter
Copy link

codecov-commenter commented May 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.62%. Comparing base (4d8b5ed) to head (cd193bd).
Report is 2461 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8680      +/-   ##
==========================================
+ Coverage   53.70%   56.62%   +2.91%     
==========================================
  Files          50       50              
  Lines        9408     9922     +514     
  Branches     1654     1340     -314     
==========================================
+ Hits         5053     5618     +565     
+ Misses       4056     3955     -101     
- Partials      299      349      +50     

☔ 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.

@coogle
Copy link
Contributor

coogle commented May 3, 2025

Sure I can take a peek.

Copy link
Contributor

@coogle coogle left a comment

Choose a reason for hiding this comment

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

Overall looks fine, but I think you've made some minor changes that were unnecessary and I'd like to see those undone unless there is a reason for them.

realzoulou added 2 commits May 4, 2025 11:27
Additional changes
- Change  some debug logs to 1 line per value instead of 2
- Change defaults from -1 to NAN, satellites defaults to 0
Additional changes
- Change  some debug logs to 1 line per value instead of 2
- Change defaults from -1 to NAN, satellites defaults to 0
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.

[gps] Add HDOP sensor
3 participants