JsonConverter

This commit is contained in:
glax 2024-01-20 20:27:50 +01:00
parent 2d47aa7492
commit 67bb9c4f9a
2 changed files with 7 additions and 1 deletions

View File

@ -7,7 +7,7 @@
<Authors>Glax</Authors>
<RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>1.3.1</Version>
<Version>1.3.2</Version>
</PropertyGroup>
<ItemGroup>

View File

@ -29,6 +29,12 @@ public class ShockerJsonConverter : JsonConverter
jo.SelectToken("Endpoint")!.Value<string>()!
);
case ShockerApi.OpenShockSerial:
return new OpenShockSerial(
jo.SelectToken("Model")!.ToObject<Dictionary<string, OpenShockSerial.ShockerModel>>()!,
jo.SelectToken("IntensityRange")!.ToObject<IntensityRange>()!,
jo.SelectToken("DurationRange")!.ToObject<DurationRange>()!,
jo.SelectToken("SerialPortI")!.ToObject<SerialShocker.SerialPortInfo>()!
);
case ShockerApi.PiShockHttp:
return new PiShockHttp(
jo.SelectToken("ShockerIds")!.ToObject<List<string>>()!,