@@ -87,27 +87,27 @@ def test_8bit_rgbw_light_updates(self):
8787 white : DmxNumberEntity = get_entity_by_name (entities , 'RGBW fader White' )
8888 light : DmxLightEntity = get_entity_by_name (entities , 'RGBW fader Light' )
8989
90- # Test setting pure red
91- asyncio .run (light .async_turn_on (rgbw_color = (255 , 0 , 0 , 0 )))
92- assert_dmx_range (self .universe , 2 , [255 , 0 , 0 , 0 ])
90+ asyncio .run (light .async_turn_on (rgbw_color = (255 , 128 , 64 , 0 )))
91+ assert_dmx_range (self .universe , 2 , [255 , 128 , 64 , 0 ])
9392 self .assertEqual (100 , red .native_value )
94- self .assertEqual (0 , green .native_value )
95- self .assertEqual (0 , blue .native_value )
93+ self .assertAlmostEqual (50.0 , green .native_value , 0 )
94+ self .assertAlmostEqual (25.0 , blue .native_value , 0 )
95+ self .assertEqual (0 , white .native_value )
96+
97+ asyncio .run (light .async_turn_on (brightness = 128 ))
98+ assert_dmx_range (self .universe , 2 , [128 , 64 , 32 , 0 ])
99+ self .assertAlmostEqual (50.0 , red .native_value , 0 )
100+ self .assertAlmostEqual (25.0 , green .native_value , 0 )
101+ self .assertAlmostEqual (12.5 , blue .native_value , 0 )
96102 self .assertEqual (0 , white .native_value )
97103
98- # Test setting mixed color
99104 asyncio .run (light .async_turn_on (rgbw_color = (127 , 191 , 63 , 0 )))
100105 assert_dmx_range (self .universe , 2 , [127 , 191 , 63 , 0 ])
101106 self .assertAlmostEqual (50.0 , red .native_value , 0 )
102107 self .assertAlmostEqual (75.0 , green .native_value , 0 )
103108 self .assertAlmostEqual (25.0 , blue .native_value , 0 )
104109 self .assertEqual (0 , white .native_value )
105110
106- # Test setting white
107- asyncio .run (light .async_turn_on (rgbw_color = (255 , 255 , 255 , 0 )))
108- # White light might be handled differently - adjust expectations based on implementation
109- self .assertTrue (light .is_on )
110-
111111 def test_16bit_rgbw_number_updates (self ):
112112 channels = self .fixture .select_mode ('16bit' )
113113 entities = delegator .create_entities ('RGBW fader' , 3 , channels , None , self .universe )
@@ -118,7 +118,6 @@ def test_16bit_rgbw_number_updates(self):
118118 white : DmxNumberEntity = get_entity_by_name (entities , 'RGBW fader White' )
119119 light : DmxLightEntity = get_entity_by_name (entities , 'RGBW fader Light' )
120120
121- # Test pure red (16-bit: high byte, low byte for each channel)
122121 asyncio .run (red .async_set_native_value (100 ))
123122 asyncio .run (green .async_set_native_value (0 ))
124123 asyncio .run (blue .async_set_native_value (0 ))
@@ -127,7 +126,6 @@ def test_16bit_rgbw_number_updates(self):
127126 self .assertEqual (255 , light .brightness )
128127 self .assertEqual ((255 , 0 , 0 ), light .rgb_color )
129128
130- # Test mixed color
131129 asyncio .run (red .async_set_native_value (50 ))
132130 asyncio .run (green .async_set_native_value (75 ))
133131 asyncio .run (blue .async_set_native_value (25 ))
@@ -136,7 +134,6 @@ def test_16bit_rgbw_number_updates(self):
136134 self .assertEqual (191 , light .brightness )
137135 self .assertEqual ((127 , 191 , 64 ), light .rgb_color )
138136
139- # Test RGBW combination
140137 asyncio .run (red .async_set_native_value (50 ))
141138 asyncio .run (green .async_set_native_value (50 ))
142139 asyncio .run (blue .async_set_native_value (50 ))
0 commit comments