Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/OpenWeatherMapSharp/Models/ForecastItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,33 @@ public class ForecastItem
[JsonIgnore]
public DateTime Date
=> DateUnix.ToDateTime();

/// <summary>
/// Weather icon URL (default size).
/// </summary>
[JsonIgnore]
public string Icon
=> $"https://openweathermap.org/img/wn/{WeatherInfos?[0]?.Icon}.png";

/// <summary>
/// Weather icon URL (2x resolution).
/// </summary>
[JsonIgnore]
public string Icon2x
=> $"https://openweathermap.org/img/wn/{WeatherInfos?[0]?.Icon}@2x.png";

/// <summary>
/// Weather icon URL (4x resolution).
/// </summary>
[JsonIgnore]
public string Icon4x
=> $"https://openweathermap.org/img/wn/{WeatherInfos?[0]?.Icon}@4x.png";

/// <summary>
/// Weather icon name.
/// </summary>
[JsonIgnore]
public string IconName
=> WeatherInfos?[0]?.Icon;
}
}
4 changes: 2 additions & 2 deletions src/OpenWeatherMapSharp/OpenWeatherMapSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>OpenWeatherMapSharp</Title>
<Version>4.0.1</Version>
<Version>4.1.0</Version>
<Authors>Thomas Sebastian Jensen</Authors>
<Company>tsjdev-apps.de</Company>
<Description>An unofficial .NET API wrapper for OpenWeatherMap.org</Description>
Expand All @@ -15,7 +15,7 @@
<PackageIcon>icon.png</PackageIcon>
<PackageTags>OpenWeatherMap; Api; Mock; Wrapper; free; Weather</PackageTags>
<PackageReleaseNotes>
- Fix icon urls
- Add icon urls to ForecastItem
</PackageReleaseNotes>
<NeutralLanguage>en</NeutralLanguage>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
Loading