Removed Example Console Project

Removed Old Api Classes
Added new Http Api Service and Classes
TODO Dynamic Effect Methods
This commit is contained in:
Markus Bender
2024-02-26 04:47:47 +01:00
parent 8cb2a51cd3
commit 368de74820
23 changed files with 388 additions and 200 deletions

View File

@ -0,0 +1,13 @@
using System.Text.Json.Serialization;
namespace GoveeCSharpConnector.Objects.Misc;
public class ApiResponse
{
[JsonPropertyName("code")]
public int Code { get; set; }
[JsonPropertyName("message")]
public string Message { get; set; }
[JsonPropertyName("data")]
public List<object> Data { get; set; }
}

View File

@ -0,0 +1,13 @@
using System.Text.Json.Serialization;
namespace GoveeCSharpConnector.Objects.Misc;
public class Capability
{
[JsonPropertyName("type")]
public string Type { get; set; }
[JsonPropertyName("instance")]
public string Instance { get; set; }
[JsonPropertyName("state")]
public State State { get; set; }
}

View File

@ -0,0 +1,21 @@
using System.Text.Json.Serialization;
namespace GoveeCSharpConnector.Objects.Misc;
public class Field
{
[JsonPropertyName("fieldName")]
public string FieldName { get; set; }
[JsonPropertyName("dataType")]
public string DataType { get; set; }
[JsonPropertyName("options")]
public List<Option> Options { get; set; }
[JsonPropertyName("required")]
public bool Required { get; set; }
[JsonPropertyName("range")]
public Range Range { get; set; }
[JsonPropertyName("unit")]
public string Unit { get; set; }
[JsonPropertyName("reauired")]
public bool? Reauired { get; set; }
}

View File

@ -0,0 +1,11 @@
using System.Text.Json.Serialization;
namespace GoveeCSharpConnector.Objects.Misc;
public class Option
{
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("value")]
public int Value { get; set; }
}

View File

@ -0,0 +1,17 @@
using System.Text.Json.Serialization;
namespace GoveeCSharpConnector.Objects.Misc;
public class Parameters
{
[JsonPropertyName("dataType")]
public string DataType { get; set; }
[JsonPropertyName("options")]
public List<Option> Options { get; set; }
[JsonPropertyName("unit")]
public string Unit { get; set; }
[JsonPropertyName("range")]
public Range Range { get; set; }
[JsonPropertyName("fields")]
public List<Field> Fields { get; set; }
}

View File

@ -0,0 +1,13 @@
using System.Text.Json.Serialization;
namespace GoveeCSharpConnector.Objects.Misc;
public class Payload
{
[JsonPropertyName("sku")]
public string Model { get; set; }
[JsonPropertyName("device")]
public string Device { get; set; }
[JsonPropertyName("capabilities")]
public List<Capability> Capabilities { get; set; }
}

View File

@ -0,0 +1,18 @@
using System.Text.Json.Serialization;
using GoveeCSharpConnector.Enums;
namespace GoveeCSharpConnector.Objects.Misc;
public class Properties
{
[JsonPropertyName("online")]
public bool Online { get; set; }
[JsonPropertyName("powerState")]
public PowerState PowerState { get; set; }
[JsonPropertyName("brightness")]
public int Brightness { get; set; }
[JsonPropertyName("colorTemp")]
public int ColorTemp { get; set; }
[JsonPropertyName("color")]
public RgbColor Color { get; set; }
}

View File

@ -0,0 +1,13 @@
using System.Text.Json.Serialization;
namespace GoveeCSharpConnector.Objects.Misc;
public class Range
{
[JsonPropertyName("min")]
public int Min { get; set; }
[JsonPropertyName("max")]
public int Max { get; set; }
[JsonPropertyName("precision")]
public int Precision { get; set; }
}

View File

@ -0,0 +1,8 @@
namespace GoveeCSharpConnector.Objects.Misc;
public class ServiceResponse<T>
{
public T? Data { get; set; }
public bool Success { get; set; } = true;
public string Message { get; set; } = string.Empty;
}

View File

@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace GoveeCSharpConnector.Objects.Misc;
public class State
{
[JsonPropertyName("value")]
public object Value { get; set; }
}