Skip to content

Commit 9381c27

Browse files
committed
Merge branch 'Grepsy_master'
2 parents 905cd60 + f6975a9 commit 9381c27

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

src/Kevsoft.WLED/StateRequest.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ public sealed class StateRequest
5151
[JsonPropertyName("seg")]
5252
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
5353
public SegmentRequest[]? Segments { get; set; } = null!;
54-
54+
55+
/// <summary>
56+
/// Timebase for effects.
57+
/// </summary>
58+
[JsonPropertyName("tb")]
59+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
60+
public int? Timebase { get; set; }
61+
5562
public static StateRequest From(StateResponse stateResponse)
5663
{
5764
return new StateRequest()
@@ -65,7 +72,8 @@ public static StateRequest From(StateResponse stateResponse)
6572
UdpPackets = stateResponse.UdpPackets,
6673
LiveDataOverride = stateResponse.LiveDataOverride,
6774
MainSegment = stateResponse.MainSegment,
68-
Segments = stateResponse.Segments.Select(SegmentRequest.From).ToArray()
75+
Segments = stateResponse.Segments.Select(SegmentRequest.From).ToArray(),
76+
Timebase = stateResponse.Timebase
6977
};
7078
}
7179

src/Kevsoft.WLED/StateResponse.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,11 @@ public sealed class StateResponse
6161
/// </summary>
6262
[JsonPropertyName("seg")]
6363
public SegmentResponse[] Segments { get; set; } = null!;
64+
65+
/// <summary>
66+
/// Timebase for effects.
67+
/// </summary>
68+
[JsonPropertyName("tb")]
69+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
70+
public int? Timebase { get; set; }
6471
}

test/Kevsoft.WLED.Tests/JsonBuilder.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public static string CreateStateJson(StateResponse state)
4444
""on"": {seg.SegmentState.ToString().ToLower()},
4545
""bri"": {seg.Brightness}
4646
}}";
47-
}))}]
47+
}))}],
48+
""tb"": {state.Timebase}
4849
}}";
4950
}
5051

0 commit comments

Comments
 (0)