Added list of shockerIds to abstract class Shocker

This commit is contained in:
glax 2024-01-13 23:54:15 +01:00
parent ae278b402e
commit 4b90db389d

View File

@ -2,13 +2,20 @@
public abstract class Shocker public abstract class Shocker
{ {
public string ApiKey, Endpoint; protected readonly HttpClient HttpClient;
public enum ControlAction { Beep, Vibrate, Shock } protected readonly string ApiKey;
public abstract void Control(ControlAction action, byte intensity, short duration); protected readonly string Endpoint;
protected string[] ShockerIds;
public Shocker(string endpoint, string apiKey) public enum ControlAction { Beep, Vibrate, Shock }
public abstract void Control(ControlAction action, byte intensity, short duration, string? shockerId = null);
protected Shocker(string endpoint, string apiKey, string[] shockerIds)
{ {
this.Endpoint = endpoint; this.Endpoint = endpoint;
this.ApiKey = apiKey; this.ApiKey = apiKey;
this.HttpClient = new HttpClient();
this.ShockerIds = shockerIds;
} }
} }