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

Minor warning message bug in setProps() #937

Closed
thoukydides opened this issue Apr 12, 2022 · 3 comments
Closed

Minor warning message bug in setProps() #937

thoukydides opened this issue Apr 12, 2022 · 3 comments
Labels

Comments

@thoukydides
Copy link
Contributor

Analysis

The warning message for props.maxValue being below the minimum for the format is incorrectly using numericUpperBound instead of numericLowerBound on src/lib/Characteristic.ts line 1137:

            "Characteristic Property 'maxValue' was set to " + props.maxValue + ", but for numeric format " +
            this.props.format + " minimum possible is " + numericUpperBound(this.props.format),

This only affects the warning message. The actual range check is applied correctly.

The equivalent code for props.minValue is correct.

Expected Behavior

Report the minimum allowed value rather than the maximum, when the minimum limit is exceeded.

Steps To Reproduce

n/a

Logs

n/a (spotted during code inspection)

Configuration

n/a

Environment

n/a

Process Supervisor

not applicable

Additional Context

No response

@NorthernMan54
Copy link
Contributor

@thoukydides tsk for spotting this, could you supply the fix as a pull request ?

@thoukydides
Copy link
Contributor Author

Pull request #938 created

@Supereg
Copy link
Member

Supereg commented Apr 13, 2022

Thanks for reporting and fixes this issue. Version v0.10.1 was just released containing this fix.

@Supereg Supereg closed this as completed Apr 13, 2022
koush pushed a commit to koush/HAP-NodeJS that referenced this issue Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants