SmartHome.SDK.Fibaro
0.2.2
See the version list below for details.
dotnet add package SmartHome.SDK.Fibaro --version 0.2.2
NuGet\Install-Package SmartHome.SDK.Fibaro -Version 0.2.2
<PackageReference Include="SmartHome.SDK.Fibaro" Version="0.2.2" />
<PackageVersion Include="SmartHome.SDK.Fibaro" Version="0.2.2" />
<PackageReference Include="SmartHome.SDK.Fibaro" />
paket add SmartHome.SDK.Fibaro --version 0.2.2
#r "nuget: SmartHome.SDK.Fibaro, 0.2.2"
#:package SmartHome.SDK.Fibaro@0.2.2
#addin nuget:?package=SmartHome.SDK.Fibaro&version=0.2.2
#tool nuget:?package=SmartHome.SDK.Fibaro&version=0.2.2
SmartHome.SDK.Fibaro
A lightweight .NET client SDK for Fibaro/Home Center REST API.
Install
NuGet package name: SmartHome.SDK.Fibaro
Install-Package SmartHome.SDK.Fibaro
Quickstart
using Microsoft.Extensions.DependencyInjection;
using SmartHome.SDK.Fibaro.Interfaces;
using SmartHome.SDK.Fibaro.Services;
var services = new ServiceCollection();
// Basic auth (recommended for Fibaro/Home Center)
services.AddFibaroClient(o =>
{
o.BaseAddress = new Uri("https://your-home-center/api/");
o.Username = "apiuser";
o.Password = "apipass";
});
var provider = services.BuildServiceProvider();
var client = provider.GetRequiredService<IFibaroClient>();
var devices = await client.GetDevicesAsync();
await client.ExecuteActionAsync(123, "turnOn");
Device actions (Basic auth)
- Execute an action from code (turnOn, setValue): see
docs/usage-examples.md
. - Run an action from the console example using env vars: see
docs/try-it.md
.
Features
- HttpClient-based, DI-friendly typed client
- Authentication: Bearer token or Basic
- Error handling with
FibaroApiException
(status code + payload) - Models mapped with
System.Text.Json
API Surface
Task<IReadOnlyList<Device>> GetDevicesAsync(CancellationToken ct = default)
Task<Device?> GetDeviceAsync(int deviceId, CancellationToken ct = default)
Task ExecuteActionAsync(int deviceId, string action, object? parameters = null, CancellationToken ct = default)
Task DeleteDeviceAsync(int deviceId, CancellationToken ct = default)
Task<IReadOnlyList<Device>> FilterDevicesAsync(DeviceListFiltersDto filters, CancellationToken ct = default)
Task<Device> UpdateDeviceAsync(int deviceId, Device device, CancellationToken ct = default)
Task ExecuteGroupActionAsync(string actionName, GroupActionArguments args, CancellationToken ct = default)
Task AddInterfacesToDevicesAsync(DevicesInterfacesDto request, CancellationToken ct = default)
Task DeleteInterfacesFromDevicesAsync(DevicesInterfacesDto request, CancellationToken ct = default)
Task<Device> AddPollingInterfaceAsync(int deviceId, CancellationToken ct = default)
Task<Device> DeletePollingInterfaceAsync(int deviceId, CancellationToken ct = default)
Task DeleteDelayedActionAsync(long timestamp, int id, CancellationToken ct = default)
Task ExecuteActionOnSlaveAsync(string slaveUuid, int deviceId, string action, object? parameters = null, CancellationToken ct = default)
Task DeleteDeviceOnSlaveAsync(string slaveUuid, int deviceId, CancellationToken ct = default)
Task<DeviceTypeHierarchy> GetDevicesHierarchyAsync(CancellationToken ct = default)
Task<IReadOnlyList<DeviceInfoDto>> GetUiDeviceInfoAsync(UiDeviceInfoQuery? query = null, CancellationToken ct = default)
Testing
Project includes xUnit + Moq tests. To run:
# From repo root
Dotnet restore
Dotnet build -c Release
Dotnet test .\tests\SmartHome.SDK.Fibaro.Tests\SmartHome.SDK.Fibaro.Tests.csproj -c Release
Packaging
Pack the library (README and XML docs included):
Dotnet pack .\SmartHome.SDK.Fibaro.csproj -c Release
CI/CD
This repo includes a GitHub Actions workflow to build/test on push and publish on version tags. Configure the secret NUGET_API_KEY
in your repository settings.
Documentation
See the docs/
folder:
docs/getting-started.md
– install and first requestdocs/authentication.md
– Basic and Bearer setupdocs/endpoints.md
– full API surfacedocs/usage-examples.md
– cookbookdocs/error-handling.md
– FibaroApiException and patternsdocs/testing-and-ci.md
– tests and CIdocs/troubleshooting.md
– common issuesdocs/versioning.md
– release processdocs/try-it.md
– quick run example
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 is compatible. 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 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.Http (>= 9.0.0)
-
net8.0
- Microsoft.Extensions.Http (>= 9.0.0)
-
net9.0
- Microsoft.Extensions.Http (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v0.2.2: Documentation updates (README tweaks, examples). v0.2.1: Documentation polish (Basic-auth action examples, console env-var action run), README links. v0.2.0: Devices API coverage (filter, update, delete, actions, group, delayed, interfaces, polling, slave proxy, hierarchy, uiDeviceInfo); viewVersion overloads; docs and tests.