Removed Example Console Project
Removed Old Api Classes Added new Http Api Service and Classes TODO Dynamic Effect Methods
This commit is contained in:
@ -1,7 +0,0 @@
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
|
||||
public class ApiResponse
|
||||
{
|
||||
public string? Message { get; set; }
|
||||
public int Code { get; set; }
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
|
||||
public class Data
|
||||
{
|
||||
public List<GoveeApiDevice> Devices { get; set; }
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
|
||||
public class GoveeApiCommand
|
||||
{
|
||||
public string Device { get; set; }
|
||||
public string Model { get; set; }
|
||||
public Command Cmd { get; set; }
|
||||
}
|
||||
|
||||
public class Command
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public object Value { get; set; }
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
|
||||
public class GoveeApiDevice
|
||||
{
|
||||
[JsonPropertyName("device")]
|
||||
public string DeviceId { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string DeviceName { get; set; }
|
||||
public bool Controllable { get; set; }
|
||||
public bool Retrievable { get; set; }
|
||||
[JsonPropertyName("supportCmds")]
|
||||
public List<string> SupportedCommands { get; set; }
|
||||
public Properties Properties { get; set; }
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
|
||||
public class GoveeApiState
|
||||
{
|
||||
[JsonPropertyName("device")]
|
||||
public string DeviceId { get; set; }
|
||||
|
||||
public string Model { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Properties Properties { get; set; }
|
||||
}
|
14
GoveeCSharpConnector/Objects/GoveeHttpDevice.cs
Normal file
14
GoveeCSharpConnector/Objects/GoveeHttpDevice.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using GoveeCSharpConnector.Objects.Misc;
|
||||
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
|
||||
public class GoveeHttpDevice
|
||||
{
|
||||
[JsonPropertyName("sku")]
|
||||
public string Model { get; set; }
|
||||
[JsonPropertyName("device")]
|
||||
public string Device { get; set; }
|
||||
[JsonPropertyName("capabilities")]
|
||||
public List<Capability> Capabilities { get; set; }
|
||||
}
|
16
GoveeCSharpConnector/Objects/GoveeHttpState.cs
Normal file
16
GoveeCSharpConnector/Objects/GoveeHttpState.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using GoveeCSharpConnector.Objects.Misc;
|
||||
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
|
||||
public class GoveeHttpState
|
||||
{
|
||||
[JsonPropertyName("requestId")]
|
||||
public string RequestId { get; set; }
|
||||
[JsonPropertyName("msg")]
|
||||
public string Msg { get; set; }
|
||||
[JsonPropertyName("code")]
|
||||
public long Code { get; set; }
|
||||
[JsonPropertyName("payload")]
|
||||
public Payload Payload { get; set; }
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
|
||||
public class GoveeResponse : ApiResponse
|
||||
{
|
||||
public Data Data { get; set; }
|
||||
}
|
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; }
|
||||
}
|
@ -1,12 +1,18 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using GoveeCSharpConnector.Enums;
|
||||
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
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