Skip to content

Commit

Permalink
[fix] 修复Open-Meteo数据源无法推送通知的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zxbmmmmmmmmm committed Aug 24, 2024
1 parent ec73470 commit 5e1238b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions FluentWeather.OpenMeteoProvider/Mappers/DailyForecastMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ public static OpenMeteoDailyForecast MapToOpenMeteoDailyForecast(this DailyForec
return new OpenMeteoDailyForecast
{
//Description = WeatherCodeHelper.GetWeatherDescription(item.WeatherCode!.Value),
WeatherType = WeatherCodeHelper.GetWeatherType(item.WeatherCode!.Value),
WindDirection = UnitConverter.GetWindDirectionFromAngle(item.WindDirection10mDominant!.Value),
WindSpeed = (int)Math.Round(item.WindSpeed10mMax!.Value),
WindScale = UnitConverter.GetWindScaleFromKM((int)Math.Round(item.WindSpeed10mMax!.Value)).ToString(),
WeatherType = WeatherCodeHelper.GetWeatherType(item.WeatherCode.GetValueOrDefault()),
WindDirection = UnitConverter.GetWindDirectionFromAngle(item.WindDirection10mDominant.GetValueOrDefault()),
WindSpeed = (int)Math.Round(item.WindSpeed10mMax.GetValueOrDefault()),
WindScale = UnitConverter.GetWindScaleFromKM((int)Math.Round(item.WindSpeed10mMax.GetValueOrDefault())).ToString(),
//Humidity = int.Parse(item.),
MaxTemperature = (int)Math.Round(item.Temperature2mMax!.Value),
MinTemperature = (int)Math.Round(item.Temperature2mMin!.Value),
MaxTemperature = (int)Math.Round(item.Temperature2mMax.GetValueOrDefault()),
MinTemperature = (int)Math.Round(item.Temperature2mMin.GetValueOrDefault()),
//Pressure = int.Parse(item),
Time = item.Time!.Value,
//Visibility = int.Parse(item.),
Expand Down
2 changes: 1 addition & 1 deletion FluentWeather.Tasks/NotifyTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async void Run(IBackgroundTaskInstance taskInstance)

if(Settings.ProviderConfig is Uwp.Shared.ProviderConfig.QWeather)
{
var provider = new QWeatherProvider(Settings.QWeatherToken, Settings.QWeatherDomain, null, Settings.QWeatherPublicId);
var provider = new QWeatherProvider();
_warningProvider = provider;
_currentWeatherProvider = provider;
_dailyForecastProvider = provider;
Expand Down

0 comments on commit 5e1238b

Please sign in to comment.