mirror of
https://github.com/acaloiaro/roam-location
synced 2026-07-21 18:29:11 +00:00
feat(weather): log temperature and station type on data report push
This commit is contained in:
parent
ef7c36af37
commit
5dae01b00f
1 changed files with 7 additions and 0 deletions
|
|
@ -80,6 +80,13 @@ func Listen(getLocation func() (lat, lon float64, name string, ok bool), wCache
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wCache.Update(r)
|
wCache.Update(r)
|
||||||
|
if data, ok := wCache.Get(); ok {
|
||||||
|
tempStr := "n/a"
|
||||||
|
if data.TempF != nil {
|
||||||
|
tempStr = fmt.Sprintf("%.1f°F", *data.TempF)
|
||||||
|
}
|
||||||
|
log.Printf("weather update received: temp=%s station=%s", tempStr, data.StationType)
|
||||||
|
}
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue