Skip to content

Instantly share code, notes, and snippets.

@kubawolanin
Created January 12, 2018 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kubawolanin/0f3fe20e9cb108cc07126ab7f8a1951f to your computer and use it in GitHub Desktop.
Save kubawolanin/0f3fe20e9cb108cc07126ab7f8a1951f to your computer and use it in GitHub Desktop.
Random HABPanel display each 10 seconds
import java.util.Random
val dashboardList = newArrayList(
"Innovation Lab",
"Octoprint",
"Etc"
)
val Random random = new Random()
rule "Set random dashboard"
when
Time cron "/10 * * * * ?"
then
val dashboardName = dashboardList.get(random.nextInt(dashboardList.length))
postUpdate(HABPanel, dashboardName)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment