-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add hysteresis to the core.utils library #221
Labels
Comments
After looking at the core.util library, these are all JSR223/OH specific. I'm not thinking it belongs in community and that is where I'll submit it as the PR. What's the policy for tests? Right now I have the tests inline with the function. Should those be submitted too? Moved to some other place? Turned off somehow? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Performing hysteresis in rules is a common requirement. For example, controlling the temperature or humidity, one wants a gap between the value when you turn on a heater/fan/humidifier and when you turn it off to avoid flapping.
Describe the solution you'd like
I've implemented a generic function that works with all the numerical OH Types as well as Python primitives which is reusable. This can free users from needing to implement this behavior.
Describe alternatives you've considered
Adding it as a Community library but Michael recommended submitting it to core.utils.
See https://community.openhab.org/t/jsr223-python-working-with-quantitytypes-how-do-i-get-an-int-float/80801/14 for discussion and an early version of the code. A version with appropriate documentation, docstrings, and compliance with the Python style guide will be submitted in the PR.
The text was updated successfully, but these errors were encountered: