Fix unecessary parameters in OpenShockApi.GetShockers();
This commit is contained in:
parent
f939e79e69
commit
c603fe0ccb
@ -7,7 +7,7 @@
|
||||
<Authors>Glax</Authors>
|
||||
<RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<Version>2.1.0</Version>
|
||||
<Version>2.1.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -35,10 +35,9 @@ public abstract class OpenShockApi : Api
|
||||
return HashCode.Combine(Endpoint, ApiKey);
|
||||
}
|
||||
|
||||
public List<OpenShockShocker> GetShockers(string apiKey, string apiEndpoint = DefaultEndpoint,
|
||||
ILogger? logger = null)
|
||||
public List<OpenShockShocker> GetShockers()
|
||||
{
|
||||
return GetShockers(apiKey, this, apiEndpoint, logger);
|
||||
return GetShockers(this.ApiKey, this, this.Endpoint, this.Logger);
|
||||
}
|
||||
|
||||
public static List<OpenShockShocker> GetShockers(string apiKey, OpenShockApi api, string apiEndpoint = DefaultEndpoint, ILogger? logger = null)
|
||||
|
@ -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<OpenShockShocker>(File.ReadAllText("shockers.json"), new ApiJsonConverter())!;
|
||||
|
Loading…
Reference in New Issue
Block a user