A .NET Core (Standard 2.0 compatible) wrapper library for API of the popular PVOutput service. PVOutput is a free service for sharing and comparing PV output data.
Installation can be done through installation of the NuGet package:
PM> Install-Package PVOutput.Net
See Changelog for information on changes per version, including coming but yet unreleased changes.
This library is targeting .NET Standard 2.0 and above. For full compatibility details, check the Microsoft Docs.
Please note: that the default branch of the repository is develop
. This means that it can contain bugfixes/features that are not yet available in the NuGet package.
See main for the source code, that was used for building the NuGet package.
This section describes examples of functionality that the library provides.
var client = new PVOutputClient(apiKey: "myPvOutputKey", ownedSystemId: 1);
// Request output for today
var outputResponse = await client.Output.GetOutputForDateAsync(DateTime.Today);
var output = outputResponse.Value;
Console.WriteLine($"Output for date {output.OutputDate.ToShortDateString()}, {output.EnergyGenerated} Wh generated");
var client = new PVOutputClient(apiKey: "myPvOutputKey", ownedSystemId: 1);
var builder = new StatusPostBuilder<IStatusPost>();
// Build the status
var status = builder.SetTimeStamp(DateTime.Now)
.SetGeneration(200)
.Build();
// Push the status back to PVOutput
var response = await client.Status.AddStatusAsync(status);
public void ConfigureServices(IServiceCollection services)
{
services.AddPVOutputClient(options =>
{
options.ApiKey = "myPvOutputKey";
options.OwnedSystemId = 1;
});
}
For more information on usage, please see the documentation.
As of 0.8.0 this library contains the complete public API that official PVOutput exposes. See documentation for details.
See Contributing for information on how to contribute to this project.
As the whole solution has all that dotnet magic, you can just run:
dotnet build
to build the solution as a whole or a single project.
Running the Nunit tests can also be done from the cli, just run:
dotnet test
This project's structure and Request handling have been seriously inspired (in part, copied even) by Henrik Fröhling's work on Trakt.NET, when it was still called TraktApiSharp. While this project is licensed under the same license as Trakt.NET, I'd still like to make this absolutely clear.
MIT © Marcel Boersma