JsonConverter fix OpenShockHttp, add PiShockHttp
This commit is contained in:
parent
eb82034190
commit
aefe3ab30b
@ -7,7 +7,7 @@
|
||||
<Authors>Glax</Authors>
|
||||
<RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<Version>1.2.1</Version>
|
||||
<Version>1.2.2</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -25,11 +25,20 @@ public class ShockerJsonConverter : JsonConverter
|
||||
jo.SelectToken("ShockerIds")!.ToObject<List<string>>()!,
|
||||
jo.SelectToken("IntensityRange")!.ToObject<IntensityRange>()!,
|
||||
jo.SelectToken("DurationRange")!.ToObject<DurationRange>()!,
|
||||
jo.SelectToken("Endpoint")!.Value<string>()!,
|
||||
jo.SelectToken("ApiKey")!.Value<string>()!
|
||||
jo.SelectToken("ApiKey")!.Value<string>()!,
|
||||
jo.SelectToken("Endpoint")!.Value<string>()!
|
||||
);
|
||||
case ShockerApi.OpenShockSerial:
|
||||
case ShockerApi.PiShockHttp:
|
||||
return new PiShockHttp(
|
||||
jo.SelectToken("ShockerIds")!.ToObject<List<string>>()!,
|
||||
jo.SelectToken("IntensityRange")!.ToObject<IntensityRange>()!,
|
||||
jo.SelectToken("DurationRange")!.ToObject<DurationRange>()!,
|
||||
jo.SelectToken("ApiKey")!.Value<string>()!,
|
||||
jo.SelectToken("Username")!.Value<string>()!,
|
||||
jo.SelectToken("ShareCode")!.Value<string>()!,
|
||||
jo.SelectToken("Endpoint")!.Value<string>()!
|
||||
);
|
||||
case ShockerApi.PiShockSerial:
|
||||
throw new NotImplementedException();
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user