Documentation
¶
Index ¶
- func NewCheckCron(creator CheckCreator, runner ChecksRunner, interval time.Duration) run.Func
- type Check
- func Func(name string, satisfied func(ctx context.Context) (bool, error), ...) Check
- func NewAlternateSwitch(now time.Time, mainDuration time.Duration, secondDuration time.Duration, ...) Check
- func NewBetweenMinuteSwitch(now time.Time, fromMinute, untilMinute int, main, fallback Check) Check
- func NewBetweenTimeSwitch(now time.Time, from, until pkg.TimeOfDay, main, fallback Check) Check
- func NewLightIsOff(bridge *huego.Bridge, lightName pkg.LightName) Check
- func NewLightIsOn(bridge *huego.Bridge, lightName pkg.LightName) Check
- func NewSwitch(fn func() bool, main, fallback Check) Check
- type CheckCreator
- type Checks
- type ChecksRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCheckCron ¶
func NewCheckCron( creator CheckCreator, runner ChecksRunner, interval time.Duration, ) run.Func
Types ¶
type Check ¶
type Check interface {
Apply(ctx context.Context) error
Satisfied(ctx context.Context) (bool, error)
Name() string
}
Check is something is in the right state
func NewAlternateSwitch ¶
func NewBetweenMinuteSwitch ¶
func NewBetweenTimeSwitch ¶
NewBetweenTimeSwitch turns on main between the given hours and fallback if not
type CheckCreator ¶
func NewCheckCreator ¶
func NewCheckCreator( provider pkg.BridgesProvider, summerMode bool, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) CheckCreator
type ChecksRunner ¶
func NewChecksRunner ¶
func NewChecksRunner() ChecksRunner
Click to show internal directories.
Click to hide internal directories.