Skip to content

Instantly share code, notes, and snippets.

@ersin-ertan
Created September 1, 2023 02:22
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 ersin-ertan/9f28836941e7fe47d1d08057f97711d5 to your computer and use it in GitHub Desktop.
Save ersin-ertan/9f28836941e7fe47d1d08057f97711d5 to your computer and use it in GitHub Desktop.
Update the light every second
val pre = """
- type: device.command.ColorAbsolute
color:
spectrumRGB: """
val post = """
devices: Light strip - myRm
- type: time.delay
for: 1 sec"""
var counter = 194
var secPerDay = 86400;
var secPerDay_ = 2;
fun main() {
repeat(secPerDay_) { index ->
print(pre + (counter * index).toString() + post)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment