mirror of
https://github.com/sstent/go-garth.git
synced 2026-01-26 09:03:00 +00:00
sync - build broken
This commit is contained in:
34
python-garmin-connect/ActivityWeather.go
Normal file
34
python-garmin-connect/ActivityWeather.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package connect
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// ActivityWeather describes the weather during an activity.
|
||||
type ActivityWeather struct {
|
||||
Temperature int `json:"temp"`
|
||||
ApparentTemperature int `json:"apparentTemp"`
|
||||
DewPoint int `json:"dewPoint"`
|
||||
RelativeHumidity int `json:"relativeHumidity"`
|
||||
WindDirection int `json:"windDirection"`
|
||||
WindDirectionCompassPoint string `json:"windDirectionCompassPoint"`
|
||||
WindSpeed int `json:"windSpeed"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
}
|
||||
|
||||
// ActivityWeather returns the reported weather for an activity.
|
||||
func (c *Client) ActivityWeather(activityID int) (*ActivityWeather, error) {
|
||||
URL := fmt.Sprintf("https://connect.garmin.com/modern/proxy/weather-service/weather/%d",
|
||||
activityID,
|
||||
)
|
||||
|
||||
weather := new(ActivityWeather)
|
||||
|
||||
err := c.getJSON(URL, weather)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return weather, nil
|
||||
}
|
||||
Reference in New Issue
Block a user