Skip to content

Commit

Permalink
[blockly] Persistence: Enhance existing blocks & add blocks to cover …
Browse files Browse the repository at this point in the history
…all available actions (#2596)

Closes #2595.

This PR further extends the Blockly capabilities to include more of the persistence extensions.

Specifically enhanced the `oh_get_persistvalue` block:
- Add all `Between` methods of already existing methods
- Add `countSince`, `countUntil` and `countBetween`
- Add `countStateChangesSince`, `countStateChangesUntil` and `countStateChangesBetween`
- Add `getAllStatesSince`, `getAllStatesUntil`, `getAllStatesBetween` returning an Array of timestamp and state pairs
- Add a parameter for return type if relevant (`String`, `Number`, `Quantity`, `Timestamp`).

Added methods to the `oh_get_persistence_lastupdate` block:
- `lastChange`, `nextChange`

Created a new block `oh_delete_persistedvalues` to delete persisted values:
- `deleteAllStatesSince`, `deleteAllStatesUntil`, `deleteAllStatesBetween`

Created a new block `oh_persist` to persist values:
- `currentState`: persists a state at the current time
- `stateAt`: persists a state to a given time
- `stateList`: persists a TimeSeries

---------

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
  • Loading branch information
mherwege committed Jun 29, 2024
1 parent 32688a5 commit 2d935d6
Show file tree
Hide file tree
Showing 2 changed files with 573 additions and 69 deletions.
Loading

0 comments on commit 2d935d6

Please sign in to comment.