From 940e9934488174c862e4a576c921fd3b5b19f1e4 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Mon, 4 Nov 2024 22:37:02 +0100 Subject: [PATCH] [items] ItemPersistence: Add PersistedItem::instant & Provide access to wrapped Java types Refs https://github.com/openhab/openhab-core/pull/4384. Signed-off-by: Florian Hotze --- README.md | 1 + src/items/item-persistence.js | 104 +++++++++++++++----------- types/items/item-persistence.d.ts | 35 +++++++-- types/items/item-persistence.d.ts.map | 2 +- 4 files changed, 89 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 96013a2d6..d73b7a2d3 100644 --- a/README.md +++ b/README.md @@ -567,6 +567,7 @@ The `PersistedState` object contains the following properties, representing Item The `PersistedItem` object extends `PersistedState` with the following properties, representing Item state and the respective timestamp: - `timestamp`: Timestamp as [`time.ZonedDateTime`](#time) +- `instant`: Timestamp as [`time.Instant`](#time) ```javascript var midnight = time.toZDT('00:00'); diff --git a/src/items/item-persistence.js b/src/items/item-persistence.js index f1bc67f09..52ecd4782 100644 --- a/src/items/item-persistence.js +++ b/src/items/item-persistence.js @@ -11,6 +11,10 @@ const TypeParser = Java.type('org.openhab.core.types.TypeParser'); * @typedef {import('@js-joda/core').ZonedDateTime} time.ZonedDateTime * @private */ +/** + * @typedef {import('@js-joda/core').Instant} time.Instant + * @private + */ /** * @typedef {import('../quantity').Quantity} Quantity * @private @@ -27,13 +31,13 @@ const TypeParser = Java.type('org.openhab.core.types.TypeParser'); * @hideconstructor */ class PersistedState { - #rawState; - /** - * @param {HostState} rawState + * Create an PersistedState, wrapping a native openHAB HistoricState. + * @param {*} rawHistoricState an instance of {@link https://www.openhab.org/javadoc/latest/org/openhab/core/types/state org.openhab.core.types.State} + * @hideconstructor */ - constructor (rawState) { - this.#rawState = rawState; + constructor (rawHistoricState) { + this.rawState = rawHistoricState; } /** @@ -41,7 +45,7 @@ class PersistedState { * @type {string} */ get state () { - return this.#rawState.toString(); + return this.rawState.toString(); } /** @@ -49,7 +53,7 @@ class PersistedState { * @type {number|null} */ get numericState () { - const numericState = parseFloat(this.#rawState.toString()); + const numericState = parseFloat(this.rawState.toString()); return isNaN(numericState) ? null : numericState; } @@ -59,7 +63,7 @@ class PersistedState { */ get quantityState () { try { - const qty = getQuantity(this.#rawState.toString()); + const qty = getQuantity(this.rawState.toString()); return (qty !== null && qty.symbol !== null) ? qty : null; } catch (e) { if (e instanceof QuantityError) { @@ -77,28 +81,38 @@ class PersistedState { /** * Class representing an instance of {@link https://www.openhab.org/javadoc/latest/org/openhab/core/persistence/historicitem org.openhab.core.persistence.HistoricItem}. - * Extends {@link items.PersistedState}. * + * @extends items.PersistedState * @memberof items * @hideconstructor */ class PersistedItem extends PersistedState { - #rawHistoricItem; - /** + * Create an PersistedItem, wrapping a native openHAB HistoricItem. * @param {*} rawHistoricItem {@link https://www.openhab.org/javadoc/latest/org/openhab/core/persistence/historicitem org.openhab.core.persistence.HistoricItem} + * @hideconstructor */ constructor (rawHistoricItem) { super(rawHistoricItem.getState()); - this.#rawHistoricItem = rawHistoricItem; + this.rawHistoricItem = rawHistoricItem; } /** * Timestamp of persisted Item. + * + * Consider using {@link instant} for heavy calculations because it is much faster to work with Instant. * @type {time.ZonedDateTime} */ get timestamp () { - return time.javaZDTToJsZDT(this.#rawHistoricItem.getTimestamp()); + return time.javaZDTToJsZDT(this.rawHistoricItem.getTimestamp()); + } + + /** + * Timestamp of the persisted Item as Instant. + * @returns {time.Instant} + */ + get instant () { + return time.javaInstantToJsInstant(this.rawHistoricItem.getInstant()); } toString () { @@ -107,18 +121,18 @@ class PersistedItem extends PersistedState { } function _ZDTOrNull (result) { - return result === null ? null : time.ZonedDateTime.parse(result.toString()); + return result === null ? null : time.javaZDTToJsZDT(result); } function _decimalOrNull (result) { return result === null ? null : result.toBigDecimal(); } -function _stateOrNull (result) { +function _persistedStateOrNull (result) { return result === null ? null : new PersistedState(result); } -function _historicItemOrNull (result) { +function _persistedItemOrNull (result) { if (result === null) return null; return new PersistedItem(result); } @@ -128,7 +142,7 @@ function _javaIterableOfJavaHistoricItemsToJsArrayOfHistoricItems (result) { const historicItems = []; result.forEach((hi) => { - const historicItem = _historicItemOrNull(hi); + const historicItem = _persistedItemOrNull(hi); if (historicItem !== null) historicItems.push(historicItem); }); return historicItems; @@ -136,7 +150,7 @@ function _javaIterableOfJavaHistoricItemsToJsArrayOfHistoricItems (result) { /** * Class representing the historic state of an openHAB Item. - * Wrapping the {@link https://www.openhab.org/javadoc/latest/org/openhab/core/persistence/extensions/persistenceextensions PersistenceExtensions}. + * Wrapping the {@link https://www.openhab.org/javadoc/latest/org/openhab/core/persistence/extensions/persistenceextensions org.openhab.core.persistence.extensions.PersistenceExtensions}. * * Be warned: This class can throw several exceptions from the underlying Java layer. It is recommended to wrap the methods of this class inside a try_catch block! * @@ -275,7 +289,7 @@ class ItemPersistence { * @returns {(PersistedItem | null)} the {@link items.PersistedItem} at the given point in time, or null if no persisted item could be found */ persistedState (timestamp, serviceId) { - return _historicItemOrNull(PersistenceExtensions.persistedState(this.rawItem, ...arguments)); + return _persistedItemOrNull(PersistenceExtensions.persistedState(this.rawItem, ...arguments)); } /** @@ -328,7 +342,7 @@ class ItemPersistence { * @returns {(PersistedItem | null)} the {@link items.PersistedItem} at the given point in time, or null if no persisted item could be found or null */ previousState (skipEqual, serviceId) { - return _historicItemOrNull(PersistenceExtensions.previousState(this.rawItem, ...arguments)); + return _persistedItemOrNull(PersistenceExtensions.previousState(this.rawItem, ...arguments)); } /** @@ -339,7 +353,7 @@ class ItemPersistence { * @returns {(PersistedItem | null)} the {@link items.PersistedItem} at the given point in time, or null if no persisted item could be found or null */ nextState (skipEqual, serviceId) { - return _historicItemOrNull(PersistenceExtensions.nextState(this.rawItem, ...arguments)); + return _persistedItemOrNull(PersistenceExtensions.nextState(this.rawItem, ...arguments)); } /** @@ -425,7 +439,7 @@ class ItemPersistence { * or null if timestamp is in the future */ maximumSince (timestamp, serviceId) { - return _historicItemOrNull(PersistenceExtensions.maximumSince(this.rawItem, ...arguments)); + return _persistedItemOrNull(PersistenceExtensions.maximumSince(this.rawItem, ...arguments)); } /** @@ -437,7 +451,7 @@ class ItemPersistence { * or null if timestamp is in the past */ maximumUntil (timestamp, serviceId) { - return _historicItemOrNull(PersistenceExtensions.maximumUntil(this.rawItem, ...arguments)); + return _persistedItemOrNull(PersistenceExtensions.maximumUntil(this.rawItem, ...arguments)); } /** @@ -450,7 +464,7 @@ class ItemPersistence { * or null if begin is after end */ maximumBetween (begin, end, serviceId) { - return _historicItemOrNull(PersistenceExtensions.maximumBetween(this.rawItem, ...arguments)); + return _persistedItemOrNull(PersistenceExtensions.maximumBetween(this.rawItem, ...arguments)); } /** @@ -462,7 +476,7 @@ class ItemPersistence { * or null if timestamp is in the future */ minimumSince (timestamp, serviceId) { - return _historicItemOrNull(PersistenceExtensions.minimumSince(this.rawItem, ...arguments)); + return _persistedItemOrNull(PersistenceExtensions.minimumSince(this.rawItem, ...arguments)); } /** @@ -474,7 +488,7 @@ class ItemPersistence { * or null if timestamp is in the past */ minimumUntil (timestamp, serviceId) { - return _historicItemOrNull(PersistenceExtensions.minimumUntil(this.rawItem, ...arguments)); + return _persistedItemOrNull(PersistenceExtensions.minimumUntil(this.rawItem, ...arguments)); } /** @@ -487,7 +501,7 @@ class ItemPersistence { * or null if begin is after end */ minimumBetween (begin, end, serviceId) { - return _historicItemOrNull(PersistenceExtensions.minimumBetween(this.rawItem, ...arguments)); + return _persistedItemOrNull(PersistenceExtensions.minimumBetween(this.rawItem, ...arguments)); } /** @@ -500,7 +514,7 @@ class ItemPersistence { * Item at the given timestamp */ varianceSince (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.varianceSince(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.varianceSince(this.rawItem, ...arguments)); } /** @@ -513,7 +527,7 @@ class ItemPersistence { * Item at the given timestamp */ varianceUntil (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.varianceUntil(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.varianceUntil(this.rawItem, ...arguments)); } /** @@ -527,7 +541,7 @@ class ItemPersistence { * Item between begin and end */ varianceBetween (begin, end, serviceId) { - return _stateOrNull(PersistenceExtensions.varianceBetween(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.varianceBetween(this.rawItem, ...arguments)); } /** @@ -540,7 +554,7 @@ class ItemPersistence { * at the given timestamp */ deviationSince (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.deviationSince(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.deviationSince(this.rawItem, ...arguments)); } /** @@ -553,7 +567,7 @@ class ItemPersistence { * at the given timestamp */ deviationUntil (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.deviationUntil(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.deviationUntil(this.rawItem, ...arguments)); } /** @@ -567,7 +581,7 @@ class ItemPersistence { * between begin and end */ deviationBetween (begin, end, serviceId) { - return _stateOrNull(PersistenceExtensions.deviationBetween(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.deviationBetween(this.rawItem, ...arguments)); } /** @@ -583,7 +597,7 @@ class ItemPersistence { * @returns {(PersistedState | null)} the average value since timestamp as {@link items.PersistedState} or null if no previous states could be found */ averageSince (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.averageSince(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.averageSince(this.rawItem, ...arguments)); } /** @@ -594,7 +608,7 @@ class ItemPersistence { * @returns {(PersistedState | null)} the average value until timestamp as {@link items.PersistedState} or null if no future states could be found */ averageUntil (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.averageUntil(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.averageUntil(this.rawItem, ...arguments)); } /** @@ -606,7 +620,7 @@ class ItemPersistence { * @returns {(PersistedState | null)} the average value between begin and end as {@link items.PersistedState} or null if no states could be found */ averageBetween (begin, end, serviceId) { - return _stateOrNull(PersistenceExtensions.averageBetween(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.averageBetween(this.rawItem, ...arguments)); } /** @@ -622,7 +636,7 @@ class ItemPersistence { * @returns {(PersistedState | null)} the median value since timestamp as {@link items.PersistedState} or null if no previous states could be found */ medianSince (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.medianSince(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.medianSince(this.rawItem, ...arguments)); } /** @@ -633,7 +647,7 @@ class ItemPersistence { * @returns {(PersistedState | null)} the median value until timestamp as {@link items.PersistedState} or null if no future states could be found */ medianUntil (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.medianUntil(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.medianUntil(this.rawItem, ...arguments)); } /** @@ -645,7 +659,7 @@ class ItemPersistence { * @returns {(PersistedState | null)} the median value between begin and end as {@link items.PersistedState} or null if no states could be found */ medianBetween (begin, end, serviceId) { - return _stateOrNull(PersistenceExtensions.medianBetween(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.medianBetween(this.rawItem, ...arguments)); } /** @@ -656,7 +670,7 @@ class ItemPersistence { * @returns {(PersistedState | null)} the sum of the state values since timestamp as {@link items.PersistedState}, or null if timestamp is in the future */ sumSince (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.sumSince(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.sumSince(this.rawItem, ...arguments)); } /** @@ -667,7 +681,7 @@ class ItemPersistence { * @returns {(PersistedState | null)} the sum of the state values until timestamp as {@link items.PersistedState}, or null if timestamp is in the past */ sumUntil (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.sumUntil(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.sumUntil(this.rawItem, ...arguments)); } /** @@ -680,7 +694,7 @@ class ItemPersistence { * or null if begin is after end */ sumBetween (begin, end, serviceId) { - return _stateOrNull(PersistenceExtensions.sumBetween(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.sumBetween(this.rawItem, ...arguments)); } /** @@ -692,7 +706,7 @@ class ItemPersistence { * if there is no persisted state for the given Item at the given timestamp available */ deltaSince (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.deltaSince(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.deltaSince(this.rawItem, ...arguments)); } /** @@ -704,7 +718,7 @@ class ItemPersistence { * if there is no persisted state for the given Item at the given timestamp available */ deltaUntil (timestamp, serviceId) { - return _stateOrNull(PersistenceExtensions.deltaUntil(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.deltaUntil(this.rawItem, ...arguments)); } /** @@ -717,7 +731,7 @@ class ItemPersistence { * if there is no persisted state for the given Item for the given points in time */ deltaBetween (begin, end, serviceId) { - return _stateOrNull(PersistenceExtensions.deltaBetween(this.rawItem, ...arguments)); + return _persistedStateOrNull(PersistenceExtensions.deltaBetween(this.rawItem, ...arguments)); } /** diff --git a/types/items/item-persistence.d.ts b/types/items/item-persistence.d.ts index b86bee89a..7c6f46016 100644 --- a/types/items/item-persistence.d.ts +++ b/types/items/item-persistence.d.ts @@ -1,7 +1,7 @@ export = ItemPersistence; /** * Class representing the historic state of an openHAB Item. - * Wrapping the {@link https://www.openhab.org/javadoc/latest/org/openhab/core/persistence/extensions/persistenceextensions PersistenceExtensions}. + * Wrapping the {@link https://www.openhab.org/javadoc/latest/org/openhab/core/persistence/extensions/persistenceextensions org.openhab.core.persistence.extensions.PersistenceExtensions}. * * Be warned: This class can throw several exceptions from the underlying Java layer. It is recommended to wrap the methods of this class inside a try_catch block! * @@ -527,6 +527,7 @@ declare namespace ItemPersistence { } declare namespace time { type ZonedDateTime = import('@js-joda/core').ZonedDateTime; + type Instant = import('@js-joda/core').Instant; } import time = require("../time"); type Quantity = import('../quantity').Quantity; @@ -536,23 +537,41 @@ declare namespace items { declare const TimeSeries: any; /** * Class representing an instance of {@link https://www.openhab.org/javadoc/latest/org/openhab/core/persistence/historicitem org.openhab.core.persistence.HistoricItem}. - * Extends {@link items.PersistedState}. * + * @extends items.PersistedState * @memberof items * @hideconstructor */ -declare class PersistedItem extends PersistedState { +declare class PersistedItem { + /** + * Create an PersistedItem, wrapping a native openHAB HistoricItem. + * @param {*} rawHistoricItem {@link https://www.openhab.org/javadoc/latest/org/openhab/core/persistence/historicitem org.openhab.core.persistence.HistoricItem} + * @hideconstructor + */ + constructor(rawHistoricItem: any); + rawHistoricItem: any; /** * Timestamp of persisted Item. + * + * Consider using {@link instant} for heavy calculations because it is much faster to work with Instant. * @type {time.ZonedDateTime} */ get timestamp(): JSJoda.ZonedDateTime; - #private; + /** + * Timestamp of the persisted Item as Instant. + * @returns {time.Instant} + */ + get instant(): JSJoda.Instant; + toString(): string; } /** * @typedef {import('@js-joda/core').ZonedDateTime} time.ZonedDateTime * @private */ +/** + * @typedef {import('@js-joda/core').Instant} time.Instant + * @private + */ /** * @typedef {import('../quantity').Quantity} Quantity * @private @@ -569,9 +588,12 @@ declare class PersistedItem extends PersistedState { */ declare class PersistedState { /** - * @param {HostState} rawState + * Create an PersistedState, wrapping a native openHAB HistoricState. + * @param {*} rawHistoricState an instance of {@link https://www.openhab.org/javadoc/latest/org/openhab/core/types/state org.openhab.core.types.State} + * @hideconstructor */ - constructor(rawState: HostState); + constructor(rawHistoricState: any); + rawState: any; /** * String representation of the Item state. * @type {string} @@ -588,6 +610,5 @@ declare class PersistedState { */ get quantityState(): import("../quantity").Quantity; toString(): string; - #private; } //# sourceMappingURL=item-persistence.d.ts.map \ No newline at end of file diff --git a/types/items/item-persistence.d.ts.map b/types/items/item-persistence.d.ts.map index 0fe40edbd..180fea2ee 100644 --- a/types/items/item-persistence.d.ts.map +++ b/types/items/item-persistence.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"item-persistence.d.ts","sourceRoot":"","sources":["../../src/items/item-persistence.js"],"names":[],"mappings":";AAwIA;;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AAa,EAAE,CAI3B;IAED;;;;;;;OAOG;IACH,2BALW,CAAC,KAAK,aAAa,GAAG,IAAI,CAAC,OAC3B,CAAC,KAAK,aAAa,GAAG,IAAI,CAAC,cAC3B,MAAM,mBACJ,aAAa,EAAE,CAI3B;IAED;;;;;;OAMG;IACH,gCAHW,CAAC,KAAK,aAAa,GAAG,IAAI,CAAC,cAC3B,MAAM,uBAIhB;IAED;;;;;;OAMG;IACH,gCAHW,CAAC,KAAK,aAAa,GAAG,IAAI,CAAC,cAC3B,MAAM,uBAIhB;IAED;;;;;;;OAOG;IACH,8BAJW,CAAC,KAAK,aAAa,GAAG,IAAI,CAAC,OAC3B,CAAC,KAAK,aAAa,GAAG,IAAI,CAAC,cAC3B,MAAM,uBAIhB;;CACF;;;;;yBAv3BY,OAAO,eAAe,EAAE,aAAa;;;gBAIrC,OAAO,aAAa,EAAE,QAAQ;;;;AAR3C,8BAAkE;AAuElE;;;;;;GAMG;AACH;IAWE;;;OAGG;IACH,sCAEC;;CAKF;AAjGD;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AAEH;;;;;GAKG;AACH;IAGE;;OAEG;IACH,iCAEC;IAED;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,2BAGC;IAED;;;OAGG;IACH,oDAWC;IAED,mBAEC;;CACF"} \ No newline at end of file +{"version":3,"file":"item-persistence.d.ts","sourceRoot":"","sources":["../../src/items/item-persistence.js"],"names":[],"mappings":";AAsJA;;;;;;;;;;;GAWG;AACH;IACE,0BAEC;IADC,aAAsB;IAGxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,oBALW,CAAC,KAAK,aAAa,GAAG,IAAI,CAAC,UAC3B,MAAM,GAAC,MAAM,GAAC,KAAK,aAAa,GAAC,QAAQ,YAAU,eACnD,gBAAgB,cAChB,MAAM,wBAiChB;IAqDD;;;;;;OAMG;IACH,0BAJW,CAAC,KAAK,aAAa,GAAG,IAAI,CAAC,cAC3B,MAAM,mBACJ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