just have TimeOfDay and Duration ¯\_(ツ)_/¯

This commit is contained in:
Sam Lewis
2022-10-11 09:52:58 -04:00
parent 7c1e8faa43
commit b3e45f46a4
2 changed files with 22 additions and 14 deletions

View File

@@ -9,15 +9,15 @@ import (
func main() {
app := ga.App("192.168.86.67:8123")
defer app.Cleanup()
s := ga.ScheduleBuilder().Call(lightsOut).Daily().At(ga.Duration(23, 00)).Build()
s2 := ga.ScheduleBuilder().Call(lightsOut).Every(ga.Duration(04, 30)).Offset(ga.Duration(1, 0)).Build()
s := ga.ScheduleBuilder().Call(lightsOut).Daily().At(ga.TimeOfDay(23, 00)).Build()
s2 := ga.ScheduleBuilder().Call(lightsOut).Every(ga.Duration(04, 30)).Offset(ga.TimeOfDay(1, 0)).Build()
app.RegisterSchedule(s2)
app.Start()
simpleListener := ga.EntityListenerBuilder().
EntityId("light.lights").
Call(cool).
OnlyBetween(ga.Duration(22, 00), ga.Duration(07, 00))
OnlyBetween(ga.TimeOfDay(22, 00), ga.TimeOfDay(07, 00))
log.Println(simpleListener)
log.Println(s)