Skip to content
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

hydreon_rgxx - fix missing cg.add(var.set_model(...)) #6065

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

mrtoy-me
Copy link
Contributor

@mrtoy-me mrtoy-me commented Jan 9, 2024

What does this implement/fix?

cg.add(var.set_model(config[CONF_MODEL])) is omitted from sensor.py, so the configured model (required) is not passed through.
The default model is defined in .h file as RG_9, so RG_9 models are not affected. When RG_15 is configured, the bug is not easily evident because the configuration command for polling mode is the same for RG_9 and RG15. However, the configuration of units as mm and resolution as high is never set for RG_15 as was intended - so the units and resolution are actually currently defined by the DIP switch settings of the RG_15.

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)
  • Other

Related issue or feature (if applicable): fixes

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

Test Environment

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

Example entry for config.yaml:

# Example config.yaml

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:

@probot-esphome
Copy link

probot-esphome bot commented Jan 9, 2024

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

@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (dev@ae52164). Click here to learn what that means.

Additional details and impacted files
@@          Coverage Diff           @@
##             dev    #6065   +/-   ##
======================================
  Coverage       ?   53.60%           
======================================
  Files          ?       50           
  Lines          ?     9374           
  Branches       ?     1650           
======================================
  Hits           ?     5025           
  Misses         ?     4050           
  Partials       ?      299           

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

@mrtoy-me mrtoy-me changed the title fix missing cg.add(var.set_model(...)) hydreon_rgxx - fix missing cg.add(var.set_model(...)) Jan 9, 2024
@functionpointer
Copy link
Contributor

Tested with RG-9 - works

@jesserockz
Copy link
Member

Thanks @mrtoy-me

@jesserockz jesserockz merged commit 4cc17da into esphome:dev Jan 11, 2024
53 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2024
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.

None yet

4 participants