Feature - Allow pages to refresh periodically
I have a use case where I would like to use sunbeam to monitor the status of some events. (e.g., I track events started and not finished and show them in a sunbeam list).
For this use case, I would love the ability to tell sunbeam to "refresh" the page (e.g. call the same command) automatically every x seconds.
Good idea. If you have an idea of what's the api could look like, please post a json snippet as a comment :)
Btw, I plan to create a web client for sunbeam, so it could make a lot of sense (ex: a dashboard composed of multiple sunbeam cards).
I was thinking of something like
{
"title": "My title",
"type": "list",
"autorefresh": 30,
"items": [
{
"title": "title1"
},
{
"title": "title2"
}
]
}
and in that case sunbeam would rerun itself after 30 secs with all the same arguments it used the first time. If it is not possible, then it could be something like (or why not a refresh_time that auto-refreshes if refresh_action is empty).
{
"title": "My title",
"type": "list",
"refresh_time": 30,
"refresh_action" : "sunbeam my_action my_params",
"items": [
{
"title": "title1"
},
{
"title": "title2"
}
]
}