From 9a348ad43ec0ad83fbe940d9c1333c08458f67c6 Mon Sep 17 00:00:00 2001 From: Brian Madden Date: Sat, 14 Oct 2023 07:23:55 +0200 Subject: [PATCH] Update the other hw tests for the new RGBW algorithm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit oops! 🤦‍♂️ --- mpf/tests/test_Fadecandy.py | 2 +- mpf/tests/test_Lisy.py | 4 ++-- mpf/tests/test_PKONE.py | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mpf/tests/test_Fadecandy.py b/mpf/tests/test_Fadecandy.py index 85c515e2b..cae9dcdbf 100644 --- a/mpf/tests/test_Fadecandy.py +++ b/mpf/tests/test_Fadecandy.py @@ -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") diff --git a/mpf/tests/test_Lisy.py b/mpf/tests/test_Lisy.py index 530fbf6f6..11f7cbe69 100644 --- a/mpf/tests/test_Lisy.py +++ b/mpf/tests/test_Lisy.py @@ -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]) @@ -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 diff --git a/mpf/tests/test_PKONE.py b/mpf/tests/test_PKONE.py index 0b4b48d60..fea859c5a 100644 --- a/mpf/tests/test_PKONE.py +++ b/mpf/tests/test_PKONE.py @@ -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) @@ -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 @@ -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() @@ -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")) -