Skip to content

Add temperature and humidity calibration to Sonoff SNZB-02D #3989

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 2 commits into
base: dev
Choose a base branch
from

Conversation

fgsch
Copy link
Contributor

@fgsch fgsch commented Mar 30, 2025

Proposed change

Add temperature and humidity calibration to Sonoff SNZB-02D.

Additional information

N/A.

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works

@fgsch fgsch force-pushed the snzb02d-calibration branch from dc10e56 to e4b396e Compare March 30, 2025 13:42
Copy link

codecov bot commented Mar 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.20%. Comparing base (5556090) to head (93a0a57).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #3989   +/-   ##
=======================================
  Coverage   91.19%   91.20%           
=======================================
  Files         335      335           
  Lines       10886    10888    +2     
=======================================
+ Hits         9928     9930    +2     
  Misses        958      958           

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

@fgsch fgsch changed the title Add temperature and humidity calibration Add temperature and humidity calibration to Sonoff SNZB-02D Mar 30, 2025
@fgsch fgsch changed the title Add temperature and humidity calibration to Sonoff SNZB-02D feat: add temperature and humidity calibration to Sonoff SNZB-02D Mar 30, 2025
@TheJulianJES TheJulianJES changed the title feat: add temperature and humidity calibration to Sonoff SNZB-02D Add temperature and humidity calibration to Sonoff SNZB-02D Apr 29, 2025
Copy link
Collaborator

@TheJulianJES TheJulianJES left a comment

Choose a reason for hiding this comment

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

Also, any issues with this PR still, since it's still in draft? Seems like it should work for the most part.

min_value=-50,
max_value=50,
step=0.1,
unit=TemperatureUnit,
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should not use the enum TemperatureUnit for the unit — it's expecting a str.
The offset is likely in °C, so use UnitOfTemperature.CELSIUS instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

min_value=-50,
max_value=50,
step=0.1,
unit=PERCENTAGE,
Copy link
Collaborator

@TheJulianJES TheJulianJES Apr 29, 2025

Choose a reason for hiding this comment

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

Hmm, technically, the unit for the calibration won't be a percentage, but percentage points.
Don't really think HA uses pp as a unit for entities like this though. I do see at least one HA entity using "%", so this is likely fine.

@TheJulianJES TheJulianJES added the waiting for changes Waiting for changes to the PR label Apr 29, 2025
@fgsch
Copy link
Contributor Author

fgsch commented Apr 30, 2025

Also, any issues with this PR still, since it's still in draft? Seems like it should work for the most part.

Nop, sorry, I just been busy with life. I will try to wrap up this PR this week.

@fgsch fgsch force-pushed the snzb02d-calibration branch from e2fb02d to 2464b29 Compare April 30, 2025 12:33
@fgsch fgsch marked this pull request as ready for review May 1, 2025 14:55
@fgsch
Copy link
Contributor Author

fgsch commented May 1, 2025

PTAL.

@TheJulianJES TheJulianJES added needs review This PR should be reviewed soon, as it generally looks good. and removed waiting for changes Waiting for changes to the PR labels May 1, 2025
@fgsch fgsch force-pushed the snzb02d-calibration branch from 2464b29 to 93a0a57 Compare May 8, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review This PR should be reviewed soon, as it generally looks good.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants