CShock/CShocker/Shockers/Abstract/HttpShocker.cs
glax 895f8c528d Add PiShockHttp
Change order of instructor variables for HttpShockers
Add default Endpoints for OpenShock and PiShock
2024-01-19 01:32:06 +01:00

24 lines
776 B
C#

using CShocker.Ranges;
using Microsoft.Extensions.Logging;
namespace CShocker.Shockers.Abstract;
public abstract class HttpShocker : Shocker
{
protected readonly HttpClient HttpClient = new();
public string Endpoint { get; init; }
public string ApiKey { get; init; }
protected HttpShocker(List<string> shockerIds, IntensityRange intensityRange, DurationRange durationRange, string apiKey, string endpoint, ShockerApi apiType, ILogger? logger = null) : base(shockerIds, intensityRange, durationRange, apiType, logger)
{
Endpoint = endpoint;
ApiKey = apiKey;
}
public override string ToString()
{
return $"{base.ToString()}\n" +
$"Endpoint: {Endpoint}\n" +
$"ApiKey: {ApiKey}";
}
}