openhab / openhab-js

openHAB JavaScript Library for JavaScript Scripting Automation
https://www.openhab.org/addons/automation/jsscripting/
Eclipse Public License 2.0
38 stars 31 forks source link

[items] Return HistoricItem from persistence where applicable #228

Closed maniac103 closed 1 year ago

maniac103 commented 1 year ago

For minimumSince, minimumBetween, maximumSince and maximumBetween the caller might care about the timestamp of the returned state, so return an object which contains both state and timestamp. Additionally, remove previousStateTimestamp and make previousState return an HistoricItem instead for API symmetry.

Fixes #226

maniac103 commented 1 year ago

I'll submit a PR to update the tern definitions once this is accepted. Open question: shall I update the CHANGELOG.md file?

florian-h05 commented 1 year ago

I'll submit a PR to update the tern definitions once this is accepted.

Great, the tern defs also need some more updates. Note that we should update the tern defs after we have released this and it is included in the addon, otherwise the UI code completion doesn't match the included library.

Open question: shall I update the CHANGELOG.md file?

Yes, please.

maniac103 commented 1 year ago

Open question: shall I update the CHANGELOG.md file?

Yes, please.

Done.