Start routine at wakeup end
This commit is contained in:
parent
1def1ff67a
commit
e1f5fbcd6c
7 changed files with 101 additions and 16 deletions
4
app.go
4
app.go
|
|
@ -80,11 +80,11 @@ func (app *App) ResetTimer() {
|
|||
app.nextAlarm = nil
|
||||
}
|
||||
|
||||
if na, err := reveil.GetNextAlarm(app.cfg, app.db); err == nil && na != nil {
|
||||
if na, routines, err := reveil.GetNextAlarm(app.cfg, app.db); err == nil && na != nil {
|
||||
app.nextAlarm = time.AfterFunc(time.Until(*na), func() {
|
||||
app.nextAlarm = nil
|
||||
reveil.RemoveOldAlarmsSingle(app.db)
|
||||
err := player.WakeUp(app.cfg)
|
||||
err := player.WakeUp(app.cfg, routines)
|
||||
if err != nil {
|
||||
log.Println(err.Error())
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue