Init
This commit is contained in:
7
GoveeCSharpConnector/Objects/ApiResponse.cs
Normal file
7
GoveeCSharpConnector/Objects/ApiResponse.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
|
||||
public class ApiResponse
|
||||
{
|
||||
public string? Message { get; set; }
|
||||
public int Code { get; set; }
|
||||
}
|
8
GoveeCSharpConnector/Objects/Data.cs
Normal file
8
GoveeCSharpConnector/Objects/Data.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
|
||||
public class Data
|
||||
{
|
||||
public List<GoveeApiDevice> Devices { get; set; }
|
||||
}
|
14
GoveeCSharpConnector/Objects/GoveeApiCommand.cs
Normal file
14
GoveeCSharpConnector/Objects/GoveeApiCommand.cs
Normal 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; }
|
||||
}
|
17
GoveeCSharpConnector/Objects/GoveeApiDevice.cs
Normal file
17
GoveeCSharpConnector/Objects/GoveeApiDevice.cs
Normal 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; }
|
||||
}
|
16
GoveeCSharpConnector/Objects/GoveeApiState.cs
Normal file
16
GoveeCSharpConnector/Objects/GoveeApiState.cs
Normal 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; }
|
||||
}
|
6
GoveeCSharpConnector/Objects/GoveeResponse.cs
Normal file
6
GoveeCSharpConnector/Objects/GoveeResponse.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace GoveeCSharpConnector.Objects;
|
||||
|
||||
public class GoveeResponse : ApiResponse
|
||||
{
|
||||
public Data Data { get; set; }
|
||||
}
|
13
GoveeCSharpConnector/Objects/GoveeUdpDevice.cs
Normal file
13
GoveeCSharpConnector/Objects/GoveeUdpDevice.cs
Normal 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; }
|
||||
}
|
12
GoveeCSharpConnector/Objects/GoveeUdpMessage.cs
Normal file
12
GoveeCSharpConnector/Objects/GoveeUdpMessage.cs
Normal 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; }
|
||||
}
|
11
GoveeCSharpConnector/Objects/GoveeUdpState.cs
Normal file
11
GoveeCSharpConnector/Objects/GoveeUdpState.cs
Normal 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; }
|
||||
}
|
12
GoveeCSharpConnector/Objects/Properties.cs
Normal file
12
GoveeCSharpConnector/Objects/Properties.cs
Normal 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; }
|
||||
}
|
15
GoveeCSharpConnector/Objects/RgbColor.cs
Normal file
15
GoveeCSharpConnector/Objects/RgbColor.cs
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user