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

Fix "minimum" fan curve #87

Merged
merged 1 commit into from
Feb 3, 2022

Conversation

Smeat
Copy link
Contributor

@Smeat Smeat commented Feb 3, 2022

Hello,

first of all: Thank you very much for this program!

This PR fixes one small issue with the "minimum" fan curve.
By not setting a default value for min, it defaults to 0. This causes the math.Min function to always return 0 and thus rendering the "minimum" curve useless.
Setting it to 255 fixes this issue.

@markusressel
Copy link
Owner

markusressel commented Feb 3, 2022

Good catch!
Actually there is a test for the Minimum function, but it happens to exactly line up with this edge case: expecting 0 😆
See here:

func TestFunctionCurveMinimum(t *testing.T) {

Could you adjust this by changing temp1 to something higher than 40000, and then expect the appropriate (non-zero) value at the end? Thx!

@markusressel markusressel added the bug Something isn't working label Feb 3, 2022
@Smeat
Copy link
Contributor Author

Smeat commented Feb 3, 2022

I totally missed the tests, sorry.

@markusressel
Copy link
Owner

No worries, I didn't check everything in the first place 😄
Thx!

@markusressel markusressel merged commit 5ee84eb into markusressel:master Feb 3, 2022
@Smeat Smeat deleted the minimum_curve_fix branch February 19, 2022 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants