Compare commits

...

2 Commits

Author SHA1 Message Date
0ea7bc2a49 Fix weather announce loop
All checks were successful
continuous-integration/drone/tag Build is passing
continuous-integration/drone/push Build is passing
2022-12-09 10:35:43 +01:00
c9596faa78 Improve responsiveness of home screen 2022-12-08 22:09:19 +01:00
3 changed files with 8 additions and 7 deletions

View File

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

View File

@ -29,7 +29,7 @@
/> />
<div class="flex-fill d-flex flex-column bg-light"> <div class="flex-fill d-flex flex-column bg-light">
<slot></slot> <slot></slot>
<div class="d-flex d-lg-none mt-1 mb-4"></div> <div class="d-flex d-lg-none mt-3 mb-5"></div>
</div> </div>
<Toaster /> <Toaster />
<Header <Header

View File

@ -114,10 +114,11 @@
<div class="d-flex gap-3 justify-content-center"> <div class="d-flex gap-3 justify-content-center">
<a <a
href="alarms/single/new" href="alarms/single/new"
class="btn btn-primary" title="Programmer un nouveau réveil"
class="btn btn-primary d-flex align-items-center justify-content-center gap-2"
> >
<Icon name="node-plus" /> <Icon name="node-plus" />
Programmer un nouveau réveil Programmer <span class="d-none d-lg-inline">un nouveau réveil</span>
</a> </a>
<button <button
class="btn btn-info" class="btn btn-info"
@ -135,10 +136,11 @@
</button> </button>
<button <button
class="btn btn-outline-warning" class="btn btn-outline-warning"
title="Lancer le réveil"
on:click={() => { runAlarm(); reloadIsActiveAlarm(); }} on:click={() => { runAlarm(); reloadIsActiveAlarm(); }}
> >
<Icon name="play-circle" /> <Icon name="play-circle" />
Lancer le réveil Lancer <span class="d-none d-lg-inline">le réveil</span>
</button> </button>
</div> </div>
{:else} {:else}