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

[basicprofiles] Add $DELTA_PERCENT function to State Filter profile #17843

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Dec 4, 2024

Support $DELTA_PERCENT > 5 or simply > 5%

@jimtng jimtng requested a review from J-N-K as a code owner December 4, 2024 03:11
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/state-filter-range-filter-profile/158025/24

Comment on lines +686 to +688
if (deltaState instanceof QuantityType deltaStateQuantity) {
// Assume that delta and base are in the same unit
bdDelta = ((QuantityType) stateDelta).toBigDecimal();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is somewhat confusing and possibly wrong.

  1. The method starts with assigning stateDelta but deos not seem to be used later on.
  2. Iin line 686 deltaState (reverse name?!) is used with instanceof
  3. The var deltaStateQuantity created with the instanceof is not used.
  4. Within the instanceof block another case is done. ((QuantityType) stateDelta)

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