forked from Elara6331/itd
Add enable switch for weather to config
This commit is contained in:
parent
4bdb82b1bc
commit
c08ddfd810
1
itd.toml
1
itd.toml
@ -27,4 +27,5 @@
|
|||||||
vol.interval = 5
|
vol.interval = 5
|
||||||
|
|
||||||
[weather]
|
[weather]
|
||||||
|
enabled = true
|
||||||
location = "Los Angeles, CA"
|
location = "Los Angeles, CA"
|
@ -61,6 +61,10 @@ type OSMData []struct {
|
|||||||
var sendWeatherCh = make(chan struct{}, 1)
|
var sendWeatherCh = make(chan struct{}, 1)
|
||||||
|
|
||||||
func initWeather(dev *infinitime.Device) error {
|
func initWeather(dev *infinitime.Device) error {
|
||||||
|
if !k.Bool("weather.enabled") {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Get location based on string in config
|
// Get location based on string in config
|
||||||
lat, lon, err := getLocation(k.String("weather.location"))
|
lat, lon, err := getLocation(k.String("weather.location"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user