Removed Example Console Project
Removed Old Api Classes Added new Http Api Service and Classes TODO Dynamic Effect Methods
This commit is contained in:
13
GoveeCSharpConnector/Objects/Misc/ApiResponse.cs
Normal file
13
GoveeCSharpConnector/Objects/Misc/ApiResponse.cs
Normal 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; }
|
||||
}
|
13
GoveeCSharpConnector/Objects/Misc/Capability.cs
Normal file
13
GoveeCSharpConnector/Objects/Misc/Capability.cs
Normal 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; }
|
||||
}
|
21
GoveeCSharpConnector/Objects/Misc/Field.cs
Normal file
21
GoveeCSharpConnector/Objects/Misc/Field.cs
Normal 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; }
|
||||
}
|
11
GoveeCSharpConnector/Objects/Misc/Option.cs
Normal file
11
GoveeCSharpConnector/Objects/Misc/Option.cs
Normal 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; }
|
||||
}
|
17
GoveeCSharpConnector/Objects/Misc/Parameters.cs
Normal file
17
GoveeCSharpConnector/Objects/Misc/Parameters.cs
Normal 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; }
|
||||
}
|
13
GoveeCSharpConnector/Objects/Misc/Payload.cs
Normal file
13
GoveeCSharpConnector/Objects/Misc/Payload.cs
Normal 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; }
|
||||
}
|
18
GoveeCSharpConnector/Objects/Misc/Properties.cs
Normal file
18
GoveeCSharpConnector/Objects/Misc/Properties.cs
Normal 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; }
|
||||
}
|
13
GoveeCSharpConnector/Objects/Misc/Range.cs
Normal file
13
GoveeCSharpConnector/Objects/Misc/Range.cs
Normal 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; }
|
||||
}
|
8
GoveeCSharpConnector/Objects/Misc/ServiceResponse.cs
Normal file
8
GoveeCSharpConnector/Objects/Misc/ServiceResponse.cs
Normal 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;
|
||||
}
|
9
GoveeCSharpConnector/Objects/Misc/State.cs
Normal file
9
GoveeCSharpConnector/Objects/Misc/State.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace GoveeCSharpConnector.Objects.Misc;
|
||||
|
||||
public class State
|
||||
{
|
||||
[JsonPropertyName("value")]
|
||||
public object Value { get; set; }
|
||||
}
|
Reference in New Issue
Block a user