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

Add hysteresis to the core.utils library #221

Open
rkoshak opened this issue Aug 30, 2019 · 1 comment
Open

Add hysteresis to the core.utils library #221

rkoshak opened this issue Aug 30, 2019 · 1 comment

Comments

@rkoshak
Copy link

rkoshak commented Aug 30, 2019

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.

@rkoshak
Copy link
Author

rkoshak commented Aug 30, 2019

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
Projects
None yet
Development

No branches or pull requests

1 participant