Fix weather announce loop
continuous-integration/drone/tag Build is passing Details
continuous-integration/drone/push Build is passing Details

This commit is contained in:
nemunaire 2022-12-09 10:35:43 +01:00
parent c9596faa78
commit 0ea7bc2a49
1 changed files with 2 additions and 3 deletions

View File

@ -34,7 +34,6 @@ type Player struct {
endRoutines []*reveil.Routine
ntick int64
hasClaironed bool
hasSpokeWeather bool
launched time.Time
volume uint16
@ -170,7 +169,7 @@ loop:
for {
select {
case <-p.currentCmdCh:
if !p.hasClaironed && time.Since(p.launched) >= p.claironTime {
if time.Since(p.launched) >= p.claironTime {
log.Println("clairon time!")
p.claironTime += p.claironTime / 2
p.SetVolume(65535)
@ -178,8 +177,8 @@ loop:
go p.playFile(p.claironFile)
} else if p.weatherAction != nil && !p.hasSpokeWeather && time.Since(p.launched) >= p.weatherTime {
log.Println("weather time!")
p.SetVolume(65535)
p.dontUpdateVolume = true
p.hasSpokeWeather = true
go p.launchAction(p.weatherAction)
} else {
p.dontUpdateVolume = false