Fix weather announce loop
This commit is contained in:
parent
c9596faa78
commit
0ea7bc2a49
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user