switched to time.Duration

This commit is contained in:
Sam Lewis
2022-10-11 02:17:02 -04:00
parent 44678ae762
commit 911c3521ba
4 changed files with 34 additions and 47 deletions
+5 -3
View File
@@ -1,19 +1,21 @@
package gomeassistant
import "time"
type entityListener struct {
entityId string
callback entityListenerCallback
fromState string
toState string
betweenStart timeOfDay
betweenEnd timeOfDay
betweenStart time.Duration
betweenEnd time.Duration
}
type entityListenerCallback func(Service, Data)
type Data struct{}
func (b elBuilder3) OnlyBetween(start timeOfDay, end timeOfDay) elBuilder3 {
func (b elBuilder3) OnlyBetween(start time.Duration, end time.Duration) elBuilder3 {
b.entityListener.betweenStart = start
b.entityListener.betweenEnd = end
return b