func StrobeEffectFactory(l devices.DimLamp) deviceapi.Effect { return deviceapi.EffectFunc(func(config deviceapi.Config) error { strobeConf, ok := config.(*deviceapi.DelayConfig) if !ok { return errors.New("Not a StrobeConfig") } delay, err := time.ParseDuration(strobeConf.Delay) if err != nil { return err } return l.Stroboscope(delay) }) }