From 67bb9c4f9a1e8b132fe55f8a8e9c01eeeecda514 Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 20 Jan 2024 20:27:50 +0100 Subject: [PATCH] JsonConverter --- CShocker/CShocker.csproj | 2 +- CShocker/Shockers/ShockerJsonConverter.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CShocker/CShocker.csproj b/CShocker/CShocker.csproj index a384cff..2383eb7 100644 --- a/CShocker/CShocker.csproj +++ b/CShocker/CShocker.csproj @@ -7,7 +7,7 @@ Glax https://github.com/C9Glax/CShocker git - 1.3.1 + 1.3.2 diff --git a/CShocker/Shockers/ShockerJsonConverter.cs b/CShocker/Shockers/ShockerJsonConverter.cs index 0ee9554..4600880 100644 --- a/CShocker/Shockers/ShockerJsonConverter.cs +++ b/CShocker/Shockers/ShockerJsonConverter.cs @@ -29,6 +29,12 @@ public class ShockerJsonConverter : JsonConverter jo.SelectToken("Endpoint")!.Value()! ); case ShockerApi.OpenShockSerial: + return new OpenShockSerial( + jo.SelectToken("Model")!.ToObject>()!, + jo.SelectToken("IntensityRange")!.ToObject()!, + jo.SelectToken("DurationRange")!.ToObject()!, + jo.SelectToken("SerialPortI")!.ToObject()! + ); case ShockerApi.PiShockHttp: return new PiShockHttp( jo.SelectToken("ShockerIds")!.ToObject>()!,