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

Correct Sonoff TRVZB local temperature calibration min/max #300

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

fgsch
Copy link
Contributor

@fgsch fgsch commented Nov 22, 2024

@fgsch fgsch closed this Nov 22, 2024
@fgsch fgsch deleted the sonoff-calibration branch November 22, 2024 00:05
@fgsch fgsch restored the sonoff-calibration branch November 22, 2024 00:06
@fgsch fgsch reopened this Nov 22, 2024
@tr4nt0r
Copy link

tr4nt0r commented Nov 22, 2024

I think the step should also be 0.1

@fgsch
Copy link
Contributor Author

fgsch commented Nov 22, 2024

@tr4nt0r, can you elaborate on why you think so? The original change uses 0.2.

@tr4nt0r
Copy link

tr4nt0r commented Nov 22, 2024

I can write to the local_temperature_calibration attribute directly and it takes any integer value without any problems. Also how would it otherwise be possible to set a value of +12.7

@fgsch
Copy link
Contributor Author

fgsch commented Nov 22, 2024

The max and min don't necessarily imply those are the values you can use; they correspond to the range for this type -128..127 (int8) before applying the multiplier.

Copy link

codecov bot commented Nov 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.33%. Comparing base (11cf9ba) to head (3efa11f).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #300   +/-   ##
=======================================
  Coverage   96.33%   96.33%           
=======================================
  Files          61       61           
  Lines        9388     9388           
=======================================
  Hits         9044     9044           
  Misses        344      344           

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


🚨 Try these New Features:

@TheJulianJES
Copy link
Contributor

I think we could increase the step size if we wanted. I'd guess 0.2 was originally chosen, as it's easier doing 0.2°C steps when moving the slider in the HA frontend.

I'll merge this for now, as Z2M also uses step size 0.2 Feel free to open a separate PR if you'd prefer the smaller step size.
Does HA also limit the values to the step size when entered manually?

@TheJulianJES TheJulianJES changed the title Correct local temperature calibration min and max value on Sonoff TRVZB Correct Sonoff TRVZB local temperature calibration min/max Nov 24, 2024
Copy link
Contributor

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

Thanks!

@TheJulianJES TheJulianJES merged commit 37dcf3d into zigpy:dev Nov 24, 2024
9 checks passed
@tr4nt0r
Copy link

tr4nt0r commented Nov 24, 2024

I think we could increase the step size if we wanted. I'd guess 0.2 was originally chosen, as it's easier doing 0.2°C steps when moving the slider in the HA frontend.

I'll merge this for now, as Z2M also uses step size 0.2 Feel free to open a separate PR if you'd prefer the smaller step size. Does HA also limit the values to the step size when entered manually?

@TheJulianJES if the number entity is used, Home Assistant validates the inputs and allows only the values within min/max and I think it also the step is validated, but I'm not 100% sure about that right now. Currently the entity for the offset has a step of 0.1 so it would change with the update. Having a step of 0.1 would make it easier when calculating the offsets via automation.

@TheJulianJES
Copy link
Contributor

Currently the entity for the offset has a step of 0.1

Ah, the ZCL entity indeed has a 0.1 step. I've only looked at the Sonoff one before. We should probably change this one then.

@fgsch
Copy link
Contributor Author

fgsch commented Nov 25, 2024

@TheJulianJES Ok, if a 0.1 step is the norm, I can open a PR to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants