From c603fe0ccbde55567e3dd6a2322453d7e8405607 Mon Sep 17 00:00:00 2001 From: glax Date: Sun, 4 Feb 2024 16:25:15 +0100 Subject: [PATCH] Fix unecessary parameters in OpenShockApi.GetShockers(); --- CShocker/CShocker.csproj | 2 +- CShocker/Devices/Abstract/OpenShockApi.cs | 5 ++--- TestApp/Program.cs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CShocker/CShocker.csproj b/CShocker/CShocker.csproj index 7883af4..8c9e1cd 100644 --- a/CShocker/CShocker.csproj +++ b/CShocker/CShocker.csproj @@ -7,7 +7,7 @@ Glax https://github.com/C9Glax/CShocker git - 2.1.0 + 2.1.1 diff --git a/CShocker/Devices/Abstract/OpenShockApi.cs b/CShocker/Devices/Abstract/OpenShockApi.cs index 19fa01f..b1be275 100644 --- a/CShocker/Devices/Abstract/OpenShockApi.cs +++ b/CShocker/Devices/Abstract/OpenShockApi.cs @@ -35,10 +35,9 @@ public abstract class OpenShockApi : Api return HashCode.Combine(Endpoint, ApiKey); } - public List GetShockers(string apiKey, string apiEndpoint = DefaultEndpoint, - ILogger? logger = null) + public List GetShockers() { - return GetShockers(apiKey, this, apiEndpoint, logger); + return GetShockers(this.ApiKey, this, this.Endpoint, this.Logger); } public static List GetShockers(string apiKey, OpenShockApi api, string apiEndpoint = DefaultEndpoint, ILogger? logger = null) diff --git a/TestApp/Program.cs b/TestApp/Program.cs index be7458c..537b22c 100644 --- a/TestApp/Program.cs +++ b/TestApp/Program.cs @@ -47,7 +47,7 @@ while (!int.TryParse(selectedPortStr, out selectedPort) || selectedPort < 0 || s } OpenShockSerial openShockSerial = new(new IntensityRange(30, 50), new DurationRange(1000, 1000),serialPorts[selectedPort], apiKey, logger: logger); -OpenShockShocker shocker = openShockSerial.GetShockers(apiKey).First(); +OpenShockShocker shocker = openShockSerial.GetShockers().First(); shocker.Control(ControlAction.Vibrate, 20, 1000); File.WriteAllText("shockers.json", JsonConvert.SerializeObject(shocker)); OpenShockShocker deserialized = JsonConvert.DeserializeObject(File.ReadAllText("shockers.json"), new ApiJsonConverter())!;