HomeFrontCommand 5.0.2
dotnet add package HomeFrontCommand --version 5.0.2
NuGet\Install-Package HomeFrontCommand -Version 5.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HomeFrontCommand" Version="5.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HomeFrontCommand" Version="5.0.2" />
<PackageReference Include="HomeFrontCommand" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HomeFrontCommand --version 5.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HomeFrontCommand, 5.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HomeFrontCommand@5.0.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HomeFrontCommand&version=5.0.2
#tool nuget:?package=HomeFrontCommand&version=5.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
HomeFrontCommandLibrary
HomeFrontCommandLibrary is a .NET library for retrieving alerts published by Israel's Home Front Command. It provides access to current alerts, alert history, category metadata, and city metadata with translations in Hebrew, English, Russian, and Arabic.
Installation
dotnet add package HomeFrontCommand --version 5.0.2
Requirements
- .NET 8.0
Quick Start
using HomeFrontCommandLibrary;
var command = new HomeFrontCommand();
var activeAlert = await command.GetActiveAlert();
if (activeAlert.Category is not null && activeAlert.Cities is not null)
{
Console.WriteLine($"Category (EN): {activeAlert.Category.Title.English}");
foreach (var city in activeAlert.Cities)
{
Console.WriteLine($"City: {city.Name.English} ({city.ProtectionTime}s)");
}
}
var history = await command.GetAlertsHistory();
Console.WriteLine($"History records: {history.Count}");
Public API
HomeFrontCommand exposes the following methods:
Task<Alert> GetActiveAlert()Task<List<AlertHistory>> GetAlertsHistory()Task<City> GetCityByName(string name)Task<Category> GetCategoryByName(string name)List<City> GetAllCities()Task<Alert> GetActiveAlertExample(string categoryName)
Notes
GetActiveAlert()returns an object withCategory = nullandCities = nullwhen there is no active alert.GetAllCities()returns the current in-memory cache of cities.- City data includes polygon coordinates via
City.Polygons.
Data Models
Alert
string? IdCategory? CategoryList<City>? CitiesDateTime AlertDate
AlertHistory
Category CategoryCity CityDateTime AlertDate
Category
int Idint MatrixIdCategoryTitle TitleCategoryDescription Description
City
int Idint AreaIdCityName NameReshutName ReshutAreaTitle AreaNameint ProtectionTimeList<List<GeoCoordinate>> Polygons
Multi-language Fields
The following model properties include translations in all supported languages:
Category.TitleCategory.DescriptionCity.NameCity.ReshutCity.AreaName
Supported fields in each translation object:
HebrewEnglishRussianArabic
Dependencies
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.Extensions.Caching.Memory (>= 9.0.6)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.