send console data to gotify
This commit is contained in:
parent
e014128ddc
commit
41811ef2c0
@ -27,7 +27,13 @@ var httpClientFactory = app.Services.GetService<IHttpClientFactory>();
|
|||||||
|
|
||||||
var httpClient = httpClientFactory.CreateClient();
|
var httpClient = httpClientFactory.CreateClient();
|
||||||
var apiUrl = configuration["ApiUrl"];
|
var apiUrl = configuration["ApiUrl"];
|
||||||
|
var gotifyUrl = configuration["GotifyUrl"];
|
||||||
|
|
||||||
var weatherSet = await httpClient.GetFromJsonAsync<WeatherSet>(apiUrl);
|
var weatherSet = await httpClient.GetFromJsonAsync<WeatherSet>(apiUrl);
|
||||||
|
|
||||||
Console.WriteLine(weatherSet.Current.ConditionName);
|
var notificationResponse = await httpClient.PostAsJsonAsync(gotifyUrl, new
|
||||||
|
{
|
||||||
|
title = "Weather Conditions",
|
||||||
|
message = $"{weatherSet.Current.ConditionName} and {weatherSet.Current.Temperature} degrees",
|
||||||
|
priority = 5
|
||||||
|
});
|
@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"ApiUrl": "https://weather.binarydad.com/api"
|
"ApiUrl": "https://weather.binarydad.com/api",
|
||||||
|
"GotifyUrl": "https://push.binarydad.com/message?token=AaYB_oOYlFz1nnp"
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user