This commit is contained in:
Locxion
2024-02-01 21:43:03 +01:00
commit efe6863b14
22 changed files with 885 additions and 0 deletions

View File

@ -0,0 +1,7 @@
namespace GoveeCSharpConnector.Objects;
public class ApiResponse
{
public string? Message { get; set; }
public int Code { get; set; }
}

View File

@ -0,0 +1,8 @@
using System.Collections.Generic;
namespace GoveeCSharpConnector.Objects;
public class Data
{
public List<GoveeApiDevice> Devices { get; set; }
}

View File

@ -0,0 +1,14 @@
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; }
}

View File

@ -0,0 +1,17 @@
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; }
}

View File

@ -0,0 +1,16 @@
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; }
}

View File

@ -0,0 +1,6 @@
namespace GoveeCSharpConnector.Objects;
public class GoveeResponse : ApiResponse
{
public Data Data { get; set; }
}

View File

@ -0,0 +1,13 @@
// ReSharper disable InconsistentNaming
namespace GoveeCSharpConnector.Objects;
public class GoveeUdpDevice
{
public string ip { get; set; }
public string device { get; set; }
public string sku { get; set; }
public string bleVersionHard { get; set; }
public string bleVersionSoft { get; set; }
public string wifiVersionHard { get; set; }
public string wifiVersionSoft { get; set; }
}

View File

@ -0,0 +1,12 @@
// ReSharper disable InconsistentNaming
namespace GoveeCSharpConnector.Objects;
public class GoveeUdpMessage
{
public msg msg { get; set; }
}
public class msg
{
public string cmd { get; set; }
public object data { get; set; }
}

View File

@ -0,0 +1,11 @@
using GoveeCSharpConnector.Enums;
namespace GoveeCSharpConnector.Objects;
public class GoveeUdpState
{
public PowerState onOff { get; set; }
public short brightness { get; set; }
public RgbColor color { get; set; }
public int colorTempInKelvin { get; set; }
}

View File

@ -0,0 +1,12 @@
using GoveeCSharpConnector.Enums;
namespace GoveeCSharpConnector.Objects;
public class Properties
{
public bool Online { get; set; }
public PowerState PowerState { get; set; }
public int Brightness { get; set; }
public int? ColorTemp { get; set; }
public RgbColor Color { get; set; }
}

View File

@ -0,0 +1,15 @@
namespace GoveeCSharpConnector.Objects;
public class RgbColor
{
public short R { get; set; }
public short G { get; set; }
public short B { get; set; }
public RgbColor(int r, int g, int b)
{
R = Convert.ToInt16(r);
G = Convert.ToInt16(g);
B = Convert.ToInt16(b);
}
}