all builders now take duration strings

This commit is contained in:
Sam Lewis
2022-10-16 22:45:13 -04:00
parent 6ca78e88dd
commit 145c12dd25
5 changed files with 31 additions and 40 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"fmt"
"log"
ga "github.com/saml-dev/gome-assistant"
@@ -10,7 +11,10 @@ func main() {
app := ga.NewApp("192.168.86.67:8123")
defer app.Cleanup()
s := ga.ScheduleBuilder().Call(lightsOut).Daily().At(app.Sunset("1h")).Build()
s2 := ga.ScheduleBuilder().Call(lightsOut).Every("2h").Offset("10m").Build()
fmt.Println(s2)
app.RegisterSchedule(s)
app.RegisterSchedule(s2)
simpleListener := ga.EntityListenerBuilder().
EntityIds("group.office_ceiling_lights").
Call(listenerCB).