Skip to content

Commit f6975a9

Browse files
committed
Updating tests for Timebase and adding on to StateResponse.
1 parent c892650 commit f6975a9

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/Kevsoft.WLED/StateRequest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public static StateRequest From(StateResponse stateResponse)
7272
UdpPackets = stateResponse.UdpPackets,
7373
LiveDataOverride = stateResponse.LiveDataOverride,
7474
MainSegment = stateResponse.MainSegment,
75-
Segments = stateResponse.Segments.Select(SegmentRequest.From).ToArray()
75+
Segments = stateResponse.Segments.Select(SegmentRequest.From).ToArray(),
76+
Timebase = stateResponse.Timebase
7677
};
7778
}
7879

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)