-
-
Notifications
You must be signed in to change notification settings - Fork 695
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
Conversation
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
✅ 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
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ 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
To edit notification comments on pull requests, go to your Netlify site configuration. |
@openhab/documentation-maintainers can you ping me when this is ready for merge? I'll merge the core PR then. |
There was a problem hiding this 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>
There was some documentation, but in the Examples section. I moved it up and extended it a bit. |
There was a problem hiding this 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:
configuration/persistence.md
Outdated
|
||
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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()`. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
There was a problem hiding this 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))` |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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).
* 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>
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.