Implement weather via MET Norway

This commit is contained in:
2022-02-21 16:18:52 -08:00
parent 4b2694ee0d
commit b4d302caf6
6 changed files with 299 additions and 5 deletions

10
main.go
View File

@@ -19,20 +19,23 @@
package main
import (
_ "embed"
"fmt"
"os"
"strconv"
"time"
"github.com/gen2brain/dlgs"
"github.com/knadh/koanf"
"github.com/mattn/go-isatty"
"github.com/rs/zerolog/log"
"go.arsenm.dev/infinitime"
"github.com/knadh/koanf"
)
var k = koanf.New(".")
//go:embed version.txt
var version string
var (
firmwareUpdating = false
@@ -78,7 +81,10 @@ func main() {
}
}
// FS must be updated on reconnect
updateFS = true
// Resend weather on reconnect
sendWeatherCh <- struct{}{}
}
// Get firmware version
@@ -123,6 +129,8 @@ func main() {
log.Error().Err(err).Msg("Error initializing notification relay")
}
initWeather(dev)
// Start control socket
err = startSocket(dev)
if err != nil {