https://github.com/lordmike/mbw.client.blueriiotapi
Client implementation for parts of the Blue Riiot pool sensor API
https://github.com/lordmike/mbw.client.blueriiotapi
blueriiot pool reverse-engineered
Last synced: about 1 year ago
JSON representation
Client implementation for parts of the Blue Riiot pool sensor API
- Host: GitHub
- URL: https://github.com/lordmike/mbw.client.blueriiotapi
- Owner: LordMike
- Created: 2020-04-27T20:20:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-19T21:14:50.000Z (over 2 years ago)
- Last Synced: 2025-03-29T19:47:41.528Z (about 1 year ago)
- Topics: blueriiot, pool, reverse-engineered
- Language: C#
- Homepage:
- Size: 78.1 KB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MBW.Client.BlueRiiotAPI
[](https://github.com/LordMike/MBW.Client.BlueRiiotApi/actions/workflows/dotnet.yml) [](https://nuget.org/packages/MBW.Client.BlueRiiotAPI)
Reverse engineered client library for Blue Riiots pool API.
## Basic usage
```csharp
var bc = new BlueClientBuilder()
.UseUsernamePassword("user", "pass")
.Build();
var pools = await bc.GetSwimmingPools();
```
## Using an HTTP Client Factory
```csharp
var bc = new BlueClientBuilder()
.UseHttpClientFactory(myFactory)
...
```
## Using an HTTP proxy
```csharp
var bc = new BlueClientBuilder()
// Add a special HttpClient to control the proxy
.UseHttpClient(new HttpClient(new SocketsHttpHandler
{
// Set a proxy if available. Suggestion: Fiddler.
Proxy = new WebProxy(new Uri("http://127.0.0.1:8888"))
}))
...
```
## Using Microsoft DI
```csharp
services
// Note: the AddHttpClient() call is not necessary, but it is possibly to again configure the client here
.AddHttpClient("blueriiot")
.AddBlueRiiot((provider, builder) =>
{
IHttpClientFactory httpFactory = provider.GetRequiredService();
// Set required options on the BlueClientBuilder
builder
.UseUsernamePassword(config.Username, config.Password)
// Only necessary if a special HttpClientFactory name is needed
.UseHttpClientFactory(httpFactory, "blueriiot");
})
// Usage
var bc = serviceProvider.GetService();
var pools = await bc.GetSwimmingPools();
```
# Note on logging
The library uses Microsofts logging extensions. It is possible to log all requests (and responses), by enabling Trace logging for `MBW.Client.BlueRiiotApi.BlueClient`.
```csharp
services.AddLogging(builder =>
{
builder.AddFilter("MBW.Client.BlueRiiotApi.BlueClient", LogLevel.Trace);
});
```