[inmemory] Query does not consider FilterCriteria.getOrdering()
#16175
Labels
bug
An unexpected problem or unintended behavior of an add-on
The query implementation does not consider
FilterCriteria.getOrdering()
.This is needed in order to correctly support historicState which makes use of this:
https://github.com/openhab/openhab-core/blob/7d1dcd7937ac8810f64691445179b2951d0246bf/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/extensions/PersistenceExtensions.java#L113-L126
Expected Behavior
When using
historicState
from a rule, I would expect the correct item state to be found.Current Behavior
The first persisted item state is found, i.e. without considering the requested timestamp.
Possible Solution
None yet.
Steps to Reproduce
electricity#spot-price
to an item.Create a rule with some trigger and this body:
Result (example):
The value returned by InMemory is the first persisted one:
Context
I was going to prepare an example for setting up InMemory persistence and getting prices at specific points in time from a rule. This would then obsolete the raw JSON channel
electricity#hourly-prices
: https://www.openhab.org/addons/bindings/energidataservice/#channel-group-electricityYour Environment
The text was updated successfully, but these errors were encountered: