mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-06 23:15:09 -06:00
just have TimeOfDay and Duration ¯\_(ツ)_/¯
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user