MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_ws2812_variants

Method test_ws2812_variants

ci/test_led_timing_conversion.py:149–161  ·  view source on GitHub ↗

Test specific WS2812 variants with known datasheet values.

(self)

Source from the content-addressed store, hash-verified

147 self.fail("\n".join(failures))
148
149 def test_ws2812_variants(self) -> None:
150 """Test specific WS2812 variants with known datasheet values."""
151
152 # WS2812 typical datasheet values (tight timing)
153 # These should produce the optimized T1=250, T2=625, T3=375
154 ws2812_tight = TimingDatasheet(
155 T0H=250, T0L=1000, T1H=875, T1L=375, name="WS2812_Tight"
156 )
157
158 fl = datasheet_to_phase3(ws2812_tight)
159 self.assertEqual(fl.T1, 250, "WS2812 T1 mismatch")
160 self.assertEqual(fl.T2, 625, "WS2812 T2 mismatch")
161 self.assertEqual(fl.T3, 375, "WS2812 T3 mismatch")
162
163 def test_protocol_semantics(self) -> None:
164 """Verify conversion respects protocol timing semantics."""

Callers

nothing calls this directly

Calls 2

TimingDatasheetClass · 0.90
datasheet_to_phase3Function · 0.90

Tested by

no test coverage detected