File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,22 @@ rather than deprecated, so consuming code must be updated.
3939 request types, preventing accidental round-tripping of read-only fields.
4040- Posting state is now done through intent methods or ` UpdateState(...) ` rather than mutating
4141 and re-posting a response object.
42+ - ** ` SetColor ` /` SetEffect ` /` SetPalette ` with no ` segmentId ` now target the * selected* segments**
43+ (the WLED ` "seg":{…} ` object form) instead of segment 0. The state ` seg ` field is modelled as
44+ a ` SegmentPayload ` union that serialises as either an object (selected segments) or an array
45+ (id-targeted).
46+ - ** Transition values (` transition ` /` tt ` ) widened from ` byte ` to ` ushort ` ** to support the
47+ documented ` 0–65535 ` range (~ 109 minutes) instead of clamping at 25.5 s.
48+ - ** ` ColorTemperature.Kelvin ` range widened to ` 1000–20000 K ` ** to match the docs' forward-
49+ compatible guidance, with a new ` ColorTemperature.KelvinUnchecked(int) ` escape hatch for
50+ values outside that range.
51+
52+ ### Added
53+
54+ - ** Ranged-random effect/palette selection** via ` Selector.RandomInRange(from, to) `
55+ (the WLED ` "from~tor" ` token).
56+ - ** Typed device-configuration fields** for ` id.mdns ` , ` if.mqtt ` (` en ` /` broker ` /` port ` /` user ` /` cid ` )
57+ and ` def ` (` on ` /` bri ` /` ps ` ), while preserving all other keys through ` JsonExtensionData ` .
4258
4359### Removed
4460
Original file line number Diff line number Diff line change @@ -51,13 +51,19 @@ await client.TurnOff();
5151await client .Toggle ();
5252
5353await client .SetBrightness (200 );
54- await client .SetColor (RgbColor .FromHex (" FFAA00" ));
55- await client .SetEffect (9 ); // by effect id
56- await client .SetPalette (11 ); // by palette id
54+ await client .SetColor (RgbColor .FromHex (" FFAA00" )); // selected segments
55+ await client .SetColor (RgbColor .FromHex (" FFAA00" ), segmentId : 1 );
56+ await client .SetEffect (9 ); // by effect id
57+ await client .SetPalette (11 ); // by palette id
58+ await client .SetEffect (Selector .Random ); // random effect
59+ await client .SetPalette (Selector .RandomInRange (5 , 10 )); // random palette in a range
5760
5861await client .Reboot ();
5962```
6063
64+ With no ` segmentId ` , ` SetColor ` /` SetEffect ` /` SetPalette ` target the currently * selected*
65+ segments (the WLED ` "seg":{…} ` object form); pass a ` segmentId ` to target one segment.
66+
6167### Reading data
6268
6369``` csharp
@@ -76,6 +82,7 @@ Build a sparse update that only sends the fields you set:
7682await client .UpdateState (update => update
7783 .TurnOn ()
7884 .Brightness (128 )
85+ .Transition (TimeSpan .FromSeconds (2 )) // crossfade, up to ~109 minutes
7986 .Segment (0 , segment => segment
8087 .Effect (0 )
8188 .Color (RgbColor .FromHex (" 0066FF" ))
Original file line number Diff line number Diff line change 77
88await client . TurnOn ( ) ;
99await client . SetBrightness ( 200 ) ;
10- await client . SetColor ( RgbColor . FromHex ( "FFAA00" ) ) ; // warm orange
10+ await client . SetColor ( RgbColor . FromHex ( "FFAA00" ) ) ; // warm orange, selected segments
1111await client . SetEffect ( 9 ) ; // "Rainbow"
12- await client . SetPalette ( 11 ) ; // "Rainbow"
12+ await client . SetPalette ( Selector . RandomInRange ( 5 , 10 ) ) ; // random palette in a range
1313
1414// --- Reading state ---------------------------------------------------------
1515
2424await client . UpdateState ( update => update
2525 . TurnOn ( )
2626 . Brightness ( 128 )
27+ . Transition ( TimeSpan . FromSeconds ( 2 ) )
2728 . Segment ( 0 , segment => segment
2829 . Effect ( 0 )
2930 . Color ( RgbColor . FromHex ( "0066FF" ) ) ) ) ;
You can’t perform that action at this time.
0 commit comments