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 - add resolution option #6077

Merged
merged 7 commits into from Mar 12, 2024

Conversation

mrtoy-me
Copy link
Contributor

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

What does this implement/fix?

The component currently implements high resolution. This change adds ability to optionally set resolution to either high or low .
Defaults to resolution high as component currently implements.

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#3529

Test Environment

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

Example entry for config.yaml:

# Example config.yaml
sensor:
  - platform: hydreon_rgxx
    model: "RG_15"
    resolution: high
    update_interval: 60s
    acc:
       name: "rain"
    event_acc:
       name: "rain event"
    total_acc:
       name: "rain total"
    r_int:
       name: "rain intensity"

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

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 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4cc17da) 53.60% compared to head (0f01bd1) 53.70%.
Report is 45 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #6077      +/-   ##
==========================================
+ Coverage   53.60%   53.70%   +0.10%     
==========================================
  Files          50       50              
  Lines        9374     9403      +29     
  Branches     1650     1653       +3     
==========================================
+ Hits         5025     5050      +25     
- Misses       4050     4055       +5     
+ Partials      299      298       -1     

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

@mrtoy-me
Copy link
Contributor Author

@functionpointer Have made the changes we talked about - How does this look to you now ?

@functionpointer
Copy link
Contributor

Looks great :)

@esphome
Copy link

esphome bot commented Jan 17, 2024

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@esphome esphome bot marked this pull request as draft January 17, 2024 23:30
@mrtoy-me
Copy link
Contributor Author

Looks great :)

Thanks..,
Jesse asked me to validate resolution only for RG15 - I have done this the same way as was done with disable led only for applying to rg9, I did a quick try in my yaml and it seems ok but the test3.yaml failed.
Would you have time to have a Quick Look at the sensor.py - I only added one line

Copy link
Contributor

@functionpointer functionpointer left a comment

Choose a reason for hiding this comment

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

test3.yaml should also contain resolution: low for the RG_15 instance. This would add a test for the newly added option.

esphome/components/hydreon_rgxx/sensor.py Outdated Show resolved Hide resolved
esphome/components/hydreon_rgxx/sensor.py Outdated Show resolved Hide resolved
@mrtoy-me
Copy link
Contributor Author

test3.yaml should also contain resolution: low for the RG_15 instance. This would add a test for the newly added option.

Thanks heaps for the review and suggested changes .. it was only a small change but I learned a lot
All done now and all passed

@mrtoy-me mrtoy-me marked this pull request as ready for review January 25, 2024 06:01
@functionpointer functionpointer removed their assignment Jan 26, 2024
@jesserockz jesserockz merged commit 51ab15c into esphome:dev Mar 12, 2024
57 checks passed
@jesserockz jesserockz mentioned this pull request Mar 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 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