Skip to content

Commit 989c296

Browse files
committed
Add weather channel attribution.
Signed-off-by: Katharine Berry <[email protected]>
1 parent 9f5289c commit 989c296

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

service/assistant/functions/weather.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func processDailyForecast(ctx context.Context, lat, lon float64, units string) a
158158
}
159159
}
160160
response["temperatureUnit"] = forecast.TemperatureUnit
161-
//response["source"] = "The Weather Channel"
161+
response["attribution"] = "The Weather Channel"
162162
return response
163163
}
164164

@@ -188,7 +188,11 @@ func processHourlyForecast(ctx context.Context, lat, lon float64, units string)
188188
response = append(response, entry)
189189
}
190190
// the thing that is returned must not be an array.
191-
return map[string]any{"response": response, "temperatureUnit": hourly.TemperatureUnit}
191+
return map[string]any{
192+
"response": response,
193+
"temperatureUnit": hourly.TemperatureUnit,
194+
"attribution": "The Weather Channel",
195+
}
192196
}
193197

194198
func processCurrentWeather(ctx context.Context, lat, lon float64, units string) any {

service/assistant/util/weather/weather.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ func GetCurrentConditions(ctx context.Context, lat, lon float64, units string) (
9797
}
9898
conditions.WindSpeedUnit = mapWindSpeedUnit(units)
9999
conditions.TemperatureUnit = mapTemperatureUnit(units)
100+
conditions.Attribution = "The Weather Channel"
100101
return &conditions, nil
101102
}
102103

@@ -196,6 +197,7 @@ type CurrentConditions struct {
196197
WindGust int `json:"windGust"`
197198
Description string `json:"wxPhraseLong"`
198199
IconCode int `json:"iconCode"`
200+
Attribution string `json:"attribution"`
199201
}
200202

201203
type HourlyForecast struct {

0 commit comments

Comments
 (0)