Skip to content

Commit

Permalink
adjust examples
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Herwege mark.herwege@telenet.be
  • Loading branch information
mherwege committed Aug 26, 2024
1 parent ddf4042 commit 1690a55
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/items/item-persistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ class ItemPersistence {
* Gets the average value of the state of a given Item since a certain point in time.
*
* @example
* var yesterday = new Date(new Date().getTime() - (24 * 60 * 60 * 1000));
* var yesterday = time.toZDT().minusDays(1);
* var item = items.getItem('KitchenDimmer');
* console.log('KitchenDimmer average since yesterday', item.persistence.averageSince(yesterday));
*
Expand Down Expand Up @@ -606,7 +606,7 @@ class ItemPersistence {
* Gets the median value of the state of a given Item since a certain point in time.
*
* @example
* var yesterday = new Date(new Date().getTime() - (24 * 60 * 60 * 1000));
* var yesterday = time.toZDT().minusDays(1);
* var item = items.getItem('KitchenDimmer');
* console.log('KitchenDimmer median since yesterday', item.persistence.medianSince(yesterday));
*
Expand Down
16 changes: 8 additions & 8 deletions types/items/item-persistence.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ declare class ItemPersistence {
* Gets the average value of the state of a given Item since a certain point in time.
*
* @example
* var yesterday = new Date(new Date().getTime() - (24 * 60 * 60 * 1000));
* var yesterday = time.toZDT().minusDays(1);
* var item = items.getItem('KitchenDimmer');
* console.log('KitchenDimmer average since yesterday', item.persistence.averageSince(yesterday));
*
Expand Down Expand Up @@ -309,7 +309,7 @@ declare class ItemPersistence {
* Gets the median value of the state of a given Item since a certain point in time.
*
* @example
* var yesterday = new Date(new Date().getTime() - (24 * 60 * 60 * 1000));
* var yesterday = time.toZDT().minusDays(1);
* var item = items.getItem('KitchenDimmer');
* console.log('KitchenDimmer median since yesterday', item.persistence.medianSince(yesterday));
*
Expand All @@ -336,12 +336,12 @@ declare class ItemPersistence {
*/
medianBetween(begin: (time.ZonedDateTime | Date), end: (time.ZonedDateTime | Date), serviceId?: string, ...args: any[]): (PersistedState | null);
/**
* Gets the sum of the states of a given Item since a certain point in time.
*
* @param {(time.ZonedDateTime | Date)} timestamp the point in time from which to start the summation
* @param {string} [serviceId] optional persistence service ID, if omitted, the default persistence service will be used
* @returns {(PersistedState | null)} the sum of the state values since <code>timestamp</code> as {@link items.PersistedState}, or null if <code>timestamp</code> is in the future
*/
* Gets the sum of the states of a given Item since a certain point in time.
*
* @param {(time.ZonedDateTime | Date)} timestamp the point in time from which to start the summation
* @param {string} [serviceId] optional persistence service ID, if omitted, the default persistence service will be used
* @returns {(PersistedState | null)} the sum of the state values since <code>timestamp</code> as {@link items.PersistedState}, or null if <code>timestamp</code> is in the future
*/
sumSince(timestamp: (time.ZonedDateTime | Date), serviceId?: string, ...args: any[]): (PersistedState | null);
/**
* Gets the sum of the states of a given Item until a certain point in time.
Expand Down
2 changes: 1 addition & 1 deletion types/items/item-persistence.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1690a55

Please sign in to comment.