Skip to content

Commit

Permalink
Update the other hw tests for the new RGBW algorithm
Browse files Browse the repository at this point in the history
oops! 🤦‍♂️
  • Loading branch information
toomanybrians committed Oct 14, 2023
1 parent 81b5f17 commit 9a348ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mpf/tests/test_Fadecandy.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def test_led_color(self):
self._messages = []
self.machine.lights["test_rgbw"].on(priority=10, key="test")
self.advance_time_and_run(.1)
self.assertOpenPixelLedsSent({}, {}, {0: (255, 255, 255), 1: (0, 255, 0)})
self.assertOpenPixelLedsSent({}, {}, {0: (0, 0, 0), 1: (0, 255, 0)})

self._messages = []
self.machine.lights["test_rgbw"].color("red", priority=20, key="test")
Expand Down
4 changes: 2 additions & 2 deletions mpf/tests/test_Lisy.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ def test_lights(self):

# set color to the second light without fade
self.serialMock.expected_commands = {
b'\x0d\x00\x03\x00\x00\x04\x11\x22\x33\x11': None, # fade with 0ms fade time starting at channel 3
b'\x0d\x00\x03\x00\x00\x04\x00\x11\x22\x11': None, # fade with 0ms fade time starting at channel 3
# 4 channels because this is a RGBW light
}
self.machine.lights["test_light1"].color([0x11, 0x22, 0x33])
Expand All @@ -856,7 +856,7 @@ def test_lights(self):
# fade both lights together (fade depending on serial timing)
self.serialMock.expected_commands = {
b'\x0d\x00\x00\x01\x18\x07\xaa\xbb\xcc\xdd\xee\xff\xdd': None, # fade with 300ms fade time
b'\x0d\x00\x00\x01\x19\x07\xaa\xbb\xcc\xdd\xee\xff\xdd': None, # fade with 300ms fade time
b'\x0d\x00\x00\x01\x19\x07\xaa\xbb\xcc\x00\x11\x22\xdd': None, # fade with 300ms fade time
b'\x0d\x00\x00\x01\x20\x07\xaa\xbb\xcc\xdd\xee\xff\xdd': None, # fade with 300ms fade time
b'\x0d\x00\x00\x01\x21\x07\xaa\xbb\xcc\xdd\xee\xff\xdd': None, # fade with 300ms fade time
b'\x0d\x00\x00\x01\x22\x07\xaa\xbb\xcc\xdd\xee\xff\xdd': None, # fade with 300ms fade time
Expand Down
7 changes: 3 additions & 4 deletions mpf/tests/test_PKONE.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def _test_ws281x_led(self):

# test turning on rgb led out of hardware alignment using color
self.controller.expected_commands = {
"PLB2103020000255192203192000000": None,
"PLB2103020000063000011192000000": None,
}
self.machine.lights["test_rgb_led_3"].color(RGBColor("pink"))
self.advance_time_and_run(.1)
Expand All @@ -720,7 +720,7 @@ def _test_ws281x_led(self):
self.advance_time_and_run(.5)
self.assertEqual(14, len(self.controller.sent_commands))
self.assertEqual("PLB2103020000000000000000000000", self.controller.sent_commands[0])
self.assertEqual("PLB2103020000255192203192000000", self.controller.sent_commands[-1])
self.assertEqual("PLB2103020000063000011192000000", self.controller.sent_commands[-1])
self.controller.reset()

# test turning off rgb led out of hardware alignment with fade (uses software fade) and turning on
Expand All @@ -731,7 +731,7 @@ def _test_ws281x_led(self):
self.advance_time_and_run(.5)
self.assertEqual(15, len(self.controller.sent_commands))
self.assertEqual("PLB2101010025000000255", self.controller.sent_commands[0])
self.assertEqual("PLB2103020000255192203192000000", self.controller.sent_commands[1])
self.assertEqual("PLB2103020000063000011192000000", self.controller.sent_commands[1])
self.assertEqual("PLB2103020000000000000000000000", self.controller.sent_commands[-1])
self.controller.reset()

Expand Down Expand Up @@ -807,4 +807,3 @@ def _test_led_hardware_alignment(self):
self.assertTrue(self.machine.default_platform._led_is_hardware_aligned("test_rgbw_led_2"))
self.assertFalse(self.machine.default_platform._led_is_hardware_aligned("test_rgbw_led_3"))
self.assertFalse(self.machine.default_platform._led_is_hardware_aligned("test_rgbw_led_4"))

0 comments on commit 9a348ad

Please sign in to comment.