diff --git a/src/Kevsoft.WLED/Kevsoft.WLED.csproj b/src/Kevsoft.WLED/Kevsoft.WLED.csproj
index e8c171a..3898f26 100644
--- a/src/Kevsoft.WLED/Kevsoft.WLED.csproj
+++ b/src/Kevsoft.WLED/Kevsoft.WLED.csproj
@@ -23,8 +23,8 @@
-
-
+
+
diff --git a/src/Kevsoft.WLED/LedsResponse.cs b/src/Kevsoft.WLED/LedsResponse.cs
index dd0c0eb..36e311d 100644
--- a/src/Kevsoft.WLED/LedsResponse.cs
+++ b/src/Kevsoft.WLED/LedsResponse.cs
@@ -37,4 +37,16 @@ public sealed class LedsResponse
///
[JsonPropertyName("maxseg")]
public byte MaximumSegments { get; set; }
+
+ ///
+ /// Preset number loaded on boot.
+ ///
+ [JsonPropertyName("bootps")]
+ public int BootupPreset { get; set; }
+
+ ///
+ /// Matrix configuration
+ ///
+ [JsonPropertyName("matrix")]
+ public MatrixResponse Matrix { get; set; } = null!;
}
\ No newline at end of file
diff --git a/src/Kevsoft.WLED/MatrixResponse.cs b/src/Kevsoft.WLED/MatrixResponse.cs
new file mode 100644
index 0000000..a227456
--- /dev/null
+++ b/src/Kevsoft.WLED/MatrixResponse.cs
@@ -0,0 +1,12 @@
+namespace Kevsoft.WLED;
+
+public class MatrixResponse
+{
+ /// The number of LEDs in the width of the matrix
+ [JsonPropertyName("w")]
+ public int Width { get; set; }
+
+ /// The number of LEDs in the Height of the matrix
+ [JsonPropertyName("h")]
+ public int Height { get; set; }
+}
\ No newline at end of file
diff --git a/src/Kevsoft.WLED/SegmentRequest.cs b/src/Kevsoft.WLED/SegmentRequest.cs
index 4dcd34f..d1486b7 100644
--- a/src/Kevsoft.WLED/SegmentRequest.cs
+++ b/src/Kevsoft.WLED/SegmentRequest.cs
@@ -87,6 +87,9 @@ public sealed class SegmentRequest
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Mirror { get; set; }
+ [JsonPropertyName("i")]
+ public object[] IndividualLedControl { get; set; } = [];
+
public static SegmentRequest From(SegmentResponse segmentResponse)
{
diff --git a/src/Kevsoft.WLED/SingleLedRequest.cs b/src/Kevsoft.WLED/SingleLedRequest.cs
new file mode 100644
index 0000000..b04e807
--- /dev/null
+++ b/src/Kevsoft.WLED/SingleLedRequest.cs
@@ -0,0 +1,10 @@
+namespace Kevsoft.WLED;
+
+public sealed class SingleLedRequest
+{
+ /// The position of the LED in the segment
+ public int LedPosition { get; set; }
+
+ /// The color of the LED as HEX (e.g. FF0000 for red)
+ public string Color { get; set; } = string.Empty;
+}
diff --git a/src/Kevsoft.WLED/WLedClient.cs b/src/Kevsoft.WLED/WLedClient.cs
index ccddbba..4e7618c 100644
--- a/src/Kevsoft.WLED/WLedClient.cs
+++ b/src/Kevsoft.WLED/WLedClient.cs
@@ -61,7 +61,7 @@ public async Task GetPalettes()
var message = await _client.GetAsync("json/pal");
message.EnsureSuccessStatusCode();
-
+
return (await message.Content.ReadFromJsonAsync())!;
}
@@ -73,7 +73,7 @@ public async Task Post(WLedRootRequest request)
var result = await _client.PostAsync("/json", content);
result.EnsureSuccessStatusCode();
}
-
+
public async Task Post(StateRequest request)
{
var stateString = JsonSerializer.Serialize(request);
@@ -82,4 +82,74 @@ public async Task Post(StateRequest request)
var result = await _client.PostAsync("/json/state", content);
result.EnsureSuccessStatusCode();
}
-}
\ No newline at end of file
+
+ public async Task Post(List ledList)
+ {
+ // Eliminate duplicate positions
+ ledList = ledList.GroupBy(x => x.LedPosition).Select(x => x.Last()).ToList();
+
+ List