Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update persistence actions docs #2289

Merged
merged 4 commits into from
May 4, 2024

Conversation

mherwege
Copy link
Contributor

Persistence actions have been extended to work with future persisted states in openhab/openhab-core#3736.

This PR extends the documentation to provide a full list of all actions.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Copy link

netlify bot commented Apr 30, 2024

Thanks for your pull request to the openHAB documentation! The result can be previewed at the URL below (this comment and the preview will be updated if you add more commits).

Built without sensitive environment variables

Name Link
🔨 Latest commit 04be502
🔍 Latest deploy log https://app.netlify.com/sites/openhab-docs-preview/deploys/66308fc7a978ac00085ec8a4
😎 Deploy Preview https://deploy-preview-2289--openhab-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 30, 2024

Thanks for your pull request to the openHAB documentation! The result can be previewed at the URL below (this comment and the preview will be updated if you add more commits).

Built without sensitive environment variables

Name Link
🔨 Latest commit 3106251
🔍 Latest deploy log https://app.netlify.com/sites/openhab-docs-preview/deploys/66334aef4bd1a4000881c8d3
😎 Deploy Preview https://deploy-preview-2289--openhab-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@J-N-K
Copy link
Member

J-N-K commented May 1, 2024

@openhab/documentation-maintainers can you ping me when this is ready for merge? I'll merge the core PR then.

Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!
Can you please add some docs about HistoricItem? It is return value but not documented …

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
@mherwege
Copy link
Contributor Author

mherwege commented May 2, 2024

It is return value but not documented …

There was some documentation, but in the Examples section. I moved it up and extended it a bit.

Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, one minor comment left:


Some extensions return a HistoricItem object.
It represents the state of a persisted item at a certain point in time.
The most useful methods of the HistoricItem object returned by some queries, are `.state` and `.getTimestamp`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The most useful methods of the HistoricItem object returned by some queries, are `.state` and `.getTimestamp`
The most useful methods of the HistoricItem object returned by some queries, are `.getState()` and `.getTimestamp()`.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the original text, and would work in DSL I believe. I changed it anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.state and .timestamp should theoretically also work in JS, because in Nashorn compatibility mode of GraalJS access to the properties is possible that way. I guess it’s the same for DSL — but I personally think that using the getters is better style 👍

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thank you very much especially for the core PR!!

@stefan-hoehn Can you please merge?

@@ -232,43 +232,71 @@ Example:

The statement

`Temperature.historicState(now.minusDays(1))`
`Temperature.persistedState(now.minusDays(1))`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you REPLACE historicState with persistedState? Doesn't this break a lot of things? (I am also worried in terms of blockly.

cc @florian-h05

Copy link
Member

@J-N-K J-N-K May 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently both are supported, but historicState is deprecated. The reason is that it can also return future states (if the persistence service supports it).

@stefan-hoehn stefan-hoehn merged commit e0d594d into openhab:main May 4, 2024
5 checks passed
@stefan-hoehn stefan-hoehn added this to the 4.2 milestone May 4, 2024
stefan-hoehn added a commit that referenced this pull request May 19, 2024
* Apply logo for free@home binding

Apply logo for free@home binding

Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>

* [sitemap] New Slider parameter releaseOnly (#2287)

* [saicismart][renault] Add addon SVG logo for Renault and SAIG MG Cars (#2290)

* [saicismart] Add addon logo for MG Cars from https://de.wikipedia.org/wiki/Datei:Mg_logo.svg

Signed-off-by: dougculnane <doug@culnane.net>

* [saicismart] Use SVG not PNG for addon logo

Signed-off-by: dougculnane <doug@culnane.net>

* [renault] Use SVG not PNG for addon logo

Signed-off-by: dougculnane <doug@culnane.net>

---------

Signed-off-by: dougculnane <doug@culnane.net>

* Update persistence actions docs (#2289)

* update persistence actions docs

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>

* correction

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>

* document HistoricItem

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>

* review adjustment

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>

---------

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>

* Update link to update-description-1.0.0.xsd (#2275)

The link for the update-description-1.0.0.xsd is wrong.

Signed-off-by: M Valla <12682715+mvalla@users.noreply.github.com>

* Replace logo of free@home binding with SVG version

Replace logo of free@home binding with SVG version

Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>

* [sitemap] Precision for Default element leading to Slider element (#2294)

Signed-off-by: Laurent Garnier <lg.hc@free.fr>

* [sitemap] Press & release feature for buttons in a switch element (#2293)

Related to openhab/openhab-core#4183 and openhab/openhab-core#3822

Signed-off-by: Laurent Garnier <lg.hc@free.fr>

* [airgradient] Add logo for recently added binding (#2296)

* [airgradient] Add logo for recently added binding

* Add airgradient logo in SVG format

Signed-off-by: Jørgen Austvik <jaustvik@acm.org>

---------

Signed-off-by: Jørgen Austvik <jaustvik@acm.org>

* [multimedia] Add record and transcribe commands (#2295)

* [multimedia] Add record and transcribe commands

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>

* apply pr review

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>

* fix md errors

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>

---------

Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
Co-authored-by: stefan-hoehn <mail@stefanhoehn.com>

* Apply logo for free@home binding

Apply logo for free@home binding

Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>

* Replace logo of free@home binding with SVG version

Replace logo of free@home binding with SVG version

Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>

---------

Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
Signed-off-by: dougculnane <doug@culnane.net>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: M Valla <12682715+mvalla@users.noreply.github.com>
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
Co-authored-by: stefan-hoehn <mail@stefanhoehn.com>
Co-authored-by: mueller-ma <mueller-ma@users.noreply.github.com>
Co-authored-by: Doug Culnane <32482395+dougculnane@users.noreply.github.com>
Co-authored-by: Mark Herwege <mherwege@users.noreply.github.com>
Co-authored-by: M Valla <12682715+mvalla@users.noreply.github.com>
Co-authored-by: lolodomo <lg.hc@free.fr>
Co-authored-by: Jørgen Austvik <jaustvik@acm.org>
Co-authored-by: GiviMAD <GiviMAD@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants